Help with skins after death?

J

jlpt

Guest
I'm trying to make it so after you pick a skin and you die that you will stay with that skin after a room restart there might be an easy way to make it when the room_restarts it doesn't re-declare the variables
 
I think you could assign the skin to a global variable, that shouldn't change it's value unless you destroy the object containing it. You're probably best setting up a save function so that the selection doesn't get lost when the player completely exits the game.
 
A

Aura

Guest
Note that you should declare the global variable at such a place where it doesn't get reset. Creation code of a boot room being one such good place.

Code:
global.skin = "default";
room_goto(rm_Main);
If you want the data to be maintained across different game instances, write it to a text or INI file.
 
J

jlpt

Guest
thanks i didn't think about that i just declared it when my character spawned thankfully i already have creation code from doing other stuff
 
J

jlpt

Guest
omg... wow i feel so stupid i was confused for like 10 minutes because i didn't see i accidently left creation code in LVL_1 and it said global.skin = 0
 
Top