Difference between revisions of "Conditions and actions"

From Gladiabots Wiki
Jump to: navigation, search
Line 6: Line 6:
  
 
{{Warning|The rest of the page is a work in progress.}}
 
{{Warning|The rest of the page is a work in progress.}}
 +
 +
Conditions and actions share almost the same evaluation process:
 +
 +
Conditions follow these steps:
 +
 +
# get all the entities of the <target type>
 +
# only keep the entities matching the <target filters>
 +
#* if no entity is returned by previous step, condition is considered invalid
 +
# select the best entity according to the <target selector> ("any" is a special case where you keep all the entities from previous step)
 +
# check the condition on the remaining entity(ies) (for "any" selector, node is valid if the condition is valid on at least one of the entities)
 +
 +
Actions follow these steps:
 +
 +
# get all the entities of the <target type>
 +
# only keep the entities matching the <target filters>
 +
#* if no entity is returned by previous step, action is considered invalid
 +
# select the best entity according to the <target selector> ("any" is not allowed for action targeting)
 +
# if action is possible, execute it
 +
 +
{{Information|Filters are actually applied '''before''' checking the condition.}}
  
 
=== Thoughts to include into this page ===
 
=== Thoughts to include into this page ===

Revision as of 08:09, 26 October 2017

Information.png This page needs improvement, you are welcome to contribute.

Basics

A target can be shared between action and condition nodes.
Warning.png The rest of the page is a work in progress.

Conditions and actions share almost the same evaluation process:

Conditions follow these steps:

  1. get all the entities of the <target type>
  2. only keep the entities matching the <target filters>
    • if no entity is returned by previous step, condition is considered invalid
  3. select the best entity according to the <target selector> ("any" is a special case where you keep all the entities from previous step)
  4. check the condition on the remaining entity(ies) (for "any" selector, node is valid if the condition is valid on at least one of the entities)

Actions follow these steps:

  1. get all the entities of the <target type>
  2. only keep the entities matching the <target filters>
    • if no entity is returned by previous step, action is considered invalid
  3. select the best entity according to the <target selector> ("any" is not allowed for action targeting)
  4. if action is possible, execute it
Information.png Filters are actually applied before checking the condition.

Thoughts to include into this page

Conditions are in syntax Target(Filters)-Condition(Evaluation)

Target - The type of Gladiabots Entity (Ally, Enemy, AllyBase, EnemyBase, Resource) to be checked Filters - Criteria that the target has to meet Condition - Action that the Target is executing Evaluation - Checking the [Invert] check box makes the Condition evaluate True if the filtered Target is not executing the action mentioned in the Condition.