Code:
switch(Command) //do we have a command or error
{
case ("CMD_OVERFLOW") : show_debug_message("To many commands in one line") break;
case ("CMD_ERROR") : show_debug_message("'"+input_string+"'"+"is not recognized as an internal or external command or operable program.") break;
case (1) : script_execute(scr_do_con);
}
/* if this is here the global updates and it works fine
//destroy grid
ds_grid_destroy(cmd_list);
global.con_input = true;
*/
Code:
global.con_input = true;
Code:
var grid = cmd_list;
//loop through grid looking for which command is 1
for (var i = 0; i < cmd_list_size; i++)
{
grid_place = (grid[# 1, i]);
if (grid_place == true)
{
//save what command it is
value = ds_grid_get(grid,0,i);
//show_message(string(value));
}
}
//get the asset name of the command, lower case value because case sensitive
value = string_lower(value);
var command = asset_get_index("scr_cmd_"+value);
//if it exists do it else panic
if (command != -1)
{
script_execute(command);
}else{
show_message(value);
show_message(command);
ds_grid_destroy(cmd_list);
game_end();
}
the only thing that wont work is setting global.con_input = true
in a different place, what am I doing wrong?