typeOf: Difference between revisions

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


<h2 style="color:#000066">'''typeOf ''vehicle'''''</h2>
| ofpr |= Game name


|1.90|= Game version
____________________________________________________________________________________________


'''Operand types:'''
| Returns the config class name of given object or "" if object doesn't have config class. |DESCRIPTION=
____________________________________________________________________________________________


'''vehicle:''' [[Object]]
|'''typeOf''' object |SYNTAX=


'''Type of returned value:'''
|p1= object: [[Object]] |PARAMETER1=


[[String]]
| [[String]] |RETURNVALUE=
____________________________________________________________________________________________
 
|x1= <code>[[if]] ([[typeOf]] [[vehicle]] [[player]] == "B_Heli_Light_01_armed_F") [[then]] {[[hint]] "Player is in AH-9 Pawnee"};</code> |EXAMPLE1=
____________________________________________________________________________________________


'''Description:'''
| [[countType]], [[isKindOf]] |SEEALSO=


Returns the class type of a given object or vehicle.
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on August 4, 2006 - 12:03
<dt class="note">'''[[User:Hardrock|hardrock]]'''<dd class="note">(CWR 1.90)Try using this on an object pre-placed in the mission editor (such as a house): [[hint]] [[format]]["%1", [[typeOf]] [[object]] xxx] Now place an object in the editor, save the map, and open up the [[Mission.sqm]]. Find the line: vehicle = "XXX", and replace XXX with the name of the object that you found above. Save it, and load the map. (this method is no longer available since ArmA)
<!-- Note Section END -->
</dl>


'''Example:'''
<h3 style="display:none">Bottom Section</h3>


_class = '''typeOf''' _mi24


 
[[Category:Scripting Commands|TYPEOF]]
'''Comments'''
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands OFP 1.96|TYPEOF]]
Try using this on an object pre-placed in the mission editor (such as a house):
[[Category:Scripting Commands OFP 1.46|TYPEOF]]
 
[[Category:Scripting Commands ArmA|TYPEOF]]
[[hint]] [[format]]["%1", '''''typeof''''' [[object]] xxx]
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
Now place an object in the editor, save the map, and open up the [[mission.sqm]].
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
Find the line: '''vehicle="XXX"''', and replace '''XXX''' with the name of the object that you found above.
 
Save it, and load the map.

Revision as of 15:50, 7 April 2019

Hover & click on the images for description

Description

Description:
Returns the config class name of given object or "" if object doesn't have config class.
Groups:
Uncategorised

Syntax

Syntax:
typeOf object
Parameters:
object: Object
Return Value:
String

Examples

Example 1:
if (typeOf vehicle player == "B_Heli_Light_01_armed_F") then {hint "Player is in AH-9 Pawnee"};

Additional Information

See also:
countTypeisKindOf

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 August 4, 2006 - 12:03
hardrock
(CWR 1.90)Try using this on an object pre-placed in the mission editor (such as a house): hint format["%1", typeOf object xxx] Now place an object in the editor, save the map, and open up the Mission.sqm. Find the line: vehicle = "XXX", and replace XXX with the name of the object that you found above. Save it, and load the map. (this method is no longer available since ArmA)

Bottom Section