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

Legacy GM Error in Step Event0[SOLVED]

B

babs!

Guest
I'm making a game using networking, and I got this error, this shouldn't be a networking error, but I couldn't understand why this was happening.

Can someone explain this error, I never made the variable oClient.T , and I’m not trying to read it in the code. Also, I am not sure why it says Step 0 when I only have a step 1.



############################################################################################

FATAL ERROR in

action number 1

of Step Event0

for object oClient:


Variable oClient.T(100008, -2147483648) not set before reading it.

at gml_Object_oClient_Step_0

############################################################################################

Code:




oClient:


///Create Event:



connected = false;

get_string_async("Please enter a username", "");


spawned = false;

global.team = noone;

Join_Buffer = buffer_create(256, buffer_fixed, 1);



================================================================================

///Step Event:


//Spawn in Player….

// Based on What team is chosen by the server team autobalance, The server will send a //notification to this step event which will trigger the Alarm [0] loop to contsatly update sprite,x, // coords,y coords, and so on....


if(spawned = false){

if(global.team = T){

instance_create(oPlayer_T,96,640);

view_object = oPlayer_T;

alarm[1]=2;

spawned = true;



buffer_seek(Join_Buffer, buffer_seek_start, 0);

buffer_write(Join_Buffer, buffer_u8, MESSAGE_JOIN_T);

buffer_write(Join_Buffer, buffer_string, name);

network_send_raw(0, Join_Buffer, buffer_tell(Join_Buffer));




}

else if(global.team = CT){

instance_create(oPlayer_CT, 896,64);

view_object = oPlayer_CT;

alarm[2]=2;

spawned = true;



buffer_seek(Join_Buffer, buffer_seek_start, 0);

buffer_write(Join_Buffer, buffer_u8, MESSAGE_JOIN_CT);

buffer_write(Join_Buffer, buffer_string, name);

network_send_raw(0, Join_Buffer, buffer_tell(Join_Buffer));




}

}
 
Well, you're right that you didn't create the T variable, but you're wrong that you're not trying to read it.

Code:
if(spawned = false){

if(global.team = T){...
 
B

babs!

Guest
Well, you're right that you didn't create the T variable, but you're wrong that you're not trying to read it.

Code:
if(spawned = false){

if(global.team = T){...
I'm not saying I know what I'm talking about, but that is a global variable and the error says it was a local variable oClient.T
Also, I set it to noone in the create event.
 
B

babs!

Guest
I'm not saying I know what I'm talking about, but that is a global variable and the error says it was a local variable oClient.T
Also, I set it to noone in the create event.
Oh wait a minute..... I'm sorry, its a variable in the error. you're right, I had a second thought of what you said.... I'm trying to make global.team equal the string.... and I made it equal a variable. I should put quotes on it.
 
Top