Difference between revisions of "Action System"

From The Official Visionaire Studio: Adventure Game Engine Wiki
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The action system is what we use to create the various actions & events that will be performed during the game on characters, self, scene objects, & items. The available [[Actionparts|action parts]] may vary depending on where the action is created; scene, scene object, character, item, interface, interface button, game etc.
+
[[File:Action System.png|thumb|300px|Setting up an action]]
 +
The action system is what we use to create the various actions & events that will be performed during the game on characters, self, scene objects, & items. Whenever something "happens" in your game apart from the character just walking around, it is most likely implemented through an action.
  
 +
Every <span class="inlinecode">action</span> consists of a list of <span class="inlinecode">action parts</span> which is processed from top to bottom once the action gets executed. You can choose from [[Action Parts|an extensive list of action parts]] covering all aspects of the game (show a text, start an animation, send the character to a certain position, play a sound etc.).
  
== Action Types ==
+
By defining its <span class="inlinecode">execution type</span>, you tell the engine which event shall trigger the action. Provided you develop a classic adventure game, it's the application of a game command (e.g. "Use", "Look") in most cases, but it can also be a double-click, mouse movement, dropping an item etc. All available execution types are listed below. Some actions don't offer the selection of execution type, because their execution event is otherwise defined (start action, global mouse actions, actions in dialogs etc.).
Here is a list of available action types, a description & where they can be used.
 
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
 
<span class="bold">Additional Info</span>
 
<div class="mw-collapsible-content">
 
<div>The '''Called by other action''' action is a special case as it is not directly tied to any object, scene, character, or interface button etc, as it can be called anywhere, at any time via the '''call/quit action''' action part.</div>
 
</div></div><br/>
 
  
 +
There is no central location in the editor for managing all game actions. Actions are usually tied to the object to which they belong. ''Wanna look at a chest? – Add an action to your chest object with execution type 'Command Look on object'.'' The only exception are actions with execution type "Called by other action" which can be created wherever you like. These are also the only actions you can name individually.
 +
 +
 +
 +
== Execution Types ==
 +
Here is a list of the possible execution types, a description and where they can be used. Which types are available depends on where the action is created.
  
  
 
=== Execution at destination ===
 
=== Execution at destination ===
{| class="tbl-ds"
+
{| class="ts"
|- align="left" style="background-color:#cccccc"
+
|-
! style="border-bottom: 1px dashed grey" | Type !! style="border-bottom: 1px dashed grey" | Description !! style="border-bottom: 1px dashed grey" | Available Location(s)
+
! Type !! Description !! Available Location(s)
 
|-
 
|-
| '''Executed command on object''' || actions will only be performed if the current character reaches the object destination & if the ''executed command'' is listed inside of the object actions. || scene objects, characters
+
| '''Executed command (on object/character)''' || The action will be executed when the current character reaches the action object position after the user applied the given '''Command''' on the object. If it's a [[Interfaces#Combined_commands_vs._dragging_items|combined command]], you have to set the '''Item''' you want to combine with the object. If the user stops the character before reaching the destination, the action will not be performed. || scene objects, characters
 
|-
 
|-
| '''Item dropped''' || actions will only be executed if the current character reaches the object destination & the ''dropped item'' action is listed inside of the object actions. || scene objects, characters
+
| '''Item dropped''' || The action will be executed when the current character reaches the action object position after the user dropped the given '''Item''' on the object. If the user stops the character before reaching the destination, the action will not be performed. || scene objects, characters
 
|-
 
|-
| '''Double click''' || actions will only be executed if the current character reaches the object destination & the ''double click'' action is listed inside of the object actions. || scene objects, characters
+
| '''Double click''' || The action will be executed when the current character reaches the action object position after the user double-clicked on the object. If the user stops the character before reaching the destination, the action will not be performed. || scene objects, characters
 
|-
 
|-
| '''Button hold''' || actions will only be executed if the current character reaches the object destination & the ''button hold'' action is listed inside of the object actions; see [[Game_Tab#Mouse_Properties|mouse properties]]. || scene objects, characters
+
| '''Button hold''' || The action will be executed when the current character reaches the action object position after the user left-clicked on the object and held the mouse button for a certain amount of time (as defined in the [[Game Properties#Mouse_properties|mouse properties]]). If the user stops the character before reaching the destination, the action will not be performed. || scene objects, characters
 
|-
 
|-
| '''Right click''' || actions will only be executed if the current character reaches the object destination & the ''right click'' action is listed inside of the object actions. || scene objects, characters
+
| '''Right click''' || The action will be executed when the current character reaches the action object position after the user right-clicked on the object. If the user stops the character before reaching the destination, the action will not be performed. || scene objects, characters
 +
|-
 +
| '''Middle click''' || The action will be executed when the current character reaches the action object position after the user middle-clicked on the object. If the user stops the character before reaching the destination, the action will not be performed. || scene objects, characters
 
|}
 
|}
  
Line 31: Line 35:
  
 
=== Immediate execution ===
 
=== Immediate execution ===
{| class="tbl-ds"
+
{| class="ts"
|- align="left" style="background-color:#cccccc"
 
! style="border-bottom: 1px dashed grey" | Type !! style="border-bottom: 1px dashed grey" | Description !! style="border-bottom: 1px dashed grey" | Available Location(s)
 
 
|-
 
|-
| '''Executed command on object''' || actions will be executed immediately if the ''executed command (immediate)'' is listed inside of the objects actions. || all action tabs
+
! Type !! Description !! Available Location(s)
 
|-
 
|-
| '''Item dropped''' || actions will be executed immediately if the ''dropped item (immediate)'' action is listed inside of the object actions. || all action tabs
+
| '''Executed command (on object/character)''' || The action will be executed immediately when the user applies the given '''Command''' on the action object. If it's a [[Interfaces#Combined_commands_vs._dragging_items|combined command]], you have to set the '''Item''' you want to combine with the object. || all action tabs
 
|-
 
|-
| '''Double click''' || actions will only be executed if the current character reaches the object destination & the ''double click'' action is listed inside of the object actions. || all action tabs
+
| '''Executed command <->''' || The action will be executed immediately when the user combines two items through the given '''Command''' (which has to be a [[Interfaces#Combined_commands_vs._dragging_items|combined command]]). It works in both directions: using item A on item B and vice versa. || items
 
|-
 
|-
| '''Button hold''' || actions will only be executed if the current character reaches the object destination & the ''button hold'' action is listed inside of the object actions; see [[Game_Tab#Mouse_Properties|mouse properties]]. || all action tabs
+
| '''Executed command ->''' || The action will be executed immediately when the user combines two items through the given '''Command''' (which has to be a [[Interfaces#Combined_commands_vs._dragging_items|combined command]]). It works opposite to '''Executed command''': instead of using the given item on the action object, the action is performed when using the action object on the given item. || items
 
|-
 
|-
| '''Right click''' || actions will only be executed if the current character reaches the object destination & the ''right click'' action is listed inside of the object actions. || all action tabs
+
| '''Item dropped''' || The action will be executed immediately when the user drops the given '''Item''' on the action object. || all action tabs
 
|-
 
|-
| '''Cursor enters object area''' || actions will be executed when the mouse cursor enters the object area; providing the ''on cursor enters'' action is listed in the objects actions. || all action tabs
+
| '''Item dropped <->''' || The action will be executed when the user drops the given '''Item''' on the action object or vice versa. || items
 
|-
 
|-
| '''Cursor leaves object area''' || actions will be executed when the mouse cursor leaves the object area; providing the ''on cursor leaves'' action is listed in the objects actions. || all action tabs
+
| '''Item dropped ->''' || The action will be executed when the user drops the action object on the given '''Item''', so it works opposite to '''Item dropped'''. || items
 
|-
 
|-
| '''Called by other action''' || this action is not directly associated with the object & can be called at any time via the '''call/quit action''' action part. || all action tabs
+
| '''Left click''' || The action will be executed immediately when the user left-clicks on the action object. || scene objects, characters
|}
+
|-
 
+
| '''Double click''' || The action will be executed immediately when the user double-clicks on the action object. || all action tabs
 
 
== Locations ==
 
These actions belong to specific sections of the Visionaire Studio editor.
 
 
 
 
 
=== Scene ===
 
The commands listed below are exclusive to the ''scene actions'' tab.
 
 
 
 
 
{| class="tbl-ds"
 
|- align="left" style="background-color:#cccccc"
 
! style="border-bottom: 1px dashed grey" | Type !! style="border-bottom: 1px dashed grey" | Description
 
 
|-
 
|-
| '''At beginning of scene''' || action parts listed here will be performed on scene load.
+
| '''Button hold''' || The action will be executed immediately when the user left-clicks on the action object and holds the mouse button for a certain amount of time (as defined in the [[Game Properties#Mouse_properties|mouse properties]]). || all action tabs
 
|-
 
|-
| '''At end of scene''' || action parts listed here will be performed on scene close.
+
| '''Right click''' || The action will be executed immediately when the user right-clicks on the action object. || all action tabs
|}
 
 
 
 
 
=== Items ===
 
The items commands are very similar to the general ''execution at destination'', & ''immediate execution'' commands. Because the current character already has the items in their inventory, the commands require no distinction between commands ''executed at destination'', or commands ''executed immediately''.
 
 
 
 
 
==== Execution at destination ====
 
{| class="tbl-ds"
 
|- align="left" style="background-color:#cccccc"
 
! style="border-bottom: 1px dashed grey" | Type !! style="border-bottom: 1px dashed grey" | Description !! style="border-bottom: 1px dashed grey" | Available Location(s)
 
 
|-
 
|-
| '''Executed command on object''' || actions will only be performed if the current character reaches the object destination & if the ''executed command'' is listed inside of the object actions. || scene objects, characters
+
| '''Middle click''' || The action will be executed immediately when the user middle-clicks on the action object. || all action tabs
 
|-
 
|-
| '''Item dropped''' || actions will only be executed if the current character reaches the object destination & the ''dropped item'' action is listed inside of the object actions. || scene objects, characters
+
| '''Cursor enters object area''' || The action will be executed when the mouse cursor enters the object area. || all action tabs
 
|-
 
|-
| '''Double click''' || actions will only be executed if the current character reaches the object destination & the ''double click'' action is listed inside of the object actions. || scene objects, characters
+
| '''Cursor leaves object area''' || The action will be executed when the mouse cursor leaves the object area. || all action tabs
 
|-
 
|-
| '''Button hold''' || actions will only be executed if the current character reaches the object destination & the ''button hold'' action is listed inside of the object actions; see [[Game_Tab#Mouse_Properties|mouse properties]]. || scene objects, characters
+
| '''Mouse wheel up''' || The action will be executed when the user scrolls the mouse wheel up while hovering over the action object. || all action tabs
 
|-
 
|-
| '''Right click''' || actions will only be executed if the current character reaches the object destination & the ''right click'' action is listed inside of the object actions. || scene objects, characters
+
| '''Mouse wheel down''' || The action will be executed when the user scrolls the mouse wheel down while hovering over the action object. || all action tabs
 
|}
 
|}
  
  
  
==== Immediate execution ====
+
=== Other ===
{| class="tbl-ds"
+
{| class="ts"
|- align="left" style="background-color:#cccccc"
 
! style="border-bottom: 1px dashed grey" | Type !! style="border-bottom: 1px dashed grey" | Description !! style="border-bottom: 1px dashed grey" | Available Location(s)
 
 
|-
 
|-
| '''Executed command on object''' || actions will be executed immediately if the ''executed command (immediate)'' is listed inside of the objects actions. || all action tabs
+
! Type !! Description !! Available Location(s)
 
|-
 
|-
| '''Item dropped''' || actions will be executed immediately if the ''dropped item (immediate)'' action is listed inside of the object actions. || all action tabs
+
| '''At beginning of scene''' || The action will be executed on scene load. || scenes
 
|-
 
|-
| '''Double click''' || actions will only be executed if the current character reaches the object destination & the ''double click'' action is listed inside of the object actions. || all action tabs
+
| '''At end of scene''' || The action will be executed on scene close. || scenes
 
|-
 
|-
| '''Button hold''' || actions will only be executed if the current character reaches the object destination & the ''button hold'' action is listed inside of the object actions; see [[Game_Tab#Mouse_Properties|mouse properties]]. || all action tabs
+
| '''Called by other action''' || An action with this execution type is not directly associated with the object. It can be created anywhere and be called at any time via the [[Action Parts#Call.2FQuit_action|call/quit action]] action part. || all action tabs
 
|-
 
|-
| '''Right click''' || actions will only be executed if the current character reaches the object destination & the ''right click'' action is listed inside of the object actions. || all action tabs
+
| '''Character enters area''' || The action will be executed when a character enters the action area. || action areas (scenes)
 
|-
 
|-
| '''Cursor enters object area''' || actions will be executed when the mouse cursor enters the object area; providing the ''on cursor enters'' action is listed in the objects actions. || all action tabs
+
| '''Character leaves area''' || The action will be executed when a character leaves the action area. || action areas (scenes)
|-
 
| '''Cursor leaves object area''' || actions will be executed when the mouse cursor leaves the object area; providing the ''on cursor leaves'' action is listed in the objects actions. || all action tabs
 
|-
 
| '''Called by other action''' || this action is not directly associated with the object & can be called at any time via the '''call/quit action''' action part. || all action tabs
 
 
|}
 
|}
 +
 +
{{toc}}

Latest revision as of 13:24, 28 January 2023

Setting up an action

The action system is what we use to create the various actions & events that will be performed during the game on characters, self, scene objects, & items. Whenever something "happens" in your game apart from the character just walking around, it is most likely implemented through an action.

Every action consists of a list of action parts which is processed from top to bottom once the action gets executed. You can choose from an extensive list of action parts covering all aspects of the game (show a text, start an animation, send the character to a certain position, play a sound etc.).

By defining its execution type, you tell the engine which event shall trigger the action. Provided you develop a classic adventure game, it's the application of a game command (e.g. "Use", "Look") in most cases, but it can also be a double-click, mouse movement, dropping an item etc. All available execution types are listed below. Some actions don't offer the selection of execution type, because their execution event is otherwise defined (start action, global mouse actions, actions in dialogs etc.).

There is no central location in the editor for managing all game actions. Actions are usually tied to the object to which they belong. Wanna look at a chest? – Add an action to your chest object with execution type 'Command Look on object'. The only exception are actions with execution type "Called by other action" which can be created wherever you like. These are also the only actions you can name individually.


Execution Types

Here is a list of the possible execution types, a description and where they can be used. Which types are available depends on where the action is created.


Execution at destination

Type Description Available Location(s)
Executed command (on object/character) The action will be executed when the current character reaches the action object position after the user applied the given Command on the object. If it's a combined command, you have to set the Item you want to combine with the object. If the user stops the character before reaching the destination, the action will not be performed. scene objects, characters
Item dropped The action will be executed when the current character reaches the action object position after the user dropped the given Item on the object. If the user stops the character before reaching the destination, the action will not be performed. scene objects, characters
Double click The action will be executed when the current character reaches the action object position after the user double-clicked on the object. If the user stops the character before reaching the destination, the action will not be performed. scene objects, characters
Button hold The action will be executed when the current character reaches the action object position after the user left-clicked on the object and held the mouse button for a certain amount of time (as defined in the mouse properties). If the user stops the character before reaching the destination, the action will not be performed. scene objects, characters
Right click The action will be executed when the current character reaches the action object position after the user right-clicked on the object. If the user stops the character before reaching the destination, the action will not be performed. scene objects, characters
Middle click The action will be executed when the current character reaches the action object position after the user middle-clicked on the object. If the user stops the character before reaching the destination, the action will not be performed. scene objects, characters


Immediate execution

Type Description Available Location(s)
Executed command (on object/character) The action will be executed immediately when the user applies the given Command on the action object. If it's a combined command, you have to set the Item you want to combine with the object. all action tabs
Executed command <-> The action will be executed immediately when the user combines two items through the given Command (which has to be a combined command). It works in both directions: using item A on item B and vice versa. items
Executed command -> The action will be executed immediately when the user combines two items through the given Command (which has to be a combined command). It works opposite to Executed command: instead of using the given item on the action object, the action is performed when using the action object on the given item. items
Item dropped The action will be executed immediately when the user drops the given Item on the action object. all action tabs
Item dropped <-> The action will be executed when the user drops the given Item on the action object or vice versa. items
Item dropped -> The action will be executed when the user drops the action object on the given Item, so it works opposite to Item dropped. items
Left click The action will be executed immediately when the user left-clicks on the action object. scene objects, characters
Double click The action will be executed immediately when the user double-clicks on the action object. all action tabs
Button hold The action will be executed immediately when the user left-clicks on the action object and holds the mouse button for a certain amount of time (as defined in the mouse properties). all action tabs
Right click The action will be executed immediately when the user right-clicks on the action object. all action tabs
Middle click The action will be executed immediately when the user middle-clicks on the action object. all action tabs
Cursor enters object area The action will be executed when the mouse cursor enters the object area. all action tabs
Cursor leaves object area The action will be executed when the mouse cursor leaves the object area. all action tabs
Mouse wheel up The action will be executed when the user scrolls the mouse wheel up while hovering over the action object. all action tabs
Mouse wheel down The action will be executed when the user scrolls the mouse wheel down while hovering over the action object. all action tabs


Other

Type Description Available Location(s)
At beginning of scene The action will be executed on scene load. scenes
At end of scene The action will be executed on scene close. scenes
Called by other action An action with this execution type is not directly associated with the object. It can be created anywhere and be called at any time via the call/quit action action part. all action tabs
Character enters area The action will be executed when a character enters the action area. action areas (scenes)
Character leaves area The action will be executed when a character leaves the action area. action areas (scenes)