Difference between revisions of "Event Conditions Tutorial"
From Shoot Em Up Kit
(2 intermediate revisions by the same user not shown) | |||
Line 102: | Line 102: | ||
− | [[File: | + | [[File:EventCondTutorial18.png|link=]] |
Latest revision as of 19:19, 23 January 2021
Event Conditions can be used to combine events, such as Health < 25% and Taken Damage, which can then be used to trigger Actions.
The Definition Editor is used to create Event Conditions. This allows conditions to be defined once and then used by any Player, NPC or other Entity throughout the game.
To create or edit an Event Condition, select the Event Condition button in the Define window.
To create a new Event Condition, click the Create New option.
A new Event Condition will be created with a single event, which is None.
Click on None to open a list of conditions to select from.
For this example, we will select Control Left (Hold). This event occurs when the player uses their controller to move left and continues to do this action.
Selecting the OK button, or double clicking this option, will select it.
The Event Condition now has a single event which, when it occurs, will trigger an Action. However, we want a combination of events to be required before the Action is triggered. Clicking the Add New Condition button will create a new Event option. It will also give the option of selecting how the two events will be combined. The AND option indicates Event 1 AND Event 2 must occur for the Action to be triggered. The OR option indicates that either Event 1 OR Event 2 occurring will trigger the Action.
Clicking on the None option will display the Select an Event list. Selecting Control Up (Hold) will choose an event that will trigger when the player presses upwards on their controller and holds it in that direction.
We now have an Event Condition with two events that must both occur simultaneously for the Action to be triggered.
The Event Condition definition should be given a descriptive name. Clicking the OK button will then store it in the definition list.
Adding an Action
Select an Entity and go to the Actions tab.
Click the Add Actions button to create a new Action. Once we have our new Action we can either click None to select a single event, or we can click the [+] button to select an Event Condition.
Clicking the [+] button to select an Event Condition will open the Event Condition list and we will see the Event Condition we created earlier.
Select the Event Condition we created earlier and click the OK button.
The Action will now be triggered by our new Event Condition. We can test this by making the Action add 1 to the Player Score each time the condition is met.
Click the Test Game button and move up and left. The score will increase by 1 each time the player holds down the Up and Left controls.