G
Gizmo
Guest
So i am tring to compare user inputed txt in an if statment, but i keep getting this error. On my last game, finished just last night, i had the same issue but i managed to get it to work my making a copy Var and checking against the copied var, but this time it will not work. What i don't understand is why the if statment would try and convert my string to an int in the first place. I think it might be because it is an instance var and it is checking against its refrence number. This post is my last resort, have googled it over 20 times but can't find anything concreate, also checked forms.
My Code...
Where nameCopy is set...(Different object)
Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Alarm Event for alarm 0
for object O_Play_Button:
unable to convert string "Please Enter Name" to int64
at gml_Object_O_Play_Button_Alarm_0 (line 2) - if(string(name2) == "Please Enter Name" | string(name2) == ""){
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_O_Play_Button_Alarm_0 (line 2)
Code:
name2 = O_nameTag.nameCopy;;
if(string(name2) == "Please Enter Name" | string(name2) == ""){
}else{
room_goto(1);
}
Code:
if(clicked){
name = keyboard_string;
}
nameCopy = name;