Proximity Dialogue Problem

S

Squirtle Plays

Guest
I'm trying to figure out how to create a range based dialogue system and this is what I've come up with but its resulting in this message
FATAL ERROR in
action number 1
of Key Press Event for X-key Key
for object object5:

Variable object5.mydialogue(100029, -2147483648) not set before reading it.
at gml_Object_object5_KeyPress_88 (line 1) - if point_distance(10,0,object3,object5,) PlayDialogue(mydialogue);

stack frame is
gml_Object_object5_KeyPress_88 (line 1)

here's my code


AddDialogue script
Code:
ds_queue_enqueue(argument0, argument1);
CreateDialogue script
Code:
return ds_queue_create();
PlayDialogue script
Code:
if(instance_exists(obj_Dialogue_System)){
    show_debug_message("You like jazz?");
}else{
  
    with(instance_create_depth(0,0,0, obj_Dialogue_System)){
        dialogue = argument0;
        event_user(0)
    }
  
}
obj_Dialogue_System Create event
Code:
current_message = "";
obj_Dialogue_System Draw event
Code:
draw_text(300, 200, current_message);
obj_Dialogue_System user event 0
Code:
value = ds_queue_dequeue(dialogue)

if(is_undefined(value)){
    instance_destroy();
}

current_message = value;
obj_Dialogue_System key press z
Code:
event_user(0);
Key press x object 5
Code:
if point_distance(10,0,object3,object5,) PlayDialogue(mydialogue);
mydialogue = CreateDialogue();
AddDialogue(mydialogue, "Hey, this is dialogue 1");
AddDialogue(mydialogue, "Hey, this is dialogue 2");
AddDialogue(mydialogue, "Hey, this is dialogue 3");
PlayDialogue(mydialogue);
I'm kind of stumped so any help would be appreciated
 
Last edited by a moderator:
S

Squirtle Plays

Guest
I switched around the
if point_distance(10,0,object3,object5,) PlayDialogue(mydialogue); and
mydialogue = CreateDialogue();
but is makes it so that proximity doesnt matter and the dialogue starts anywhere in the room
 
S

Squirtle Plays

Guest
I deleted the comma but I think that was just the beginning of my problems
 
Top