sumguy Posted January 16, 2015 Share Posted January 16, 2015 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 Share on other sites More sharing options...
sumguy Posted January 16, 2015 Author Share Posted January 16, 2015 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) Link to comment Share on other sites More sharing options...
sumguy Posted January 16, 2015 Author Share Posted January 16, 2015 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.