typeOf: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|seealso= *\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 $2")
m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>")
Line 32: Line 32:
|r1= [[String]] - Config class or {{ic|""}}
|r1= [[String]] - Config class or {{ic|""}}


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


|seealso= [[countType]] [[isKindOf]] [[configOf]]
|seealso= [[countType]] [[isKindOf]] [[configOf]]
Line 43: Line 43:
<dt class="note">[[User:Hardrock|hardrock]]</dt>
<dt class="note">[[User:Hardrock|hardrock]]</dt>
<dd class="note">{{GVI|ofp|1.90}} Try using this on an object pre-placed in the mission editor such as a house:
<dd class="note">{{GVI|ofp|1.90}} Try using this on an object pre-placed in the mission editor such as a house:
<code>[[hint]] [[format]] ["%1", [[typeOf]] [[object]]]; {{cc|Shows the class name (XXX)}}</code>
<code>hint [[format]] ["%1", [[typeOf]] [[object]]]; {{cc|Shows the class name (XXX)}}</code>
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 {{arma1}}.
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 {{arma1}}.
</dl>
</dl>

Revision as of 11:18, 12 May 2022

Hover & click on the images for description

Description

Description:
Returns the config class name of given object or "" if object does not have a config class.
Groups:
Object Manipulation

Syntax

Syntax:
typeOf object
Parameters:
object: Object
Return Value:
String - Config class or ""

Examples

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

Additional Information

See also:
countType isKindOf configOf

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
Posted on August 4, 2006 - 12:03
hardrock
Logo A0.png1.90 Try using this on an object pre-placed in the mission editor such as a house: hint format ["%1", typeOf object]; // Shows the class name (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 Armed Assault.