Condition
Condition is the base class for all condition nodes. Thus, if you want to create new custom condition nodes, you need to inherit from this class.
Item Index
Properties
- category
- description
- id
- name
- parameters deprecated
- properties
- title
Methods
_execute
-
tick
This is the main method to propagate the tick signal to this node. This
method calls all callbacks: enter, open, tick, close, and
exit. It only opens a node if it is not already open. In the same
way, this method only close a node if the node returned a status
different of RUNNING.
Parameters:
-
tickTickA tick instance.
Returns:
The tick state.
_tick
-
tick
Wrapper for tick method.
Parameters:
-
tickTickA tick instance.
Returns:
A state constant.
close
-
tick
Close method, override this to use. This method is called after the tick
callback, and only if the tick return a state different from
RUNNING.
Parameters:
-
tickTickA tick instance.
enter
-
tick
Enter method, override this to use. It is called every time a node is asked to execute, before the tick itself.
Parameters:
-
tickTickA tick instance.
exit
-
tick
Exit method, override this to use. Called every time in the end of the execution.
Parameters:
-
tickTickA tick instance.
initialize
()
Initialization method.
open
-
tick
Open method, override this to use. It is called only before the tick callback and only if the not isn't closed.
Note: a node will be closed if it returned RUNNING in the tick.
Parameters:
-
tickTickA tick instance.
tick
-
tick
Tick method, override this to use. This method must contain the real execution of node (perform a task, call children, etc.). It is called every time a node is asked to execute.
Parameters:
-
tickTickA tick instance.
Properties
category
String
Node category. Default to b3.CONDITION.
description
String
Node description.
id
String
Node ID.
name
String
Node name. Must be a unique identifier, preferable the same name of the class. You have to set the node name in the prototype.
parameters
Object
deprecated
A dictionary (key, value) describing the node parameters. Useful for defining parameter values in the visual editor. Note: this is only useful for nodes when loading trees from JSON files.
Deprecated since 0.2.0. This is too similar to the properties
attribute, thus, this attribute is deprecated in favor to
properties.
properties
Object
A dictionary (key, value) describing the node properties. Useful for defining custom variables inside the visual editor.
title
String
Node title.
