Jump to content

How to assign correct resurrection player animation to custom resurrection option


Recommended Posts

Hi there. One of the characters I have coded can attune deer to possess later as a resurrection option. Works great.

The problem I'm stumped on is how to switch out the player animations. Right now it plays the ghost received heart transformation. I'd prefer the dazed corpse revival that results from using a touchstone. Can anyone point me in the right direction? How do I re-assign the correct animation?

 

local function OnHaunt(inst, haunter)
    if inst._task == nil and
        haunter:HasTag("oracle") then
        SpawnPrefab( "shadow_despawn").Transform:SetPosition(inst:GetPosition():Get())    
        inst:Remove()
        return true
    end
end

 

 

    inst:AddComponent('hauntable')
    inst.components.hauntable:SetHauntValue(TUNING.HAUNT_INSTANT_REZ)
    inst.components.hauntable:SetOnHauntFn(OnHaunt)

Link to comment
Share on other sites

look inside the stategraph and or the code for the touchstone in the game files. I THINK it is 'revivalstone'  in the game files, I may be wrong, it has been a while since I looked in there. You will be looking for whats known as a 'symbol' for animation. the code usually dictates the start of an animation by using somewhere around the lines of :

inst.AnimState:PlayAnimation

good luck.

Link to comment
Share on other sites

Thanks! After some digging I found the relevant animation (wakeup) in player_actions. Here's what I tried, but there's no change.

local function OnHaunt(inst, haunter)
    if inst._task == nil and
        haunter:HasTag("oracle") then
        SpawnPrefab( "shadow_despawn").Transform:SetPosition(inst:GetPosition():Get())    
        haunter.AnimState:PlayAnimation("wakeup")
        inst:Remove()
        return true
    end
end

 

Log message:
[00:02:59]: Could not find anim [wakeup] in bank [ghost]

So, I guess the question is, how can I force it to skip the transformation animation and switch from the ghost to player build straightaway? Here's what it looks like right now...

 

Link to comment
Share on other sites

the log error you are running into is because:

The animation does not exist in the animation bank for ghost, therefore you are essentially attempting to call an animation that does not exist, you are perhaps attempting to call the animation too early before you swap back to the animation bank/build for wilson/generic character.

ideally you need to prevent your code from calling before the banks swap that way you get your anim AFTER ghost has swapped.

 

check around the way death works, look around the area and how a ghost is spawned/switched to. if the build cannot do your custom anim, your character will go invisible and freeze.

Edited by Renamon
Link to comment
Share on other sites

Yes, I understand that, but I don't want the revived ghost animation to play at all. Instead I want the build to switch immediately upon haunting the deer, and then for the character build play the "wakeup" animation - like they do when haunting a touchstone. There's the haunt, a lightning strike, and then the player character stands up with the "wakeup" animation.

These are the animations that play through when a ghost is revived:

inst.AnimState:PlayAnimation("shudder")
inst.AnimState:PushAnimation("brace", false)
inst.AnimState:PushAnimation("transform", false)

But I don't know how to tell it not to play these animations, and I'm failing to see what does so in resurrectionstone.lua

resurrectionstone.lua

possessed_deer.lua

ghost_transform_overlay_fx.lua

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...