HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: How to change max walk/run speed of a charater throw code?  (Read 905 times)

__BVS__

  • Developers
  • *
  • Posts: 15
    • View Profile

Hello!
I have such problem : in my game , i nead to change moving speed of a character if he is poisoned)
How can i do it? I don't see anything, that can help me in ACCControl class script... =(

Logged

WorldWideZ

  • World Owners
  • ****
  • Posts: 524
    • View Profile
    • World Wide Zed
Re: How to change max walk/run speed of a charater throw code?
« Reply #1 on: Apr 23, 14, 11:16:17 AM »

the walk speed could be controlled by creating and new animation ASQ called poisoned walk , and pasting in the content of the walk ASQ and changing the initial speed to less than 1

then you just need to call the new animation , through a combination of changing the ACCC and the AAS file.

There might be other ways of doing it but i think this is the best way. check out the stuff on creating the walk/run asq on the wiki for some more detailed examples of how this stuff works
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: How to change max walk/run speed of a charater throw code?
« Reply #2 on: Apr 23, 14, 11:32:52 AM »

__BVS__,

If you look at the E_ character controller on the client side, there are sections that would deal with if the character was "sprinting", typically activated by holding shift when moving.

If you look at how the speed is modified when "sprinting", you could use that as a basis for how to change the speed when poisoned.  Then you just need to indicate to that controller when a character is poisoned so the controller can modify speed accordingly.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Thazager

  • General Accounts
  • *
  • Posts: 1155
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: How to change max walk/run speed of a charater throw code?
« Reply #3 on: Apr 23, 14, 11:57:06 AM »

Yes, its on client side and an animation can be made to show the new slower movement speed.

In the script ACCController, look for method  _HE_ACCC_ResolveNavigation, and in that section look for Skippy. This is where the HE (hero engine) dev made a way to increase speed for the character. The same can be done for decreasing the speed. There is also a short tutorial that shows how a slider can change this speed here. This is where you can set in values rather than use the slider, and how to add in a function in main line code for setting your own values.

The HeroEngineACCC_CustomMoveRate field can be set with your speed value, but I actually had more then 1 change to make in the ground movement speed.
Logged