Difference between revisions of "IsRunning"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Fella
imported>QQuix
(Reformatted and clarified)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Returns 1 if the actor is currently running. If called on the player, this function returns 1 if 'always run' (not auto-run, which is the Q key) is toggled, regardless of whether the player is actually moving.
{{Function
| origin = CS1
| summary = Returns 1 if the actor is currently running.
| name = IsRunning
| returnVal = IsRunning
| returnType = bool
| referenceType = reference
| arguments =
}}


If called on the player, this function returns 0 or 1 based on the state of the 'run' and the 'always run' keys (not auto-run, which is the Q key), regardless of whether the player is actually moving. Use [[IsMovingForward]], [[IsMovingBackward]], [[IsMovingLeft]] and [[IsMovingRight]] to determine if the player is actually moving.
Returns vs. key combinations:
*Returns 0 if 'always run' is not toggled and 'Run' is not pressed
*Returns 1 if 'always run' is not toggled and 'Run' is pressed
*Returns 1 if 'always run' is toggled and 'Run is not pressed
*Returns 0 if 'always run' is toggled and 'Run is pressed
====Note====
There is an obscure bug when an NPC is disabled and enabled in the same frame. This is sometimes done by companion mods. The frame after this happens The NPC will be "frozen" and using IsRunning on the NPC will CTD. Workaround: place your IsRunning check under OBSE ismoving checks(forward, backward, left and right).


==See Also==
==See Also==
* [[SetForceRun]]
* [[SetForceRun]]
* [[GetForceRun]]
* [[GetForceRun]]
 
* [[IsMovingForward]]
* [[IsMovingBackward]]
* [[IsMovingLeft]]
* [[IsMovingRight]]


[[Category: Functions]]
[[Category: Functions]]
Line 14: Line 35:
[[Category: Actor State Functions]]
[[Category: Actor State Functions]]
[[Category: Condition Functions]]
[[Category: Condition Functions]]
<!-- Begin Search Terms
Is
Running
End Search Terms -->

Latest revision as of 07:17, 30 November 2014

< [[::Category:Functions|Category:Functions]]

A function included in the TES CS v1.0.

Syntax:

(IsRunning:bool) reference.IsRunning

Returns 1 if the actor is currently running.


If called on the player, this function returns 0 or 1 based on the state of the 'run' and the 'always run' keys (not auto-run, which is the Q key), regardless of whether the player is actually moving. Use IsMovingForward, IsMovingBackward, IsMovingLeft and IsMovingRight to determine if the player is actually moving.

Returns vs. key combinations:

  • Returns 0 if 'always run' is not toggled and 'Run' is not pressed
  • Returns 1 if 'always run' is not toggled and 'Run' is pressed
  • Returns 1 if 'always run' is toggled and 'Run is not pressed
  • Returns 0 if 'always run' is toggled and 'Run is pressed

Note

There is an obscure bug when an NPC is disabled and enabled in the same frame. This is sometimes done by companion mods. The frame after this happens The NPC will be "frozen" and using IsRunning on the NPC will CTD. Workaround: place your IsRunning check under OBSE ismoving checks(forward, backward, left and right).

See Also