Jump to content


Photo

How to get an instances id after being created


  • Please log in to reply
5 replies to this topic

#1 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 25 February 2012 - 10:28 PM

After an enemy gets defeated I want another instance to pop up but want the instance that pops up id number so the code I put after it only accounts for that instance that pops up.
Thanks!!!
  • 0

#2 Artaex Media

Artaex Media

    Artaex Media

  • GMC Member
  • 1528 posts
  • Version:GM8

Posted 25 February 2012 - 10:43 PM

instanceID = instance_create(x, y, object);

  • 0

#3 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 26 February 2012 - 06:00 AM

instanceID = instance_create(x, y, object);

Just wondering so I don't have to put anything else? Everything after that will only apply to that id?
  • 0

#4 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8246 posts
  • Version:GM7

Posted 26 February 2012 - 06:33 AM

You need to use the variable in conjunction with what you're doing. So if you want to set that particular instance's speed, you would use

instanceID.speed = 10;

just like you would using the object index.
  • 0

#5 FoxInABox

FoxInABox

    GMC Member

  • GMC Member
  • 5379 posts
  • Version:GM:Studio

Posted 26 February 2012 - 06:38 AM

if you want it to make it perform a functions then you have to use with
with(instanceID){
  instance_destroy()
}

  • 0

#6 DcoldSaviour77

DcoldSaviour77

    GMC Member

  • GMC Member
  • 255 posts
  • Version:GM8

Posted 26 February 2012 - 06:41 AM

K, Thanks!!!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users