enableSimulation: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<dt class="note">([^<>]+) " to "<dt class="note">$1</dt> ")
m (Text replacement - "Killzone Kid" to "Killzone_Kid")
 
(37 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma2
|game1= arma2
|version1= 1.00


|1.00
|game2= arma2oa
|version2= 1.50
 
|game3= tkoh
|version3= 1.00
 
|game4= arma3
|version4= 0.50


|arg= global
|arg= global
Line 11: Line 19:
|gr1= Object Manipulation
|gr1= Object Manipulation


| Enables / disables simulation for the given entity. This command will affect entity simulation only [[local |locally]]. For a global and JIP enabled alternative see [[enableSimulationGlobal]]
|descr= Enables / disables simulation for the given entity, e.g its animation and physics; it will still be able to take damage and report enemies.
This command will affect entity simulation only [[local|locally]].
For a global and JIP enabled alternative, see [[enableSimulationGlobal]].


| entity '''enableSimulation''' state
|s1= entity [[enableSimulation]] state


|p1= entity: [[Object]]
|p1= entity: [[Object]]
Line 19: Line 29:
|p2= state: [[Boolean]]
|p2= state: [[Boolean]]


| [[Nothing]]
|r1= [[Nothing]]
 
|x1= <code>[[player]] [[enableSimulation]] [[false]];</code>


| [[enableSimulationGlobal]], [[simulationEnabled]], [[enableDynamicSimulationSystem]], [[dynamicSimulationSystemEnabled]], [[enableDynamicSimulation]], [[dynamicSimulationEnabled]], [[setDynamicSimulationDistance]], [[dynamicSimulationDistance]], [[setDynamicSimulationDistanceCoef]], [[dynamicSimulationDistanceCoef]], [[triggerDynamicSimulation]], [[canTriggerDynamicSimulation]]
|x1= <sqf>player enableSimulation false;</sqf>


|mp=This command only works locally and must be run on all machines to have global affect.
|seealso= [[enableSimulationGlobal]] [[simulationEnabled]] [[enableDynamicSimulationSystem]] [[dynamicSimulationSystemEnabled]] [[enableDynamicSimulation]] [[dynamicSimulationEnabled]] [[setDynamicSimulationDistance]] [[dynamicSimulationDistance]] [[setDynamicSimulationDistanceCoef]] [[dynamicSimulationDistanceCoef]] [[triggerDynamicSimulation]] [[canTriggerDynamicSimulation]]
}}
}}


<dl class='command_description'>
<dl class="command_description">
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on 15 July, 2009 - 00:16 (CEST)</dd>
<dt class="note">[[User:Lou Montana|Lou Montana]]</dt>
<dd class="note">
*enableSimulation will "freeze" the unit, including animations, eye blinking, etc ; you cannot switchMove or playMove.
*the unit can still take damages and report status and enemies by radio.
 


<dt><dt>
<dd class="notedate">Posted on 19 July, 2011</dd>
<dd class="notedate">Posted on 19 July, 2011</dd>
<dt class="note">[[User:Krause|Krause]]</dt>
<dt class="note">[[User:Krause|Krause]]</dt>
<dd class="note">
<dd class="note">
{{Feature | informative | The following only applies to {{arma2}} before a certain patch, in which such changes have been integrated in the game code.}}
Nou/Jaynus have discovered something quite important about the Arma2 engine:
Nou/Jaynus have discovered something quite important about the Arma2 engine:


Line 53: Line 56:


This also has importance in a technical sense: bandwith is the most significant factor in mission performance. The lower the server bandwith, the better the performance.  
This also has importance in a technical sense: bandwith is the most significant factor in mission performance. The lower the server bandwith, the better the performance.  
</dd>


 
<dt><dt>
<dd class="notedate">Posted on 9 Sept, 2011</dd>
<dd class="notedate">Posted on 9 Sept, 2011</dd>
<dt class="note">[[User:Rocket|Rocket]]</dt>
<dt class="note">[[User:Rocket|Rocket]]</dt>
<dd class="note">
<dd class="note">
Objects with disabled simulation are not calculated for lightsources beyond the global light (moon/sun), so any light sources you create will not light them.
Objects with disabled simulation are not calculated for lightsources beyond the global light (moon/sun), so any light sources you create will not light them.
<dd class="notedate">Posted on 12 Nov, 2011</dd>
<dt class="note">[[User:HomerJohnston|HomerJohnston]]</dt>
<dd class="note">
Contrary to Krause's suggestions above, using "this enableSimulation False" on '''static objects''' has '''no effect''' on a dedicated server's bandwidth usage or FPS (as per current 1.59 Release version).
<dd class="notedate">Posted on 8 May, 2012</dd>
<dt class="note">[[User:Krause|Krause]]</dt>
<dd class="note">
re: Homer.
Yep. That's because this functionality is now part of the basic arma netcode. Pretty nice :)
<!-- Note Section END -->
</dl>
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on October 3, 2014 - 21:45 (UTC)</dd>
<dt class="note">[[User:DreadedEntity|DreadedEntity]]</dt>
<dd class="note">
Units with disabled simulation will not be affected by gravity.
</dd>
</dd>


<dd class="notedate">Posted on October 21, 2014 - 15:33 (UTC)</dd>
<dt><dt>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="notedate">Posted on 2014-10-21 - 15:33 (UTC)</dd>
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
<dd class="note">
<dd class="note">
Units that have been previously subjected to [[enableSimulation]] false; or [[enableSimulationGlobal]] false; may stay unrecognised for a long time even after simulation was re-enabled, returning [[objNull]] as [[cursorTarget]]. Force revealing units with [[reveal]] command usually solves the problem. For example: <code>{[[player]] [[reveal]] _x} [[forEach]] [[allUnits]];</code>
Units that have been previously subjected to [[enableSimulation]] false; or [[enableSimulationGlobal]] false; may stay unrecognised for a long time even after simulation was re-enabled, returning [[objNull]] as [[cursorTarget]]. Force revealing units with [[reveal]] command usually solves the problem. For example:
<sqf>{player reveal _x} forEach allUnits;</sqf>
</dd>
</dd>


<dd class="notedate">Posted on May 23, 2015 - 16:28 (UTC)</dd>
<dt><dt>
<dd class="notedate">Posted on 2015-05-23 - 16:28 (UTC)</dd>
<dt class="note">[[User:Waffle SS.|Waffle SS.]]</dt>
<dt class="note">[[User:Waffle SS.|Waffle SS.]]</dt>
<dd class="note">
<dd class="note">
Line 103: Line 80:
</dd>
</dd>


<dd class="notedate">Posted on December 2, 2015 - 18:55 (UTC)</dd>
<dt><dt>
<dd class="notedate">Posted on 2015-12-02 - 18:55 (UTC)</dd>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dd class="note">
<dd class="note">
After using enableSimulation false or enableSimulationGlobal false on a vehicle (car, helo), don't forget to re-enable simulation on this vehicle before a player jumps into it. Otherwise, he will be stick in it, with a black screen and no way to escape!
After using enableSimulation false or enableSimulationGlobal false on a vehicle (car, helo), don't forget to re-enable simulation on this vehicle before a player jumps into it. Otherwise, he will be stuck in it, with a black screen and no way to escape!
</dd>
</dd>


<dd class="notedate">Posted on February 5, 2016 - 22:17 (UTC)</dd>
<dt><dt>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dd class="notedate">Posted on 2016-09-01 - 16:52 (UTC)</dd>
<dd class="note">
cursorTarget returns a <null_object> for objects with disabled simulation. But you can find them with other commands such nearEntities.
</dd>
 
<dd class="notedate">Posted on September 1, 2016 - 16:52 (UTC)</dd>
<dt class="note">[[User:Demellion|Demellion]]</dt>
<dt class="note">[[User:Demellion|Demellion]]</dt>
<dd class="note">
<dd class="note">
Since '''Arma 3 1.56''' the object can also be returned with [[cursorObject]] even if the simulation is not enabled
Since '''Arma 3 1.56''' the object can also be returned with [[cursorObject]] even if the simulation is not enabled
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 14:48, 12 March 2024

Hover & click on the images for description

Description

Description:
Enables / disables simulation for the given entity, e.g its animation and physics; it will still be able to take damage and report enemies. This command will affect entity simulation only locally. For a global and JIP enabled alternative, see enableSimulationGlobal.
Groups:
Object Manipulation

Syntax

Syntax:
entity enableSimulation state
Parameters:
entity: Object
state: Boolean
Return Value:
Nothing

Examples

Example 1:
player enableSimulation false;

Additional Information

See also:
enableSimulationGlobal simulationEnabled enableDynamicSimulationSystem dynamicSimulationSystemEnabled enableDynamicSimulation dynamicSimulationEnabled setDynamicSimulationDistance dynamicSimulationDistance setDynamicSimulationDistanceCoef dynamicSimulationDistanceCoef triggerDynamicSimulation canTriggerDynamicSimulation

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
Posted on 19 July, 2011
Krause
The following only applies to Arma 2 before a certain patch, in which such changes have been integrated in the game code.

Nou/Jaynus have discovered something quite important about the Arma2 engine:

Orient yourself to the enableSimulation command in ARMA 2:

If simulation is disabled on objects (this enablesimulation false), they do not send updates across the network, drastically reducing traffic across the network by an order of magnitude. What this means in practicality is that it is possible to have huge mission maker created cities with no or negligible impact on mission performance. Mission placed objects is the most common cause of performance woes - so this is huge news, and was previously undocumented, both on the BIS wiki and elsewhere.

There are some quirks.

While an object which has enableSimulation false set on it will take damage, it will not display any animations or damage states until enableSimulation is enabled back onto it. If you want to disable simulation on a unit and then show it as dieing once it is hit or damaged, add an eventhandler onto it which enables simulation on the object when it is hit or killed. Hit handler for best visual, killed handler for best performance.

This discovery will be the basis of a new unit caching script by Jaynus.

This also has importance in a technical sense: bandwith is the most significant factor in mission performance. The lower the server bandwith, the better the performance.

Posted on 9 Sept, 2011
Rocket
Objects with disabled simulation are not calculated for lightsources beyond the global light (moon/sun), so any light sources you create will not light them.
Posted on 2014-10-21 - 15:33 (UTC)
Killzone_Kid
Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example:
Posted on 2015-05-23 - 16:28 (UTC)
Waffle SS.
After using enableSimulation false or enableSimulationGlobal false on an object, setPos will still update its position across the network in MP.
Posted on 2015-12-02 - 18:55 (UTC)
Pierre MGI
After using enableSimulation false or enableSimulationGlobal false on a vehicle (car, helo), don't forget to re-enable simulation on this vehicle before a player jumps into it. Otherwise, he will be stuck in it, with a black screen and no way to escape!
Posted on 2016-09-01 - 16:52 (UTC)
Demellion
Since Arma 3 1.56 the object can also be returned with cursorObject even if the simulation is not enabled