Jump to content


Photo

Remembering when an instance has been destroyed


  • Please log in to reply
7 replies to this topic

#1 Ichenhamlish

Ichenhamlish

    GMC Member

  • GMC Member
  • 19 posts
  • Version:GM8.1

Posted 26 February 2012 - 06:33 PM

I have multiple instances of the same object in a room. Let's call it a "point" for simplicity's sake.
Without making a new object and variable for every instance of the point, how can I make it so that when I leave the room and come back, the game remembers which points have been destroyed?
  • 0

#2 creepers9164

creepers9164

    GMC Member

  • GMC Member
  • 72 posts
  • Version:GM8

Posted 26 February 2012 - 06:39 PM

Just click the persistent checkbox on the settings tab for the room. I hope I helped. :thumbsup:
  • 0

#3 Ichenhamlish

Ichenhamlish

    GMC Member

  • GMC Member
  • 19 posts
  • Version:GM8.1

Posted 26 February 2012 - 07:05 PM

Just click the persistent checkbox on the settings tab for the room. I hope I helped. :thumbsup:

Oh no, it was really that simple? I'm facepalming so hard right now.
Thank you xD
  • 0

#4 creepers9164

creepers9164

    GMC Member

  • GMC Member
  • 72 posts
  • Version:GM8

Posted 26 February 2012 - 07:29 PM

Haha no problem!
  • 0

#5 Ichenhamlish

Ichenhamlish

    GMC Member

  • GMC Member
  • 19 posts
  • Version:GM8.1

Posted 26 February 2012 - 07:36 PM

Sorry, an additonal question. If rooms are persistent, how can I get a certain object to run its creation event every time a room is visited?
  • 0

#6 TheouAegis

TheouAegis

    GMC Member

  • GMC Member
  • 5216 posts
  • Version:GM8

Posted 26 February 2012 - 08:10 PM

Try putting its creation code in the Room Start trigger instead and see if that helps. I'm not sure if persistent rooms will bypass that trigger or not, though.
  • 0

#7 Ichenhamlish

Ichenhamlish

    GMC Member

  • GMC Member
  • 19 posts
  • Version:GM8.1

Posted 26 February 2012 - 08:21 PM

Yeah, that did it. Thanks a lot :)
  • 0

#8 TheouAegis

TheouAegis

    GMC Member

  • GMC Member
  • 5216 posts
  • Version:GM8

Posted 26 February 2012 - 08:30 PM

Oh yeah, just a quick warning about that method, though.

Room Start triggers early on but still pretty late in the sequence of events. Read up on the order of event sequences in GM, because trying to reference a variable in an event that triggers before the Room Start event can cause errors.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users