Arma 3 Scripting

Command in Object Manipulation

enableSimulation

Also available as Markdown and JSON, or read the original wiki page.

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.

Syntax

entity enableSimulation state

Parameters:

Returns: Nothing

Examples

Example 1

player enableSimulation false;

See also

enableSimulationGlobal · simulationEnabled · enableDynamicSimulationSystem · dynamicSimulationSystemEnabled · enableDynamicSimulation · dynamicSimulationEnabled · setDynamicSimulationDistance · dynamicSimulationDistance · setDynamicSimulationDistanceCoef · dynamicSimulationDistanceCoef · triggerDynamicSimulation · canTriggerDynamicSimulation

Community notes

Tyrspawn

Note

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 Arma 2 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.

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.

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!

Demellion

Since Arma 3 1.56 the object can also be returned with cursorObject even if the simulation is not enabled.