GameMaker: Studio

GameMaker: Studio

View Stats:
Not set before reading it, what is happening?
The program noticed me this error
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_player:


Variable obj_player.rigth_key(100005, -2147483648) not set before reading it.
at gml_Script_scr_move_state (line 5) - xaxis = (rigth_key - left_key);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_scr_move_state (line 5)
called from - gml_Object_obj_player_StepNormalEvent_1 (line 2) - scr_move_state();



the code is
/// scr_move_state
scr_get_input();

// get the axis
var xaxis = (rigth_key - left_key);
var yaxis = (down_key - up_key);

// get direction
var dir = point_direction(0, 0, xaxis, yaxis);

// get the length
if (xaxis == 0 and yaxis = 0) {
len = 0;
} else {
len = spd;

}

// get the hspd and vspd
hspd = lengthdir_x(len, dir);
vspd = lengthdir_y(len, dir);

// move
phy_position_x += hspd;
phy_position_y += vspd;

// Control the sprites
image_speed = .2;
if (len == 0) image_index = 0;


// Vertical Sprites
if (vspd > 0) {
sprite_index = spr_player_down;
} else if (vspd < 0) {
sprite_index = spr_player_up;
}

// Horizontal Sprites
if (hspd > 0) {
sprite_index = spr_player_right;
} else if (hspd < 0) {
sprite_index = spr_player_left;
}




Somebody can help me? i really dont know what is happening.


Last edited by 🎃Wonka🎃; 13 Mar, 2017 @ 5:08pm
< >
Showing 1-8 of 8 comments
Blind 13 Mar, 2017 @ 5:24pm 
Variable obj_player.rigth_key(100005, -2147483648) not set before reading it.

Variable not set before reading it.
🎃Wonka🎃 13 Mar, 2017 @ 6:12pm 
I cannot understand, you can explain? please?
@KB_United 13 Mar, 2017 @ 6:26pm 
Originally posted by Wonka:
I cannot understand, you can explain? please?
Looks like you misspelled right key

whereever oj_player.right_key is supposed to be written.
🎃Wonka🎃 14 Mar, 2017 @ 6:26pm 
i writed "obj_player.right_key" but give errors inside the code
kris40k 14 Mar, 2017 @ 10:17pm 
var xaxis = (rigth_key - left_key);

rigth_key

That's (probably) a typo. Did you actually name the variable "right_key"?

Anyways, the game doesn't see a variable set called "rigth_key" and then throws the error that it is attempting to read something that hasn't been set yet.
kamix.grzempa 18 Jun, 2023 @ 4:01am 
i have a similar problem with cyop vigilante if he walks for 1 milisecond this error shows up:
___________________________________________
############################################################################################
ERROR in
action number 1
of Step Event0
for object obj_vigilanteboss:

Unable to find instance for object index -4
at gml_Script_scr_vigilante_walk
############################################################################################
gml_Script_scr_vigilante_walk (line -1)
gml_Object_obj_vigilanteboss_Step_0
The Winter Bud 18 Jun, 2023 @ 3:57pm 
Originally posted by kamil.grzempa:
i have a similar problem with cyop vigilante if he walks for 1 milisecond this error shows up:
___________________________________________
############################################################################################
ERROR in
action number 1
of Step Event0
for object obj_vigilanteboss:

Unable to find instance for object index -4
at gml_Script_scr_vigilante_walk
############################################################################################
gml_Script_scr_vigilante_walk (line -1)
gml_Object_obj_vigilanteboss_Step_0
the problem is you are trying to reference an object_index that equals 'noone' or -4. Make sure when referencing and object_index you give it the proper one. You didn't supply the script that is actually throwing the error so it's hard to tell how to fix it.
Last edited by The Winter Bud; 18 Jun, 2023 @ 3:59pm
UNderMIK3ys_L 23 Jun, 2024 @ 8:46pm 
PLZ HELP!!!!!!
I want to use the cyop mod but everytime it launches i get an error from pizza tower
And pizza oven patches them successfully but always get this error everytime i launch it.

Saying:
ERROR in
action number 1
Of Create Event
for object <undefined>:

Error attempting to load wad file with unexpected size 7018496 szFORM 3
---------------------------------------------------------------------------------
PLZ HELP!!!!! I WANT TO USE IT PLZ!!!!!!!!
< >
Showing 1-8 of 8 comments
Per page: 1530 50