OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: 456820 on 20 Apr 2007, 17:34:32

Title: Class name of ID
Post by: 456820 on 20 Apr 2007, 17:34:32
I remember in OFP that you could find the class name of an object by using its Object ID. So what i need to do is find the class name of an object which is currently placed on the island by using its object ID - is this still possible? If so how do I do it since i have forgotten how it was done.
Thanks
Title: Re: Class name of ID
Post by: Mr.Peanut on 20 Apr 2007, 19:13:54
Go into Editor and hit Display ID, then zoom in and find the ID of the object you want. Then:

edit: erroneous code deleted

Sorry. I have not quite caught up yet to ArmA...  :no:
Title: Re: Class name of ID
Post by: 456820 on 20 Apr 2007, 19:59:20
Thanks very much.
Thats topic solved then. Cheers.

Edit - Hmm hang on, It doesnt seem to work in game. Says error missing ] just before the ID

hint format["%1", typeof object (Says a ] is needed here)xxx]

Even when ive inserted the Object ID.
Title: Re: Class name of ID
Post by: h- on 20 Apr 2007, 20:40:25
Search would probably have revealed that the command object does not exist in ArmA anymore due to the streaming technology used..

You need to use nearestObject for finding objects.
The objects do not exist until they are 'streamed up' (within player's viewdistance readius I guess) even though they have the IDs.

This should work (can't test it myself atm)
Code: [Select]
hint format ["%1",typeOf ((position player) nearestObject XXXX)]Just remember that if the object is not within the viewdistance the game will pause as it streams the object up first..
Title: Re: Class name of ID
Post by: Cheetah on 20 Apr 2007, 23:23:49
The code h- wrote should work. Used it for myself when trying to get the classname of an oil derrick. What I noticed is that when using the nearestObject command the returned object names are pretty weird and aren't just short class names. Does anyone know if it's caused by the streaming?

Good to see you back on OFPEC 456820.
Title: Re: Class name of ID
Post by: h- on 21 Apr 2007, 00:08:41
IIRC it returns the object id and the object model name, not the class name..
Title: Re: Class name of ID
Post by: 456820 on 21 Apr 2007, 11:48:50
Thanks all but still it seems to not work. This time there is no error however. But instead the hint just doesn't show up. Ive tried putting it in the players init field. In a trigger, in a trigger with a small delay and a trigger with a radio alpha to set it off. And the hint still doesn't show.

Oh and thanks Cheetah its good to be back.  :D

Well had a little edit and get it working. Thanks.

#Topic solved.