awake: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Reverted edits by R3vo (talk) to last revision by Lou Montana)
Tag: Rollback
 
(6 intermediate revisions by 3 users not shown)
Line 10: Line 10:
|gr1= Object Manipulation
|gr1= Object Manipulation


|descr= Wakes up sleeping PhysX object or puts a PhysX object to sleep. In 2.10 this command can be used on corpses of type {{hl|Man}} and has no effect on [[alive]] units. When unit gets killed it goes into ragdoll state for a short while, then the units get frozen and any simulation and collision is removed to save system resources. As a result, corpses do not react to their surrounding any more. Using this command will temporarily re-enable ragdoll state of a corpse to the same state it was when died. If this commands used in "enable/disable" sequence on a dead body, it gives the corpse a visible nudge. For example to make corpses react to an explosion:
|descr= Wakes up sleeping PhysX object or puts a PhysX object to sleep. In 2.10 this command can be used on corpses of type {{hl|Man}} and has no effect on [[alive]] units. When unit gets killed it goes into ragdoll state for a short while, then the units get frozen and any simulation and collision is removed to save system resources. As a result, corpses do not react to their surrounding any more. Using this command will temporarily re-enable ragdoll state of a corpse to the same state it was when unit died. If this command is used in "enable/disable" sequence on a dead body, it gives the corpse a visible nudge (See example 3).


{{Feature|informative|This command won't have lasting effect on vehicles as vehicles are actively simulated, but it works rather well on smaller PhysX enabled objects.}}
{{Feature|informative|This command won't have lasting effect on vehicles as vehicles are actively simulated, but it works rather well on smaller PhysX enabled objects.}}
Line 16: Line 16:
|s1= object [[awake]] awake
|s1= object [[awake]] awake


|p1= object: [[Object]] - PhysX object
|p1= object: [[Object]] - PhysX object or dead unit


|p2= awake: [[Boolean]] - [[true]] to awake the object, [[false]] - to put it to sleep
|p2= awake: [[Boolean]] - [[true]] to awake the object, [[false]] - to put it to sleep
Line 24: Line 24:
|x1= <sqf>_object awake false;</sqf>
|x1= <sqf>_object awake false;</sqf>
|x2= Since 2.10: <sqf>_deadUnit awake true;</sqf>
|x2= Since 2.10: <sqf>_deadUnit awake true;</sqf>
|x3= Make corpse react to explosion (since 2.10): <sqf>_deadUnit addEventHandler ["Explosion",  
|x3= Make corpse react to explosion (since 2.10): <sqf>
_deadUnit addEventHandler ["Explosion",  
{
{
params ["_unit", "_damage"];
params ["_unit", "_damage"];
Line 30: Line 31:
_unit awake true;
_unit awake true;
_unit awake false;
_unit awake false;
}];</sqf>
}];
</sqf>


|seealso= [[isAwake]] [[addTorque]] [[addForce]] [[vectorModelToWorld]] [[vectorModelToWorldVisual]] [[selectionPosition]]
|seealso= [[isAwake]] [[addTorque]] [[addForce]] [[vectorModelToWorld]] [[vectorModelToWorldVisual]] [[selectionPosition]]
}}
}}

Latest revision as of 17:19, 10 October 2024

Hover & click on the images for description

Description

Description:
Wakes up sleeping PhysX object or puts a PhysX object to sleep. In 2.10 this command can be used on corpses of type Man and has no effect on alive units. When unit gets killed it goes into ragdoll state for a short while, then the units get frozen and any simulation and collision is removed to save system resources. As a result, corpses do not react to their surrounding any more. Using this command will temporarily re-enable ragdoll state of a corpse to the same state it was when unit died. If this command is used in "enable/disable" sequence on a dead body, it gives the corpse a visible nudge (See example 3).
This command won't have lasting effect on vehicles as vehicles are actively simulated, but it works rather well on smaller PhysX enabled objects.
Groups:
Object Manipulation

Syntax

Syntax:
object awake awake
Parameters:
object: Object - PhysX object or dead unit
awake: Boolean - true to awake the object, false - to put it to sleep
Return Value:
Nothing

Examples

Example 1:
_object awake false;
Example 2:
Since 2.10:
_deadUnit awake true;
Example 3:
Make corpse react to explosion (since 2.10):
_deadUnit addEventHandler ["Explosion", { params ["_unit", "_damage"]; if (_damage < 0.01) exitWith {}; _unit awake true; _unit awake false; }];

Additional Information

See also:
isAwake addTorque addForce vectorModelToWorld vectorModelToWorldVisual selectionPosition

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