I try to make a game in wich the player makes atoms. I'm really far in making a good looking and working game.
But now I want to make the atoms have different properties for different phases (solid, liquid, gas) I found that I can't use Phy_restitution because it doesn't exist, so I tried making three objects (solid, liquid and gas) and give them their own properties.
But this didn't work. The create event checks in wich state the atom should be and creates that state, but this gives me a error.
How can I make three phases with different restitution of this atom?
------create event------ obj_h_parent
temp = global.temp
if temp < 14 instance_create(x,y,obj_h_solid) instance_destroy()
if temp > 14 and temp < 20 instance_create(x,y,obj_h_liquid) instance_destroy()
if temp > 20 instance_create(x,y,obj_h_gas) instance_destroy()
the error that I got was :
FATAL ERROR in action number 1 of Create Event for object obj_h_parent:
PerformEvent recursion depth failure - check for infinite loops, check objects for parenting at gml_Object_obj_h_parent_CreateEvent_1 (line 4) - if temp > 20 instance_create(x,y,obj_h_gas) instance_destroy()
I today tried to do it another way by making three objects and letting them check the temperature when they are created by: temp = global.temp if temp < 14 instance_create(x,y,obj_h_s) instance_destroy() if temp > 14 and temp < 20 instance_create(x,y,obj_h_l) instance_destroy() if temp > 20 instance_create(x,y,obj_h_g) instance_destroy()
But when I runned it game maker gave the same error as before. And I have deleted the parent.