typeOf: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<!-- Note Section [A-Z]+ --> " to "") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(17 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
|game1= ofp | |game1= ofp | ||
|version1= 1.90 | |version1= 1.90 | ||
|game2= ofpe | |game2= ofpe | ||
|version2= 1.00 | |version2= 1.00 | ||
|game3= arma1 | |game3= arma1 | ||
|version3= 1.00 | |version3= 1.00 | ||
|game4= arma2 | |game4= arma2 | ||
|version4= 1.00 | |version4= 1.00 | ||
|game5= arma2oa | |game5= arma2oa | ||
|version5= 1.50 | |||
|version5= 1. | |||
|game6= tkoh | |game6= tkoh | ||
|version6= 1.00 | |version6= 1.00 | ||
|game7= arma3 | |game7= arma3 | ||
|version7= 0.50 | |version7= 0.50 | ||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
|descr= Returns the | |descr= Returns the class name of a given object. | ||
|s1= [[typeOf]] obj | |||
| | |p1= obj: [[Object]] | ||
| | |r1= [[String]] - config class name, or empty string if ''obj'' does not have a class | ||
|x1= <sqf>if (typeOf vehicle player == "B_Heli_Light_01_armed_F") then { hint "Player is in a AH-9 Pawnee"; };</sqf> | |||
|x1= < | |||
|seealso= [[countType]] | |seealso= [[countType]] [[isKindOf]] [[configOf]] | ||
}} | }} | ||
{{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 14:26, 4 August 2023
Description
- Description:
- Returns the class name of a given object.
- Groups:
- Object Manipulation
Syntax
- Syntax:
- typeOf obj
- Parameters:
- obj: Object
- Return Value:
- String - config class name, or empty string if obj does not have a class
Examples
- Example 1:
Additional Information
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 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