Jump to content

Recommended Posts

wolfgang has 3 and woodie has 2 so why cant i seem to get my custom character to have 2 ?

 

this is the code used but i have been adjusting it non stop and nothing seems to work . putting it in the mod main and tried the prefab adding more end's to it ect . all i am tryiung to do is swap the build from wodb to wodh so that when hit it uses wodh . if i can get that to work i think i can do the reverse and switch back when idle  

 

inst:ListenForEvent("attacked", function(inst)
                   if not inst.components.health:IsDead() then
                   inst.AnimState:SetBuild("wodh")
   end 
 
why bother with this when its only 1 state ? the blink animation and getting hit share a face and this would allow a more emotive expression for being hit that wouldnt force a crazy look for idle
 
also code in that string is from files in the game 
Link to comment
https://forums.kleientertainment.com/forums/topic/49234-multiple-anim-builds-help/
Share on other sites

the forum lacks a edit function so i will just double post

 

this also doesnt work . i will actually post the full piece . i have done a lot of variations on it adding stuff ect but it either crashes on load or loads and doesn't do anything . have also tried just the first part without the second if not bit still wont work

 
function WodbPostInit(wodb) 
               local is_idle = inst.sg:HasStateTag("idle")
                                   if is_idle then
                                   inst.AnimState:SetBuild("wodb")
end
                                   if not is_idle then
                                   inst.AnimState:SetBuild("wodh")
end
 
AddSimPostInit(function(inst)
        if inst.prefab == "wodb" then
               WodbPostInit(inst)
          end
       end)

again the forum has no edit function but i got it to work

 

i was trying to avoid a custom state graph  because it would be almost the same file but with a few extra lines of code . anyways adding 

 

            if inst.prefab == "wodb" then
            inst.AnimState:SetBuild("wodh")
end
 
above the one referencing if the character was not wes ( ~=wes) in the state hit switches when hit so you can make better more painful expressions . so putting one in the idle should switch it back to the normal build

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
×
  • Create New...