• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 [SUGGESTION] Instance Activated / Instance Deactivated EVENTS

xDGameStudios

GameMaker Staff
GameMaker Dev.
Hi everyone!
I was coding today morning and I got to a point where I usually, when deactivating objects, i need to act upon then. Like reseting some variables when deactivating an object used for transitions effects between rooms!
What do you think about adding this two events to the event list!?
What good workarounds do you use? (apart from using a custom deactivate function that runs code before actually deactivating... because this way we lose code encapsulation).
 

gnysek

Member
Code:
with (a) {
// ... do something
}
instance_deactivate_object(a);
maybe ?

In fact, if instance is deactivated, shouldn't run an event :) Also, to save frame time, instances are now (de)activated at end of step, not ASAP when you call it from code, so this have also no sense (you can deactivate then activate in same step, and this will cause no change in fact for game).
 

xDGameStudios

GameMaker Staff
GameMaker Dev.
Code:
with (a) {
// ... do something
}
instance_deactivate_object(a);
maybe ?

In fact, if instance is deactivated, shouldn't run an event :) Also, to save frame time, instances are now (de)activated at end of step, not ASAP when you call it from code, so this have also no sense (you can deactivate then activate in same step, and this will cause no change in fact for game).
Thank you for the detailed information :)
 
Top