Jump to content

Prevent the player from running


lofgren

Recommended Posts

I've been trying to search Google for this, but the results are too cluttered with other definitions of "run" and with players trying to solve bugs.

 

Has anybody found a nice clean method for preventing the player from running? Specifically I want them to be unable to run when under the effects of a particular spell. So far the only method I have found is encumbering them, which also slows their walking speed. Any help would be appreciated.

 

Thanks.

Link to comment
Share on other sites

You could do what my Controller Walk Run Toggle mod does. Change the player's speed multiplier value. When done as a magic effect, it might show up in the magic window under status effects (not sure - would need to be tested).

 

25 to 35 is a good range for walking when adjusting the speedmult value. But given that other mods could change the value, it might be best to get the starting value and subtract the target value and then Mod the remainder away while storing it to add back when the effect ends.

Link to comment
Share on other sites

As the speed rate is reduced the animation matches the rate of movement. Eventually, "run" (i.e. full press of the controller stick) visually becomes "walk". The only real concern with this approach is sprint. The sprint animation does not get affected but the speed rate for sprint does. So... the player could try to sprint and end up with a fast sprint animation while moving a disproportionate amount of distance (i.e. almost running in place). The only way to prevent sprint is to use the encumbered approach.

 

If by run you meant sprint, changing the carry weight and / or inventory weight is the only viable approach.

If by run you meant default full forward speed, changing the speed multiplier may be a viable approach depending upon usage.

Link to comment
Share on other sites

Afaik player is able to run until his stamina is gone. By using this approach you could attach a script to your spell effect and use next script. Maybe it works for you.

 

lofgPlayerNotRunningEffectScript

  Reveal hidden contents

 

Edited by ReDragon2013
Link to comment
Share on other sites

@lofgren

Use IsSprinting() in place of IsRunning() in ReDragon2013's code and you'll be set for trying to prevent the player from sprinting. IsRunning() does not return whether the player is sprinting or not and it is sprinting that is governed by stamina. Running as far at the game is concerned is the normal forward movement.

 

Probably best to get a definition of what you mean by "run" as I fear there has been some confusion.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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