Jump to content


Photo

Id ---> Objects


  • Please log in to reply
7 replies to this topic

#1 SpiderKing

SpiderKing

    GMC Member

  • New Member
  • 49 posts

Posted 27 April 2007 - 09:44 AM

If I have an object ID, how can I know to which object (here I talk about name of that object, not which in the room it is..) it belongs to?
  • 0

#2 purple_pixie

purple_pixie

    GMC Member

  • New Member
  • 2647 posts

Posted 27 April 2007 - 09:45 AM

object_get_name(objectid)

OR

object_get_name(instanceid)

both *should* work.
  • 0

#3 SpiderKing

SpiderKing

    GMC Member

  • New Member
  • 49 posts

Posted 27 April 2007 - 09:59 AM

Well lets say i have a script, whit argument0 being a ID. And lets say this ID "belongs" to an object named ob_enemy. I want to make

with( )
{
//action
}

this action execute for all ob_enemy not just for the one whit given Id...

with( object_get_name(argument0))
{
//action
}

this one doesnt work :S
  • 0

#4 purple_pixie

purple_pixie

    GMC Member

  • New Member
  • 2647 posts

Posted 27 April 2007 - 10:19 AM

Ah, so you want object id from instance id?

with object_get_id(argument0)
{
// action.
}
  • 0

#5 SpiderKing

SpiderKing

    GMC Member

  • New Member
  • 49 posts

Posted 27 April 2007 - 11:12 AM

"unknown function: object_get_id"
doesnt work
  • 0

#6 purple_pixie

purple_pixie

    GMC Member

  • New Member
  • 2647 posts

Posted 27 April 2007 - 12:43 PM

Oh yeah.

Sorry - that was just balls :)

What you really want is this:

with (argument0.object_index)
{
do_something_fun()
}

  • 0

#7 SpiderKing

SpiderKing

    GMC Member

  • New Member
  • 49 posts

Posted 27 April 2007 - 12:46 PM

Think that works.. Thank you
  • 0

#8 purple_pixie

purple_pixie

    GMC Member

  • New Member
  • 2647 posts

Posted 27 April 2007 - 12:51 PM

No trouble.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users