Actions

Difference between revisions of "Event Conditions Tutorial"

From Shoot Em Up Kit

(Created page with "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 t...")
 
Line 1: Line 1:
Event Conditions can be used to combine events, such as Health < 25% and Taken Damage, which can then be used to trigger [[Actions|Actions]].
+
Event Conditions can be used to combine events, such as Health < 25% and Taken Damage, which can then be used to trigger [[Actions Tab|Actions]].
  
  

Revision as of 18:39, 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.


EventCondTutorial1.png


To create a new Event Condition, click the Create New option.


EventCondTutorial2.png


A new Event Condition will be created with a single event, which is None.


EventCondTutorial3.png


Click on None to open a list of conditions to select from.


EventCondTutorial4.png


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.


EventCondTutorial5.png


Selecting the OK button, or double clicking this option, will select it.


EventCondTutorial6.png


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.


EventCondTutorial7.png


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.


EventCondTutorial8.png


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.


EventCondTutorial9.png


EventCondTutorial10.png


Adding an Action

Select an Entity and go to the Actions tab.


EventCondTutorial11.png


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.


EventCondTutorial12.png


Clicking the [+] button to select an Event Condition will open the Event Condition list and we will see the Event Condition we created earlier.


EventCondTutorial13.png


Select the Event Condition we created earlier and click the OK button.


EventCondTutorial14.png


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.


EventCondTutorial15.png


Click the ToolBarTestGame.png 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.


EventCondTutorial16.png