• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows old text not working?

O

Omega

Guest
I keep getting this error and i have no idea why o_O? i think it could be old text not working with GM 2 :


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

global variable name 'checkpointR' index (100018) not set before reading it.
at gml_Object_obj_checkpoint_Step_0 (line 11) - if (global.checkpointR == room)
############################################################################################

Code:

step

image_angle += 1;

if (place_meeting(x,y,obj_player))
{
global.checkpoint = id;
global.checkpointx = x;
global.checkpointy = y;
global.checkpointR = room;
}

if (global.checkpointR == room)
{
if (global.checkpoint == id) image_index = 1; else image_index = 0;
}
 

FrostyCat

Member
If place_meeting(x, y, obj_player) is false and you haven't declared global.checkpointR anywhere else, global.checkpointR would stay uninitialized by the time you intend to check it. Set it to something like -1 at the beginning of the game.

The potential for problems like this is the reason why declaring instance and global variables inside conditional blocks is rarely a sound move.
 
Top