isAwake: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) No edit summary |
||
Line 8: | Line 8: | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
|descr= Returns resting state of a PhysX object. | |descr= Returns resting state of a PhysX object. Some EPE objects are deliberately put to sleep by the engine to save resources. This command returns [[true]] when object is simulating and [[false]] when it is put to sleep. With units of type {{hl|Man}} the behaviour is slightly different. As units never put to sleep, the command outputs ragdoll state of a unit instead. There are 6 states for the output of the command: | ||
* EPE object is simulaing - [[true]] | |||
* EPE object is put to sleep - [[false]] | |||
* Unit is [[alive]], ragdoll is active - [[false]] | |||
* Unit is [[alive]], ragdoll is NOT active - [[true]] | |||
* Unit is NOT [[alive]], ragdoll is active [[true]] | |||
* Unit is NOT [[alive]], ragdoll is NOT active [[false]] | |||
It may look counter-intuitive but there is a simple formula to return ragdoll state of a unit: | |||
<code>[[private]] _unitIsInRadgoll = [[alive]] _unit != [[isAwake]] _unit;</code> | |||
|s1= [[isAwake]] object | |s1= [[isAwake]] object | ||
Line 15: | Line 22: | ||
|p1= object: [[Object]] - PhysX object or unit | |p1= object: [[Object]] - PhysX object or unit | ||
|r1= [[Boolean]] | |r1= [[Boolean]] - see description | ||
|x1= <sqf>private _isAwake = isAwake _object;</sqf> | |x1= <sqf>private _isAwake = isAwake _object;</sqf> |
Revision as of 11:05, 13 May 2022
Description
- Description:
- Returns resting state of a PhysX object. Some EPE objects are deliberately put to sleep by the engine to save resources. This command returns true when object is simulating and false when it is put to sleep. With units of type Man the behaviour is slightly different. As units never put to sleep, the command outputs ragdoll state of a unit instead. There are 6 states for the output of the command:
- EPE object is simulaing - true
- EPE object is put to sleep - false
- Unit is alive, ragdoll is active - false
- Unit is alive, ragdoll is NOT active - true
- Unit is NOT alive, ragdoll is active true
- Unit is NOT alive, ragdoll is NOT active false
private _unitIsInRadgoll = alive _unit != isAwake _unit;
- Groups:
- Object Manipulation
Syntax
- Syntax:
- isAwake object
- Parameters:
- object: Object - PhysX object or unit
- Return Value:
- Boolean - see description
Examples
- Example 1:
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note