File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,36 @@ Example:
128
128
val_B = (val_A > 1) ? 42 : 24
129
129
```
130
130
131
+ ## Boolean Values
132
+ Boolean values can be one of ` true ` or ` false `
133
+ and are saved to the blackboard as ` 1 ` and ` 0 ` respectively.
134
+
135
+ Setting booleans:
136
+ ```
137
+ val_A = true
138
+ val_B := !false
139
+ ```
140
+ The logical ` ! ` works with boolean literals.
141
+ ` !false ` is the equivalent of ` true ` .
142
+ ` val_A ` and ` val_B ` above are equivalent.
143
+
144
+ Using booleans:
145
+ ```
146
+ <Precondition if="val_A" else="FAILURE">
147
+ <Precondition if="val_A == true" else="FAILURE">
148
+ <Precondition if="val_A == 1" else="FAILURE">
149
+ ```
150
+ All of the scripts used in precondition nodes above are valid.
151
+
152
+ When evaluating the boolean value, it can be:
153
+ - checked directly,
154
+ - compared with the literals ` true ` and ` false `
155
+ - compared with ` 1 ` and ` 0 ` .
156
+
157
+
158
+ Note that capitalization of the words "true" and "false" in any manner will not work.
159
+
160
+
131
161
## C++ example
132
162
133
163
Demonstration of the scripting language, including how to use enums to
You can’t perform that action at this time.
0 commit comments