Actions

Difference between revisions of "Event Conditions Tutorial"

From Shoot Em Up Kit

 
Line 103: Line 103:
  
 
[[File:EventCondTutorial18.png|link=]]
 
[[File:EventCondTutorial18.png|link=]]
[[File:EventCondTutorial19.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.


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.

EventCondTutorial9.png


The Event Condition definition should be given a descriptive name. Clicking the OK button will then store it in the definition list.


EventCondTutorial10.png


EventCondTutorial11.png


Adding an Action

Select an Entity and go to the Actions tab.


EventCondTutorial12.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.


EventCondTutorial13.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.


EventCondTutorial14.png


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


EventCondTutorial15.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.


EventCondTutorial16.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.


EventCondTutorial18.png