{"name":"setDynamicSimulationDistance","operator":null,"title":"setDynamicSimulationDistance","type":"command","url":"https://community.bistudio.com/wiki/setDynamicSimulationDistance","revid":363576,"updated":"2024-04-07T11:30:33Z","groups":["Dynamic Simulation"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.68"}],"since":{"game":"arma3","name":"Arma 3","version":"1.68"},"arma3_since":"1.68","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Sets activation distance of Arma 3: Dynamic Simulation for given category.","syntaxes":[{"syntax":"category setDynamicSimulationDistance distance","since":null,"effect":null,"exec":null,"params":[{"name":"category","type":"String","optional":false,"default":null,"description":"can be one of:\n- `\"Group\"` - infantry units. Set to a reasonable distance, player should not see disabled infantry units. Default value 500m\n- `\"Vehicle\"` - vehicles with crew. Set to a reasonable distance, player should not see disabled vehicles. Default value 350m\n- `\"EmptyVehicle\"` - all vehicles without crew. Separated from Props as Empty Vehicles have often more complex damage states and selective destruction. Their activation distance should be larger than the one used for Props. Default value 250m\n- `\"Prop\"` - static objects. Anything from a small tin can to a building. Default value 50m","types":["String"],"since":null,"text":"category: String - can be one of:\n- `\"Group\"` - infantry units. Set to a reasonable distance, player should not see disabled infantry units. Default value 500m\n- `\"Vehicle\"` - vehicles with crew. Set to a reasonable distance, player should not see disabled vehicles. Default value 350m\n- `\"EmptyVehicle\"` - all vehicles without crew. Separated from Props as Empty Vehicles have often more complex damage states and selective destruction. Their activation distance should be larger than the one used for Props. Default value 250m\n- `\"Prop\"` - static objects. Anything from a small tin can to a building. Default value 50m"},{"name":"distance","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"distance: Number"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"category","types":["String"]},"right":{"text":"distance","types":["Number"]}}],"examples":[{"text":"```sqf\n\"Group\" setDynamicSimulationDistance 1000;\n```","code":["\"Group\" setDynamicSimulationDistance 1000;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Arma 3: Dynamic Simulation","dynamicSimulationDistance","setDynamicSimulationDistanceCoef","dynamicSimulationDistanceCoef"],"notes":[{"user":"Demellion","date":"2017-03-19T19:52:00Z","text":"Desired distances for \"Group\" and \"Vehicle\" must be based on viewDistance and fog to exclude any rendering problems with frequently moving objects. Example:\n\n```sqf\n\"Group\" setDynamicSimulationDistance ((viewDistance * 0.8) - (viewDistance * fog)); // 80% of maximum rendering and fog distance\n```\n\nBut that might impair objects simulation if you are using long-scope optics, so there's an even better solution using cameraView with it:\n\n```sqf\n0 spawn {\n    while { true } do\n    {\n        if (cameraView isEqualTo \"GUNNER\") then\n        {\n            \"Group\" setDynamicSimulationDistance (viewDistance - (viewDistance * fog));\n            // Scoped\n        }\n        else\n        {\n            \"Group\" setDynamicSimulationDistance ((viewDistance * 0.8) - (viewDistance * fog));\n            // Not scoped\n        };\n\n        uiSleep 0.25;\n    };\n};\n```"}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Dynamic Simulation","Introduced with Arma 3 version 1.68","Scripting Commands"]}