Jump to content

[LE] How to toggle movement - walk/run?


staalo18

Recommended Posts

I am looking for a way to toggle an actor's movement from "Walk" to "Run" and back, either via an AI package, or by using a script function.

On script level I know there is a way to check for the movement state ("IsRunning()", "IsSprinting()", etc), but I found no way to set it for an actor.

What I am referring back to are the "Walk" and "Run" speeds defined in the "Movement Type" data of the actor's race. (The "Movement Type" data is used for the "Base Movement Defaults" in the "Move Data" section of the Race definitions).

What is causing the AI to switch between the "Walk" and "Run" values, and how can I trigger it directly?

Link to comment
Share on other sites

For NPCs their movement is handled via packages. Some packages such as Flee cause them to run. Other packages such as Travel have them walk. Follow will mimic the target's speed as much as possible (especially if the player). There are some flag overrides which could be used to modify the behavior. Preferred speed is one of them.

 

That said, it is possible to change their speed rate thus making their walk and run both faster or slower as desired. But this change will affect everything. Therefore, it is probably better to utilize an AI package and force an evaluation of the package stack as necessary with EvaluatePackage.

Link to comment
Share on other sites

Thanks for these hints. I tried using a package with Flag Override "Preferred Speed" to "Run". But unfortunately I see no measurable impact on the actor's speed (I'm sure the actor is using that package while I tested it).

 

Concretely, I try to make a dragon actor fly faster under certain conditions. I know there is a possibility, because I see dragons fly faster when they are in combat. And I would have hoped that your hint with the packages and flag overrides will be the solution. But at least so far, it's not showing the intended results.

 

I will experiment more, but would appreciate any further hints.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...