Home Unreal Engine

take damage overriding my main animation. please help

can anyone help me on this problem:
its for a school project.

http://youtu.be/G96BxjNYKIA

where do i disable this?

Replies

  • Stvv
    Options
    Offline / Send Message
    Not sure if this is any help, but would the take damage animation not run every time he takes damage, and since it is DPS that would be every second?
  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 19
    Hm..well, this should be pretty easy with a bit of scripting...but I can't tell waht your familiarity level with that is. You'd literally override a function called TakeDamage and just have it to modify health without calling any animations or anything...but if you're not familiar with scripting it's got a bit of a setup curve to it.

    You could replace the TakeDamage animation with a 0-second long anim as a short-term hack...or you could see if there's a pawn class you could use that doesn't have the behaviors you're not liking...but the scripting is probably the proper way to go here.

    Ambershee would probably know more--he stops in around here every so often.
  • JZChughtai
    Options
    Offline / Send Message
    actually i am basically a 3d artist, i don't know much about scripting. for the past month, i have been struggling to simply put a playable pawn into udk..is there anyone who could write the code for me? or if it is not possible, is there anyway to do it with kismet? any kind of node that i could use to disable it?... kismet is more userfriendly, i could be able to manage somthing with it.

    i posted the same thread into the udk forum but no one responded it, so i was thinking maybe someone here could be gentle enough to help me. it would be appreciated.

    thank you in advance guys, (sorry for my english)

    [
  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 19
    hmmm...if you want to go the kismet route, maybe look into the 'consolecommand' kismet node and use it to call 'god' and that should toggle god mode. Maaaybe that will override the animation call. There's also a godmode flag in the enable cinematicmode toggle kismet node...I suppose you could turn everything else off but that on to get the same effect. maybe.
  • JZChughtai
    Options
    Offline / Send Message
    well at some point, i do want the player to die. this is why i was using the lavavolume. the godmode don't actually let the player die....

    actually the rules are simple: you run and grab power-up. when you're in-game you are constantly losing your health. more like the movie crank with jason statham if you know what i mean.
  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 19
    ah, maybe don't use a lavavolume?

    instead try adding a kismet node that modifies health every few seconds..? I'm not positive, but that might bypass the animation call too.
  • JZChughtai
    Options
    Offline / Send Message
    yes i tried it but it didn't work. i made a modify health and added a delay at the end and repeat the action but the take damage animation is still here.
  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 19
    That's really lame. Did you try this with different kinds of damageclasses? Maybe there's one that does it..or you could try and set the damage type to HEAL, actually, and just have it heal a negative amount. It's a little hacky, but no more than what's already going on, and it might work?
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    Offhand, I might suggest a custom variable that tracks health (reduce it as per what you're already doing, but don't touch the player's actual health). Then once that custom var hits zero, you kill the player (set actual health to zero).
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    you would prolly have to figure out which method in the pawn class is doing that and override that method.
  • JZChughtai
    Options
    Offline / Send Message
    a guy from the UDK forum suggested me this code into the UTPawn class.



    simulated event TakeDamage(int Damage, Controller EventInstigator, Vector HitLocation, Vector Momentum,
    class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
    {}



    it bypass the animation but now, the pawn can't be killed...
    is there any command with the console bar to kill the player ? i could maybe tell udk to kill the pawn after the health is reach to 0?
  • osman
    Options
    Offline / Send Message
    osman polycounter lvl 18
    How does your animtree look like? Could you post a screenshot please?
  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 19
    inbetween the two brackets there, try adding this line:
    //////////
    health=Max(health-damage, 0);
    ///


    If it doesn't auto kill you at zero (it might not...i dont know what calls deaths), you can then try adding something like this right after:

    ////
    If(Health<=0)
    {
    if (!IsInState('Dying'))
    {
    GotoState('Dying');
    }
    }
    ///////

    Dunno if that's the proper method to force a death either... But give it a go and see?

    And keep in mind that its generally a BIG NO-NO to edit any base UnrealClass like this...the proper way is to subclass UTpawn, but that involves a bit more setup than you probably want to go through. (google "getting started with unrealscript" if you are interested though).
  • JZChughtai
    Options
    Offline / Send Message
    nysl5c.png



    and here is my code UTPawn Code:
    class RunningDeadPawn extends UTPawn
    placeable;

    var float CamOffsetY;
    var float CamOffsetZ;
    var(Pawn) const float JumpHeight;

    simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc,
    out rotator out_CamRot, out float out_FOV )

    {
    out_CamLoc = Location;
    out_CamLoc.Y += CamOffsetY;
    out_CamLoc.Z += CamOffsetZ;

    out_CamRot.Pitch = 0;
    out_CamRot.Yaw = -16384;
    out_CamRot.Roll = 0;

    return true;
    }


    function bool DoJump(bool bUpdating)
    {
    if (bJumpCapable && !bIsCrouched && !bWantsToCrouch && (Physics == PHYS_Walking || Physics == PHYS_Ladder || Physics == PHYS_Spider))
    {
    if (Physics == PHYS_Spider)
    {
    Velocity = JumpHeight * Floor;
    }
    else if (Physics == PHYS_Ladder)
    {
    Velocity.Z = 0.f;
    }
    else
    {
    Velocity.Z = JumpHeight;
    }

    if (Base != None && !Base.bWorldGeometry && Base.Velocity.Z > 0.f)
    {
    Velocity.Z += Base.Velocity.Z;
    }

    SetPhysics(PHYS_Falling);
    return true;
    }

    return false;
    }

    DefaultProperties // always goes at the very end of a class
    {

    Begin Object class=SkeletalMeshComponent Name=SkeletalMeshComponent0
    SkeletalMesh=SkeletalMesh'Jones.Mesh.JonesTPose'
    bAcceptsLights=true

    AnimSets(0)=AnimSet'Jones.Mesh.JonesAnimSet'
    AnimTreeTemplate=AnimTree'Jones.Mesh.JonesAnimTree'

    End Object
    Mesh=SkeletalMeshComponent0
    Components.Add(SkeletalMeshComponent0)

    CamOffsetY = 400
    CamOffsetZ = 100

    JumpHeight=450.f

    }

    i may have done something incorrect, but as i saied earlier, i am not a programmer, i actually copy and pasted code from around the internet
  • osman
    Options
    Offline / Send Message
    osman polycounter lvl 18
    Is it really playing a hurt animation or is it just stopping you for a second( which makes you blend the animation to the 'exhausted' one). Perhaps you can try and disable the 'Velocity affects Walking'. Perhaps that will prevent your pawn from stopping every 1 second.
  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 19
    AHH good, you're overriding pawn. But you're not overriding the takedamage function anywhere inside there. You'll need to insert the code from above into there (above the defaultproperties).

    And then, you have to make sure you actually are USING that pawn.
    If you insert this line into the end of takedamage function, then the game should 'ding' and spit this line into the console for you.:

    WorldInfo.Game.Broadcast(self,"I am using the running pawn and this is my remaining health:"@Health;
  • JZChughtai
    Options
    Offline / Send Message
    omg tanx guys!! it's working now :)!!!!!
Sign In or Register to comment.