typeOf: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
back to [[Scripting_Reference#T|COMREF]]
<h2 style="color:#000066">'''typeOf ''vehicle'''''</h2>
<h2 style="color:#000066">'''typeOf ''vehicle'''''</h2>


'''Operand types:'''
'''Operand types:'''


vehicle: [[Object]]
'''vehicle:''' [[Object]]


'''Type of returned value:'''
'''Type of returned value:'''
Line 12: Line 15:


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


'''Example:'''
'''Example:'''
Line 20: Line 24:
'''Comments'''
'''Comments'''


Comments by ''General Barron''
Try using this on an object pre-placed in the mission editor (such as a house):
 
[[hint]] [[format]]["%1", '''''typeof''''' [[object]] xxx]


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]].


hint format["%1", '''''typeof''''' object xxx]
Find the line: '''vehicle="XXX"''', and replace '''XXX''' with the name of the object that you found above.


Now place an object in the editor, save the map, and open up the mission.sqm.
Save it, and load the map.
Find the line: vehicle="XXX", and replace XXX with the name of the object that you found above.
Save it, and load the map. You just placed a new house!

Revision as of 19:16, 15 April 2006

back to COMREF

typeOf vehicle


Operand types:

vehicle: Object

Type of returned value:

String

Description:

Returns the class type of a given object or vehicle.


Example:

_class = typeOf _mi24


Comments

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.