limitSpeed: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma1 | | arma1 | ||
|1.00 | |1.00 | ||
|gr1= Unit Control | |gr1= Unit Control | ||
|gr2= Object Manipulation | |gr2= Object Manipulation | ||
| Limit speed of given vehicle or person to given value (in km/h). | | Limit speed of given vehicle or person to given value (in km/h). | ||
| objectName '''limitSpeed''' speed | | objectName '''limitSpeed''' speed | ||
|p1= objectName: [[Object]] | |p1= objectName: [[Object]] | ||
|p2= speed: [[Number]] | |p2= speed: [[Number]] | ||
| [[Nothing]] | | [[Nothing]] | ||
|x1= <code>// Adjust "speedLimit" variable to change limited speed. (A3 1.24 we don't need loop for a continus effect, [[limitSpeed]] alone is enough.) | |x1= <code>// Adjust "speedLimit" variable to change limited speed. (A3 1.24 we don't need loop for a continus effect, [[limitSpeed]] alone is enough.) | ||
Line 26: | Line 26: | ||
[[sleep]] 0.1; | [[sleep]] 0.1; | ||
}; | }; | ||
};</code> | };</code> | ||
|x2 = <code>["SpeedObserver","onEachFrame",{[[hintSilent]] [[format]] ["%1",[[speed]] [[vehicle]] MyVehicle]},[]] [[call]] [[BIS_fnc_addStackedEventHandler]]; | |x2 = <code>["SpeedObserver","onEachFrame",{[[hintSilent]] [[format]] ["%1",[[speed]] [[vehicle]] MyVehicle]},[]] [[call]] [[BIS_fnc_addStackedEventHandler]]; | ||
Line 33: | Line 33: | ||
</code> | = Example 2 | </code> | = Example 2 | ||
| [[speed]] | | [[speed]] | ||
}} | }} |
Revision as of 01:04, 18 January 2021
Description
- Description:
- Limit speed of given vehicle or person to given value (in km/h).
- Groups:
- Unit ControlObject Manipulation
Syntax
- Syntax:
- objectName limitSpeed speed
- Parameters:
- objectName: Object
- speed: Number
- Return Value:
- Nothing
Examples
- Example 1:
// Adjust "speedLimit" variable to change limited speed. (A3 1.24 we don't need loop for a continus effect, limitSpeed alone is enough.) _this setVariable ["speedLimit", 200]; _nul = _this spawn { while {canMove _this} do { _this limitSpeed (_this getVariable "speedLimit"); sleep 0.1; }; };
- Example 2:
["SpeedObserver","onEachFrame",{hintSilent format ["%1",speed vehicle MyVehicle]},[]] call BIS_fnc_addStackedEventHandler; sleep 10; MyVehicle limitSpeed 5; //Watch the effect of this command.
Additional Information
- See also:
- speed
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
Notes
- Posted on 9 February 2008
- Kronzky
- (A1 1.08.5163)Has only an temporary effect on the vehicle specified (i.e. vehicle goes back to its previous speed right away). So, in order for this command to have a real, noticeable effect, it would have to be issued continuously (e.g. via a script loop, but in A3 1.24 it is unnecessary).
- Posted on 29 July 2014
- ffur2007slx2_5
- (A3 1.24)To clarify, limitSpeed only do effect on non-player controlled AI units, it has continuous effect and AI won’t break through the speed limitation until one is contacted, engaged or regrouped.