if (distance(player.x, player.y, NPC.x, NPC.y) <= 20) //Event only occurs when player is close enough to NPC (Defines a 20 px radius).
{
EventDisable("player", EVENTALL); //Disable player controls
transp = 0; //Set the Messages to be visible
switch(Dialogue_Position) //Keeps the position in the dialogue
{
case 1: sprintf(text,"Hello Link, how are you today?",text); //Change the message
Dialogue_Position++; //Increment Dialogue's position by 1
break; //Ignore the rest of "case" labels
case 2: sprintf(text,"Have you visited the BAKERY yet?",text); //Same as Case 1 (You can have as many as you wish)
Dialogue_Position++;
break;
case 3: sprintf(text," ",text);
transp = 1; //Make the messages invisible.
EventEnable("player", EVENTALL); //Enable player controls
Dialogue_Position = 0; //Reset Dialogue Position to 0 in order to be able to go through the dialogue another time
break;
}
}
sprintf(text,"This example text string\nis spread over two lines!!!",text);
Users browsing this forum: No registered users and 1 guest