I Wanna Community
Fangames => Game Design => Programming Questions => Topic started by: BoshyMan741 on December 07, 2014, 08:14:00 PM
-
Does anyone here know how to make objects only appear once. (In Gamemaker 8.1) Kinda like the warnings in Happil 2 how they only appear once until you reset/press esc. No one on skype knew how. :BibleThump:
-
Make it a persistent object. Have it become invisible instead of destroying itself, and it destroys itself on the room end event
-
Global variables would do the trick. Simply do something similar to this.
If global.warning[1] = 0 {
// put your warning script here
global.warning[1] = 1;
}
Global variables are persistant until you close or reset the game (or until you reset them to 0 manually). The number 1 within the square brackets can be changed so you can have many different warnings in your game.
-
Thank you! :BloodTrail:
-
Oops... By reset I meant as in pressing F2 not R. Is there a way to change it?
-
If it shows every time you press R it's because you manually set it to 0 in that room or it's not global.
-
If your global variables are reseting to 0 when you press "R" you might be having a problem with the engine.
Check the load scripts and make sure the game doesn't have a restart_game in there. If you do that however, you might have other problems with global trigger variables wich you will need to set to 0 when pressing "R". (before the loadGame script is executed)
-
Yep that was the problem too. :tenKapple: I fixed the other global variables too. Thanks. :atkHappy: