typeOf: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>") |
(Added display and control) |
||
| (9 intermediate revisions by 2 users not shown) | |||
| Line 24: | Line 24: | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
|descr= Returns the | |descr= Returns the class name of given target. | ||
|s1= [[typeOf]] | |s1= [[typeOf]] target | ||
|p1= | |p1= target: [[Object]], since {{GVI|arma3|2.22}} [[Control]], [[Display]] | ||
|r1= [[String]] - | |r1= [[String]] - config class name, or empty string if ''target'' does not have a class | ||
|x1= < | |x1= <sqf>if (typeOf vehicle player == "B_Heli_Light_01_armed_F") then { hint "Player is in a AH-9 Pawnee"; };</sqf> | ||
|seealso= [[countType]] [[isKindOf]] [[configOf]] | |x2= <sqf> | ||
// Since 2.22 | |||
typeOf (findDisplay 313); // "Display3DEN" | |||
</sqf> | |||
|seealso= [[countType]] [[isKindOf]] [[configOf]] [[ctrlClassName]] | |||
}} | }} | ||
{{Note | |||
|user= Hardrock | |||
|timestamp= 20060804120300 | |||
|text= Try using this on an object pre-placed in the mission editor such as a house: | |||
<sqf>hint typeOf _object; // Shows the class name (XXX)</sqf> | |||
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}}. | |game= ofp | ||
|version= 1.90 | |||
}} | |||
Latest revision as of 11:42, 21 March 2026
Description
- Description:
- Returns the class name of given target.
- Groups:
- Object Manipulation
Syntax
- Syntax:
- typeOf target
- Parameters:
- target: Object, since
2.22 Control, Display - Return Value:
- String - config class name, or empty string if target does not have a class
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- countType isKindOf configOf ctrlClassName
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note
- Posted on Aug 04, 2006 - 12:03 (UTC)
-
Try using this on an object pre-placed in the mission editor such as a house:
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.
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.90
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Object Manipulation