[SOLVED] Where to put the input handling code

jana

Member
I have a countdown timer, and on creation of the object obj_user_input, a gamemaker dialog box pops up with the message to enter a number. I use this input to set the timer.

When I put the input handling code in the obj_user_input creation, game_start, room_start, or step code, I get the same basic error, that the ds_map, created by clicking ok in the dialog, doesn't exist.

So where do I put the input handling code? Seems like game_start or room_start would work. What am I missing?

Thanks in advance for any suggestions.

Here's the error:
############################################################################################
ERROR in
action number 1
of Other Event: Room Start
for object obj_user_input:

Data structure with index does not exist.
at gml_Object_obj_user_input_StartRoomEvent_1 (line 1) - var map_id = ds_map_find_value(async_load, "id");
############################################################################################
dialog box code:
Code:
global.msg = get_integer_async("Set Timer (minutes)", 60);
input handling code:
Code:
var map_id = ds_map_find_value(async_load, "id");
if map_id == global.msg
{
   if ds_map_find_value(async_load, "status") // If person clicked OK, not cancel
   {
      global.desired_minutes = ds_map_find_value(async_load, "value");
   }
}
 
Top