This lesson is a continuation of the Sonic lesson. Creating cutscenes in Simple Sonic Worlds.
In this lesson, we diversify the scene from the Sonic lesson. Create cutscenes in Simple Sonic Worlds. by adding a dialog box to it.
Create an active object(Active),counter(Counter),and string(String). And put them on a frame.
The active object will be our window in which the text is printed. A string is the text itself. Counter – will show the current page.
Remove the Visible at startflag from these 3 objects to make the objects invisible.
Do not forget about the objects Stop Trigger and Next Level Trigger,from the previous lesson.
Next, go to the event editor (Ctrl+E). And set the character to stop when confronted with a Stop Trigger.
And all dialog objects (Active, String, Counter) become visible.
When a character encounters Next Level Trigger,the game moves to the next frame.
Now, let's start prescribing the logic of our dialog box. When you click on any button (Upon pressing any key).
The counter increases by 1.
Next, create a condition if the counter is 2.
Then, change the text of the string (String).
On "Message 2"
By analogy, check the rest of the counter values. The more messages you have in the dialog, the more checks.
Therefore, the counter value changes the text in the dialog box.
Now, let's create a condition under which the dialogue will close and the sonic will continue its journey. To do this, check if the counter value is more than 5 (last message).
That sonic will continue its movement.
And the dialog box disappears.
The dialogue is ready, it remains to fix the bugs.
Add a new condition to the event responsible for pressing the keys. The Insert button is somewhat similar to the AND action of the operator in Boolean logic. That is, the event will occur only if all the conditions are met.
If the counter value is less than or equal to 5 and any key is pressed.
And also, our character comes into contact with Stop Trigger
Only then increase the counter by 1.
Done, now if you start to see your unique dialog.