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

Fatal error - variable not set before reading ??

Fredrik

Member
Explain this to me please ^^

ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object player:


Variable player.z(100009, -2147483648) not set before reading it.
at gml_Object_player_StepNormalEvent_1 (line 2) - z1 = z; ########################################################################################


This is the first two lines of Step Even 0 in the object Player:

Code:
/// step events.
z1      = z;
The z is as the fatal error says not defined.

Here is the four first lines of Create Event 0 in the object Player:

Code:
/// Variables.
z          = 1;
z1        = z;
z2        = z1 + 16;
How is z not defined? I've been working on the same project for years and never had this issue, until just now :C
 

Fredrik

Member
Any chance you used "var" somewhere nearby without a semicolon?
I dont think so. If so I must have managed to add one by accident. But I havn't been doing any changes in the player object in a long time. I made some changed to level generation earlier today, I'll try to change it back to how it used to be and se if that'll magically fix it.

I have system which generates a random dungeon, and it's supposed to fill some parts of it with "special" rooms, like puzzle rooms or secret rooms or whatever, and in the second area of the game I havn't made enough "puzzle" rooms yet, so I just added some other normal rooms to the pool to prevent the same puzzles from appearing over and over, and for some reason the game didn't like that :) I changed it back, and I didn't get the error. However since the level is randomally generated it's somewhat hard to replicate the error. But it seems to have fixed it.
 

Evanski

Raccoon Lord
Forum Staff
Moderator
Make sure your code reads the (Z = 1) code first then what every your doing to Z

Also please rename your variables unless there Var
From my experiences you wont know what they do or for if your not coding the same thing 24/7
 
Top