Level editor tutorial

Triggers guide

You have already seen how triggers work in tutorial and campaign missions. The basic principle is detection of some events in the game and producing reactions. For example, you might want to make a mission where the player wins after entering some area. So, you create a trigger "UnitsNumberTrigger" and define an action "SetFactionWin". So, let's practice:

To access triggers you have to check "Campaign" in settings.

Now spawn a player spawn point and few soldiers.

Note that the City hall is not spawned in campaign mode. Because you often have missions without city halls in the campaign.

So, you have units and a spawn point. Let's create a trigger

Select "UnitsNumberTrigger". Put it somewhere,  the location of the triggers doesn't matter.

Now enter selection mode and select the spawned trigger, then press [...] button into the left bottom corner.

The object parameters page is showing up.

Available parameters are on the left side. Select the first one and choose the faction you expect to enter the area. Choose the one you have spawned before.

The next parameter is "UnitDetector". This is the object that defines the shape of the area. So, we first have to create it.

Press the "close" button and spawn another object "UnitDetector", select it, and press [...] to see it's parameters. I believe that parameter names say dot themselves. So, set the area type and it's dimensions. Then press the "Close button".

In order to insert an object into the parameters of another object, we use the "Copy button". So, copy the created UnitDetector and open parameters of AreaEnterTrigger.

Select "unitDetector" and press "Insert reference"

Now it's time to add action to the trigger.

In the tutorial I'm going to explain 2 the most important ones are "ShowReplicas" for showing replicas and "SetFactionWin" for making some faction win.

Actions are performed in order, so they are called "Steps", press "Add step" button and select "ShowReplicas" the step will be added.

The one ShowReplicas step can contain multiple replicas with single character. So, let's add a replica. Press the green [+] button.

Press on the created slide. You will see the empty screen. The game has multiple localizations, so we add a localized text with "Add object" button.

The first field is the default line that will be shown if no translation available. You may write translation to your native language down below. Entering "English" is not really necessary. But the "Master text" is mandatory.

After entering the text, just close the window.

Now it's important to tap on the just added localized text so, it will be displayed in "text" parameter of the slide. Like on the next screenshot.

Now let's select a character to say the replica.

In property "characterVisual" select the object "Mate" or one of few other objects below it (now only these few objects will properly work)

Now you can select the side of the screen to show the replica. If you save and run the game, dialog will be shown once you enter the area.

The last step. Let's make the player actually win!

Add a new step to the list "SetFactionWin"

And select the faction to win.

If you run the game right now, the dialog will be skipped and the victory window will be shown right away. We would rather want to see victory after replica. So, just select "waitAllReplicasShown" and put a check into the box.

It's done, now everything should work.

And then will be shown

Victory!