Legacy GM how to draw dialog text dynamic (text typ effect like in many RPG 's)

jobjorgos

Member
Heya,

How can I make the code below effecient so I only have to write the complete message one time?

Step:
Code:
if dialog==1{
    draw_text(220,962,'Goodmorning!');
}
if dialog==2{
    draw_text(220,962,'Goodmorning! I');
}
if dialog==3{
    draw_text(220,962,'Goodmorning! I see');
}
if dialog==4{
    draw_text(220,962,'Goodmorning! I see you');
}
if dialog==5{
    draw_text(220,962,'Goodmorning! I see you woke');
}
if dialog==6{
    draw_text(220,962,'Goodmorning! I see you woke up!');
}
if dialog==7{
    draw_text(220,962,'Goodmorning! I see you woke up! I');
}
if dialog==8{
    draw_text(220,962,'Goodmorning! I see you woke up! I heard');
}
if dialog==9{
    draw_text(220,962,'Goodmorning! I see you woke up! I heard alot');
}
if dialog==10{
    draw_text(220,962,'Goodmorning! I see you woke up! I heard alot of');
}
if dialog==11{
    draw_text(220,962,'Goodmorning! I see you woke up! I heard alot of noise');
}
if dialog==12{
    draw_text(220,962,'Goodmorning! I see you woke up! I heard alot of noise from');
}
if dialog==13{
    draw_text(220,962,'Goodmorning! I see you woke up! I heard alot of noise from James');
}
if dialog>=14{
    draw_text(220,962,'Goodmorning! I see you woke up! I heard alot of noise from James house!');
}

Alarm[0]:
Code:
dialog +=1;"
alarm[0] = 8;
 

obscene

Member
You can use string_copy(str, index, count); to create a temporary copy of the text, starting with a count of 1 and ending with the length of your total string (use string_length). So each time your alarm ticks, increase count by 1 and copy the string again.

For full examples of it search for "typewriter text"
 
Top