limitSpeed: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Add Problem note (helicopters fly backward))
(Add backward speed bug game introduction)
Line 22: Line 22:
|descr= Limit the speed of an AI-driven vehicle or AI person to given value. It has continuous effect and AI will not break through the speed limitation until one is contacted, engaged or regrouped.
|descr= Limit the speed of an AI-driven vehicle or AI person to given value. It has continuous effect and AI will not break through the speed limitation until one is contacted, engaged or regrouped.


|pr= As of {{GVI|arma3|2.14|size= 0.75}} using any negative value on a helicopter will not reset the speed limit, but will force it to fly in reverse.
|pr= Since {{GVI|tkoh|1.00|size= 0.75}} and as of {{GVI|arma3|2.14|size= 0.75}}, using any negative value on a helicopter will not reset the speed limit, but will force it to fly in reverse.


|s1= objectName [[limitSpeed]] speed
|s1= objectName [[limitSpeed]] speed

Revision as of 02:16, 2 March 2024

Hover & click on the images for description

Description

Description:
Limit the speed of an AI-driven vehicle or AI person to given value. It has continuous effect and AI will not break through the speed limitation until one is contacted, engaged or regrouped.
Problems:
Since tkoh logo small.png1.00 and as of Arma 3 logo black.png2.14, using any negative value on a helicopter will not reset the speed limit, but will force it to fly in reverse.
Groups:
Unit ControlObject Manipulation

Syntax

Syntax:
objectName limitSpeed speed
Parameters:
objectName: Object
speed: Number - in km/h; set to -1 (or any <= 0 value) to remove the limit
Return Value:
Nothing

Examples

Example 1:
leader player limitSpeed 5; // set to walking speed sleep 30; leader player limitSpeed -1; // remove the limit
Example 2:
addMissionEventHandler ["OnEachFrame", { hintSilent format ["myVehicle's speed: %1 km/h", speed myVehicle toFixed 2] }]; sleep 5; myVehicle limitSpeed 5;
Example 3:
// it was necessary to use limitSpeed repeatedly before Arma 3 1.24 _this setVariable ["speedLimit", 50]; _this spawn { while { sleep 0.1; canMove _this } do { _this limitSpeed (_this getVariable "speedLimit"); }; }; sleep 10; _this setVariable ["speedLimit", 100]; // update the speed limit

Additional Information

See also:
speed setCruiseControl

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