Change Character Speed

  • #1, by percivalWednesday, 15. May 2019, 19:44 5 years ago
    Hi everyone! I'm new to the platform since january. I must say all the solutions I've found in the forum were good enough to keep learning without asking. So a general thanks to all the comunity who shares their problems and solutions here for others to browse.

    I'm having two particular problems and can´t get what could be wrong with my configuration.

    1-My character's base speed is 350. The thing is that in a particular time of a cutscene i need him to go really fast (falling). If i try to increase the speed with the standard configuration and the built-in command to set speed i can only reach to 1000.

    2-If i choose not to use "sliding walk animation" and to set each frame movement, when i try to set speed to 1000 and then back to 350, the movement increases ok, but after that it does not decreases. So, after doing so, my character gets crazy speed all the time.

    I would rather fix the second problem, because setting each frame movement makes a much better movement animation. Perhaps someone has been with this problem too and can help me see the mistake.

    Thanks

    PS: as you noticed, english is not my native language, sorry if i made your eyes  bleed.

    Newbie

    4 Posts


  • #2, by afrlmeWednesday, 15. May 2019, 21:03 5 years ago
    If you use the non-sliding walk system, then controlling the speed is done by controlling the global delay/pause between the animation frames, rather than via the walk speed.

    In a game I'm working on I use double click to tell the character to walk fast until the character stops then it resets back to the default speed value.

    Here's the Lua code snippet that I use to tell the playable character to walk fast...

    if game.CurrentCharacter.Scene == game.CurrentScene then
    
     for i = 1, #game.CurrentCharacter.Outfits["default"].WalkAnimations do
    
      game.CurrentCharacter.Outfits["default"].WalkAnimations[i].Pause = 20
    
     end
    
    end

    So what I am telling the game to do is to iterate through all of the walk animations for the current outfit of the active character & set the global delay/pause amount between each frame to 20ms (20ms is about as low as you can go in VS), but the delay value will probably be different for you as my default value is 40ms.

    Anyway, you can use that same code snippet & just change the 20 or whatever value you used back to the default value you specified in the editor once you want to change back to the regular walk speed.

    Good luck. wink

    Imperator

    7278 Posts

  • #3, by percivalWednesday, 15. May 2019, 22:02 5 years ago
    Thanks a lot AFRLme, that was really helpful. Also, not the first time i use your solutions.
    Good luck to you too.

    Newbie

    4 Posts