A
Agletsio
Guest
All that follows is executed via a timeline
So I have a cutscene type thing, that flips between two rooms, seven times (then flips to new room the eighth time).
On the 1, 3, 5, 7th time, I want text to write (in typewriter style). Now I've mostly achieved this but the text only writes on 1 and 3 and doesn't write anything afterwards.
I've also noticed that they don't draw at the same coordinates, even though draw text is set to the x and y position of the same persistent object (obj_talk).
I hope this makes sense, not sure how else to explain it. Any help, insight or guidance would seriously be appreciated! I've been stuck with this for quite some time but can't get it to fully work.
This is the relevant code (in obj_talk):
Like mentioned before, the variables are executed via a timeline. Here's an example of a step:
So I have a cutscene type thing, that flips between two rooms, seven times (then flips to new room the eighth time).
On the 1, 3, 5, 7th time, I want text to write (in typewriter style). Now I've mostly achieved this but the text only writes on 1 and 3 and doesn't write anything afterwards.
I've also noticed that they don't draw at the same coordinates, even though draw text is set to the x and y position of the same persistent object (obj_talk).
I hope this makes sense, not sure how else to explain it. Any help, insight or guidance would seriously be appreciated! I've been stuck with this for quite some time but can't get it to fully work.
This is the relevant code (in obj_talk):
Code:
//CREATE EVENT
mesg[0] = false;
mesg[1] = false;
mesg[2] = false;
mesg[3] = false;
message[0] = "'This isn't happening...'"
message[1] = "'Where could he be?'"
message[2] = "'It's been days...'"
message[3] = "'I can't give up!'"
message_current = 0;
message_draw = "";
increase = 0.37;
characters = 0;
message_length = string_length(message[message_current]);
//STEP EVENT
// Message 0
if mesg[0] = true {
message_current = 0;
if characters < message_length {
characters += increase;
message_draw = string_copy(message[0], 0, characters);
}
else
if characters >= message_length {
characters = message_length;
}
}
// Message 1
else
if mesg[1] = true {
message_current = 1;
if characters < message_length {
characters += increase;
message_draw = string_copy(message[1], 0, characters);
}
else
if characters >= message_length {
characters = message_length;
}
}
//Message 2
else
if mesg[2] = true {
message_current = 2;
if characters < message_length {
characters += increase;
message_draw = string_copy(message[2], 0, characters);
}
else
if characters >= message_length {
characters = message_length;
}
}
// Message 3
if mesg[3] = true {
message_current = 3;
if characters < message_length {
characters += increase;
message_draw = string_copy(message[3], 0, characters);
}
if characters >= message_length {
characters = message_length;
}
}
//DRAW EVENT
if mesg[0] = true {
draw_set_font(fnt_talk);
draw_set_halign(fa_left);
draw_set_valign(fa_center);
draw_set_colour(c_white);
draw_text(x,y,message_draw);
}
if mesg[1] = true {
draw_set_font(fnt_talk);
draw_set_halign(fa_left);
draw_set_valign(fa_center);
draw_set_colour(c_white);
draw_text(x,y,message_draw);
}
if mesg[2] = true {
draw_set_font(fnt_talk);
draw_set_halign(fa_left);
draw_set_valign(fa_center);
draw_set_colour(c_white);
draw_text(x,y,message_draw);
}
if mesg[3] = true {
draw_set_font(fnt_talk);
draw_set_halign(fa_left);
draw_set_valign(fa_center);
draw_set_colour(c_white);
draw_text(x,y,message_draw);
}
Like mentioned before, the variables are executed via a timeline. Here's an example of a step:
Code:
room_goto(rain_test);
obj_talk.mesg[1] = true;
in[1] = false; // Setting variable from previous step to false