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
CreateDialogue script
PlayDialogue script
obj_Dialogue_System Create event
obj_Dialogue_System Draw event
obj_Dialogue_System user event 0
obj_Dialogue_System key press z
Key press x object 5
I'm kind of stumped so any help would be appreciated
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);
Code:
return ds_queue_create();
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)
}
}
Code:
current_message = "";
Code:
draw_text(300, 200, current_message);
Code:
value = ds_queue_dequeue(dialogue)
if(is_undefined(value)){
instance_destroy();
}
current_message = value;
Code:
event_user(0);
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);
Last edited by a moderator: