Windows Can someone tell me what this means?

Hey there! if someone could tell me why this is happening and how to fix it that would be great. This is from game maker studio 2 - Complete platformer, part 7 transitions.


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object oTransition:

Variable oTransition.mode(100002, -2147483648) not set before reading it.
at gml_Object_oTransition_Step_0 (line 7) - if (mode != TRANS_MODE.OFF)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_oTransition_Step_0 (line 7)
 

chamaeleon

Member
Hey there! if someone could tell me why this is happening and how to fix it that would be great. This is from game maker studio 2 - Complete platformer, part 7 transitions.


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object oTransition:

Variable oTransition.mode(100002, -2147483648) not set before reading it.
at gml_Object_oTransition_Step_0 (line 7) - if (mode != TRANS_MODE.OFF)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_oTransition_Step_0 (line 7)
The variable mode is not set in the instance of object type oTransition that is executing the code. Verify spelling of the variable (and the existence of it) in the Create event or wherever else it might originally be initialized. You may have missed defining it while following the tutorial (or maybe it's missing from the tutorial, but either way, it needs to be defined before you try to get a value from it).
 
The variable mode is not set in the instance of object type oTransition that is executing the code. Verify spelling of the variable (and the existence of it) in the Create event or wherever else it might originally be initialized. You may have missed defining it while following the tutorial (or maybe it's missing from the tutorial, but either way, it needs to be defined before you try to get a value from it).
Hi, could you please simplify what you just said or tell me what to do since I am new and don't really understand what that means.
 

EvanSki

Raccoon Jam Host
The variable mode is not set in the instance of object type oTransition that is executing the code. Verify spelling of the variable (and the existence of it) in the Create event or wherever else it might originally be initialized. You may have missed defining it while following the tutorial (or maybe it's missing from the tutorial, but either way, it needs to be defined before you try to get a value from it).
the object oTransition is trying to get the variable mode (trans_mode.off) but the object does not have the variable set before trying to check it.


TRANS_MODE.OFF
looking at the use of the code, make sure TRANS_MODE is declared as an enum as well
 
So sorry for being dumb but I have no clue what to do, I am a complete beginner and I just followed the tutorial step by step all I know that an enum is red, and variable is blue. Again sorry for being dumb, I have no clue what I'm doing. hopefully, you can tell me exactly what to do and don't get mad at me. :)
 

Attachments

FrostyCat

Member
You typed this in line 16 of the Create event:
GML:
MODE = TRANS_MODE.INTRO;
The video shows this at the 8:00 mark:
GML:
mode = TRANS_MODE.INTRO;
This is the reason why chameleon asked you to verify the spelling of your variables. GML is case-sensitive, and MODE is not the same variable name as mode. You missed the spelling on that variable and now mode is left not set (something else was set instead), and the error in the Step event tells you exactly that.
 
You typed this in line 16 of the Create event:
GML:
MODE = TRANS_MODE.INTRO;
The video shows this at the 8:00 mark:
GML:
mode = TRANS_MODE.INTRO;
This is the reason why chameleon asked you to verify the spelling of your variables. GML is case-sensitive, and MODE is not the same variable name as mode. You missed the spelling on that variable and now mode is left not set (something else was set instead), and the error in the Step event tells you exactly that.
THANK YOU SO MUCH MAN :)
 

samspade

Member
Shameless plug, for a more general information on how to read error messages see:



And for future reference as others noted variable not set before reading it is a very common error which means you are trying to get the value of a variable which has not yet been created. If this is happening even though you have code which should create it likely issues are:
  • spelling or capitalization (as is the case here)
  • order of code (e.g. code reading the value happens before code setting the value)
  • code not being called (e.g. exists inside a conditional statement that isn't triggered or an event that isn't triggered)
 

Yal

šŸ§ *penguin noises*
GMC Elder
The error message itself tells you what's wrong, try reading it in a slightly different order:
Variable oTransition.mode(100002, -2147483648) not set before reading it.


action number 1
of Step Event0
for object oTransition:

at gml_Object_oTransition_Step_0 (line 7) - if (mode != TRANS_MODE.OFF)
 

TheouAegis

Member
You typed this in line 16 of the Create event:
GML:
MODE = TRANS_MODE.INTRO;
The video shows this at the 8:00 mark:
GML:
mode = TRANS_MODE.INTRO;
This is the reason why chameleon asked you to verify the spelling of your variables. GML is case-sensitive, and MODE is not the same variable name as mode. You missed the spelling on that variable and now mode is left not set (something else was set instead), and the error in the Step event tells you exactly that.

Did you actually rewatch the video just for this post, or do you have all of Shaun's errors documented somewhere? The first thing I wondered was, "Is this from one of Shaun's videos?"
 

FrostyCat

Member
Did you actually rewatch the video just for this post, or do you have all of Shaun's errors documented somewhere? The first thing I wondered was, "Is this from one of Shaun's videos?"
No, I simply looked up the video cited in the opening post, then skipped through it looking for the Create event. Took me about a minute to find the exact time.
 
Top