C
Charliebailey03
Guest
Okay, so I watched this guy's tutorial on how to make dialogue boxes, and for the first time ever it it worked first try! But I don't know how to make it into a dialogue for an NPC, or make it changeable for different objects in the creation code or anything. He also uploaded a video of dialogue for NPC's and signs, ETC, but he did something with a destroy object which i don't have in my game because there's no fighting. Also when I start the room with the dialogue in it displays automatically, but I want it to appear when I press a key near an NPC and the have a different dialogue to when I press a key near a different NPC. I can answer any questions needed, I don't mind. However I only started coding in around March so you may have to explain a few things to me a begginer wouldn't understand. Thanks
Code:
Ob_Dialog
- Create Event
-/// Initialize the dialog object
text = noone;
text_visible = "";
text_page = 0;
text_count = 0;
spd = .5;
display_scale = display_get_gui_width()/view_wview[0];
width = sprite_width*display_scale;
margin = 8;
- Draw GUI event
/// Draw the dialog
text_count += spd;
text_visible = string_copy(text[text_ppage], 0, text_count);
var xx = (x-view_xview[0])*display_scale;
var yy = (y-view_yview[0])*display_scale;
draw_text_ext(xx+margin, yy+margin, text_visible, -1, width-(margin*2));
Ob_Speaker
- Create Event
/// Initialize the speaker
dialog = noone;
dialog_page = 0;
xoffset = -32;
yoffset = -40;
text[0] = "FKJSDHFKSJ"
text[1] = "23827328"
text[2] = "FASDFSDHJF"
-Step Event
/// Update the depth
depth = -y;