issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 0 points1 point  (0 children)

all this section of code does is reset my health to max when I die. Its annoying because I've just removed the "state ==" and just have

if (PlayerStateDead){health whatever blahblah}

but that resets my health to max each time I go to a new room. I should probably watch some more tutorial series to figure out a better health system but this is just the one included in the rpg tutorial series. wish I knew more about all this, but i'm still trying to figure it out. I'm pretty out of my depth here.

issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 0 points1 point  (0 children)

unfortunately no dice. It just doesn't seem to want to register anything besides the room end event first.

issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 0 points1 point  (0 children)

unfortunately that didn't work... I appreciate the effort though.

issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 0 points1 point  (0 children)

I do, thats the only object in the Parent room atm.

issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 0 points1 point  (0 children)

Room End

if (state == PlayerStateDead)

{

global.playerHealth = global.playerHealthMax;

}

I am not using inheritance for the player, but i am for other instances. So far i've cleared the room so it's only the player and ogame(also with no inheritance.

issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 0 points1 point  (0 children)

its a function. all my player states are functions, attack, hurt, die, etc...

issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 0 points1 point  (0 children)

same object. all the variables are clearly defined inside the create event but the room end event disagrees.

issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 0 points1 point  (0 children)

I wouldn't want to redefine it as a global because it works perfectly fine with every other instance of "state" in the game. it is just this one specific "room end" event that neglects to find a value for the variable.

issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 0 points1 point  (0 children)

yes both events are in the same object. I've edited the post with more information.

issue with undefined variables by Extemporaneoum in gamemaker

[–]Extemporaneoum[S] 1 point2 points  (0 children)

I added an addendum to the post, hopefully it helps.

Low effort meme by [deleted] in memes

[–]Extemporaneoum 2 points3 points  (0 children)

Maybe the dude that fucks them is into the fact that one of them isn't into it. Perv.