Home   Help Search Login Register  

Author Topic: Class name of ID  (Read 1939 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
Class name of ID
« 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

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Class name of ID
« Reply #1 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:
« Last Edit: 20 Apr 2007, 21:04:28 by Mr.Peanut »
urp!

Offline 456820

  • Contributing Member
  • **
Re: Class name of ID
« Reply #2 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.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Class name of ID
« Reply #3 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..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Cheetah

  • Former Staff
  • ****
Re: Class name of ID
« Reply #4 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.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Class name of ID
« Reply #5 on: 21 Apr 2007, 00:08:41 »
IIRC it returns the object id and the object model name, not the class name..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline 456820

  • Contributing Member
  • **
Re: Class name of ID
« Reply #6 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.
« Last Edit: 21 Apr 2007, 12:06:14 by 456820 »