• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Editing KFPawn_Human object

Vertical Loop

Member
May 30, 2015
20
10
Trying to figure out a way to edit the


Begin Object Name=SpecialMoveHandler_0
SpecialMoveClasses(SM_GrappleVictim)=class'KFGame.KFSM_GrappleVictim'
SpecialMoveClasses(SM_DisabledGrappleVictim)=class'KFGame.KFSM_DisabledGrappleVictim'
SpecialMoveClasses(SM_HansGrappleVictim)=class'KFGame.KFSM_HansGrappleVictim'
SpecialMoveClasses(SM_Emote)=class'KFGame.KFSM_Player_Emote'
SpecialMoveClasses(SM_DARGrappleVictim)=class'KFGame.KFSM_EvilDAR_EMPGrapple'
SpecialMoveClasses(SM_BloatKingGorgeVictim)=class'KFGame.KFSM_BloatKingGorgeVictim'
End Object

in KFPawn_Human.uc to add a new special move. I know you can use ModifyPlayer() to edit values within the hum an pawn function, but I can't figure out syntactically how to edit an object to add a new item/ replace the old set with a new set, which simply includes a new item.
 
Didn't try to add any special moves myself but if you do it through mutator you can replace pawn class in InitMutator with your packagename.classname pawn, then edit its enum ESpecialMove type and default propetries by adding new move
Spoiler!
 
  • Like
Reactions: Vertical Loop
Upvote 0
For those of you who show up in the future and notice that the question wasn't specifically answered, here is what I did to get my specialmove working.
(I hate it when I view a forum and theres not a specific answer, I code for a living)

A: replace the HumanClass like simplecat said (god bless)
B: my special move involved accrued affliction from a zed attack so make sure to set the IncapSettings
for accruing the affliction you can just add a meelee helper .uc

Code:
simulated function PlayMeleeHitEffects(Actor Target, vector HitLocation, vector HitDirection, optional bool bShakeInstigatorCamera=true)
{
    Super.PlayMeleeHitEffects(Target,HitLocation,HitDirection,bShakeInstigatorCamera);
    if( WorldInfo.NetMode!=NM_Client && KFPawn(Target)!=None && KFPawn(Target).Health>0 && KFPawn(Target).AfflictionHandler!=None )
        KFPawn(Target).AfflictionHandler.AccrueAffliction(AF_mycondition,PowerAmount);
}

Then handle the zeds damage type under default settings by

Code:
    Begin Object Class=MeleeHelper Name=MeleeHelper_0
        BaseDamage=10.f
        MaxHitRange=210.f
        MomentumTransfer=25000.f
    End Object
    MeleeAttackHelper=MeleeHelper_0

Then under your human pawns default properties

Code:
IncapSettings(AF_mycondition)=(Vulnerability=(50.f), Cooldown=0.0, Duration=1.0)
We do this because if it is not defined the AccruedAffliction method/function will think that the pawn is immune
C: add another item to the object
Code:
    Begin Object Name=SpecialMoveHandler_0

        SpecialMoveClasses(SM_mycondition)=class'ihd_edit.KFSM_SpecialMoveClass'

    End Object
The nametype SpecialMovehandler_0 is the same as the extended class, which means it will (I assume) append to the special moves.
This same syntax can be seem with WireframeColor under KFPawn_Monster and KFPawn, an object item which doesn't exist under KFPawnSkeletalMeshComponent is added under KFPawn_Monster's KFPawnSkeletalMeshComponent

D: Create your specialmove class and handle 'SpecialMoveStarted'

Code:
function SpecialMoveStarted(bool bForced, Name PrevMove )
{
    super.SpecialMoveStarted( bForced, PrevMove );
    `log("SpecialMoveAccomplished");

}

You also have to append the ESpecialMoves enum in KFPawn for your SM_mycondition
and EAfflictionType in KFAfflictionManager for your AF_mycondition, but I don't really know the syntax on how to do that as Ijust used a preexisting specialmove in the enumerations

There's also the creation of your own affliction type, which would just consist of calling the special move, like how KFAffliction_Freeze does
 
Last edited:
  • Like
Reactions: simplecat
Upvote 0