speed: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
 
m (template:command argument fix)
(22 intermediate revisions by 10 users not shown)
Line 1: Line 1:
back to [[Scripting_Reference#U|COMREF]]
{{Command|= Comments
____________________________________________________________________________________________


<h2 style="color:#000066">'''speed'''''obj</h2>
| ofp |= Game name


'''Operand types:'''
|1.00|= Game version
____________________________________________________________________________________________


obj: [[Object]]
| Object speed (in km/h). Returns relative speed of given object along Y axis. An equivalent to:<br><br><tt>3.6 * ([[velocityModelSpace]] _obj [[select]] 1)</tt> |DESCRIPTION=
____________________________________________________________________________________________


'''Type of returned value:'''
| '''speed''' object |SYNTAX=


[[Number]]
|p1= object: [[Object]] |PARAMETER1=


'''Description:'''
| [[Number]] |RETURNVALUE=
____________________________________________________________________________________________
 
|x1= <code>[[if]] ([[speed]] _truck1 >= 100) [[then]] {[[hint]] "You're going too fast!"};</code> |EXAMPLE1=
____________________________________________________________________________________________


Object speed (in km/h).
| [[velocity]], [[setVelocity]], [[velocityModelSpace]], [[setVelocityModelSpace]], [[setVelocityTransformation]], [[limitSpeed]] |SEEALSO=


'''Example:'''
}}


? ('''speed''' truck1) >= 100 : hint "You're going too fast!"
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
 
<!-- Note Section END -->
</dl>
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|SPEED]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|SPEED]]
[[Category:Scripting Commands OFP 1.46|SPEED]]
[[Category:Scripting Commands ArmA|SPEED]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Revision as of 15:49, 7 April 2019

Hover & click on the images for description

Description

Description:
Object speed (in km/h). Returns relative speed of given object along Y axis. An equivalent to:

3.6 * (velocityModelSpace _obj select 1)
Groups:
Uncategorised

Syntax

Syntax:
speed object
Parameters:
object: Object
Return Value:
Number

Examples

Example 1:
if (speed _truck1 >= 100) then {hint "You're going too fast!"};

Additional Information

See also:
velocitysetVelocityvelocityModelSpacesetVelocityModelSpacesetVelocityTransformationlimitSpeed

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

Bottom Section