• 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!

Legacy GM Question about child and parent in gms

N

Naillik

Guest
I have a problem with this twist of code ,in simple i want create code for every object with one ,the problem is the variables strongely he say they doesnt exist and its probaly because i create in the parent variables and in the children variables too
i try to just combine two variables ,one in the children,one in the parent and do this code in the parent.
----------------------------------------------------
For exemple :
in children
Create:
vit = 10;

---------------------------------------------------
in parent :
Create:
charg = 0;
alarm[0] = room_speed;

Alarm[0]:
charg = clamp(charg, 0, 100) + vit;

alarm[0] = room_speed;

Draw GUI:
//bar charge
draw_healthbar(x,y-5,x+sprite_width,y,charg,c_black, c_blue, c_white,0,false,false);

It works WITHOUT the fact i use parent and children fonction but i really want to make it work.

So if you have idea or tutorial answer me I'm totally open for any suggestion.
PS : sorry for my spelling mistake,i'm french ^^
 
N

Naillik

Guest
Thanks FrostyCat but strangely doenst work (say my variable charg doesnt exist when i use it in a the step parent)
 
Last edited by a moderator:

FrostyCat

Redemption Seeker
event_inherited() is meant to be used in the child object, not the parent object.

Have you read the Manual entry for real?
 
Top