Difference between revisions of "Conditions and actions"

From Gladiabots Wiki
Jump to: navigation, search
Line 16: Line 16:
 
|valign="top" rowspan="2"|3.||{{C}} colspan="2"|'''Select the best entity''' according to the <code>target selector</code>.
 
|valign="top" rowspan="2"|3.||{{C}} colspan="2"|'''Select the best entity''' according to the <code>target selector</code>.
 
|-
 
|-
|The <code>any</code> and <code>all</code> selectors are special cases where all remaining entities are selected in step 3.
+
|The <code>any</code> and <code>all</code> selectors are special cases where all remaining entities are selected instead.
 
|The <code>any</code> and <code>all</code> selectors are not allowed for action targeting.
 
|The <code>any</code> and <code>all</code> selectors are not allowed for action targeting.
 
|-
 
|-
Line 33: Line 33:
  
 
{{Warning|The rest of the page is a work in progress.}}
 
{{Warning|The rest of the page is a work in progress.}}
 
  
 
=== Thoughts to include into this page ===
 
=== Thoughts to include into this page ===
 
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 <i>not</i> executing the action mentioned in the Condition.
 
  
 
* [https://forum.gladiabots.com/viewtopic.php?f=22&t=126&p=1087#p1087 explanation of conditions and, similarly, actions]
 
* [https://forum.gladiabots.com/viewtopic.php?f=22&t=126&p=1087#p1087 explanation of conditions and, similarly, actions]
Line 48: Line 42:
 
* [https://forum.gladiabots.com/viewtopic.php?f=8&t=582 more info about filters introduced in alpha 7 and the OR /AND part]
 
* [https://forum.gladiabots.com/viewtopic.php?f=8&t=582 more info about filters introduced in alpha 7 and the OR /AND part]
 
* [https://forum.gladiabots.com/viewtopic.php?f=8&t=815 more info about OR/AND between filter categories]
 
* [https://forum.gladiabots.com/viewtopic.php?f=8&t=815 more info about OR/AND between filter categories]
 +
 
<!--
 
<!--
Both action and condition nodes
+
 
 +
What a selector selects if there are several possibilities of equal value.
 +
Visual example of 5 bots, 2 get filtered, one is selected, the condition is false, although another bot fits this condition.
 +
OR and AND between filters
 +
Lists of Actions per Target Type
 +
Lists of Selectors per Target Type
 +
Lists of Filters per Target Type
 +
the [Invert] check box makes the Condition evaluate True if the filtered Target is <i>not</i> executing the action mentioned in the Condition.
 +
 
 
-->
 
-->

Revision as of 02:45, 28 October 2017

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

Basics

A target can be shared between action and condition nodes.

Both condition nodes and action nodes are mainly defined by a target and share almost the same evaluation process:

Step Condition node Action node
1. Get all the entities of the target type.
2. Remove all entities not matching the target filters. If there is not a single entity left the node is considered invalid.
3. Select the best entity according to the target selector.
The any and all selectors are special cases where all remaining entities are selected instead. The any and all selectors are not allowed for action targeting.
4. Check the condition on the remaining entity. Execute the action upon the remaining entity.
Any selector: Check if the condition is valid for at least one of the entities.
All selector: Check if the condition is valid for all of the entities.
Information.png Condition nodes: Checking the condition is the very last step after filtering and selecting took place.
Warning.png The rest of the page is a work in progress.

Thoughts to include into this page