Thomas28915581

  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Thomas28915581

  • Rank
    Junior Member
...

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Enable
  1. I have a character for dst. And I wanted the character to have a different animation of the start of the run, the run and the stop of the run. I found an article with the code: AddStategraphPostInit("wilson", function(sg) local _run_onenter = sg.states.run.onenter local function GetRunStateAnim(inst) return (inst.sg.statemem.heavy and "heavy_walk") or (inst.sg.statemem.sandstorm and "sand_walk") or (inst.sg.statemem.groggy and "idle_walk") or (inst.sg.statemem.careful and "careful_walk") or "run" end sg.states.run.onenter = function(inst) _run_onenter(inst) if inst.prefab == "NamePrefab" and inst.AnimState:IsCurrentAnimation(GetRunStateAnim(inst).."_pre") then inst.AnimState:PlayAnimation("walk_pre") elseif inst.prefab == "NamePrefab" and inst.AnimState:IsCurrentAnimation("run") or inst.AnimState:IsCurrentAnimation("run_loop") then inst.AnimState:PlayAnimation("walk_loop") elseif inst.prefab == "NamePrefab" and inst.AnimState:IsCurrentAnimation(GetRunStateAnim(inst).."_pst") then inst.AnimState:PlayAnimation("walk_pst") end end end) This code works. But this code in modmain changes the walk animation for all characters. And yet he does not change the animation of the beginning of walking or running and the end of walking or running. I thought that inst.prefab == "NamePrefab", if I specify the prefab of my character, then the running animation will be applied only to my character, but it turns out to be wrong. I tried copying SGwilson to my mod’s folder, replacing the wilson with my character (I did the same with SGwilson_client) and added inst: SetStateGraph ("SGNamePrefab_client") inst: SetStateGraph ("SGNamePrefab"). It helped, but only for a world without caves. And in the world with caves, nothing works. The fact is that I do not understand stategraphs. I read articles on creating and downloaded mods to create my own animation. But neither of which worked for me. I just want my character to have its own animation of walking and running (start_run and stop_run and run), and not everyone, without creating new stategraphs. Can you help me?