Changes for page Mission Director Guide

Last modified by Klaus Meyer on 2025/03/31 16:39

From version 32960.1
edited by Daniel Turner
on 2023/08/24 09:46
Change comment: There is no comment for this version
To version 32961.1
edited by Daniel Turner
on 2023/08/24 10:01
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -217,11 +217,11 @@
217 217  {{/code}}
218 218  
219 219  {{info}}
220 -Messages printed with <debug_text> are usually only visible when the "scripts" debug filter is enabled, see Script debug output
220 +Messages printed with <debug_text> are usually only visible when the "scripts" debug filter is enabled, see [[Script debug output>>doc:||anchor="HScriptdebugoutput"]]
221 221  {{/info}}
222 222  
223 +Script debug output
223 223  
224 -
225 225  Each child action in a <do_any> node can have a //**weight**// attribute, which can be used to control the random selection of an action node. The default weight of a child node is 1.
226 226  
227 227  Also available is **<do_if>**, which completes the enclosed action(s) only if one provided value is non-null or matches another. Directly after a <do_if> node, you can add one or more **<do_elseif>** nodes to perform additional checks only in case the previous conditions were not met. The node **<do_else>** can be used directly after a <do_if> or a <do_elseif>. It is executed only if none of the conditions are met.
... ... @@ -239,7 +239,6 @@
239 239  {{/info}}
240 240  
241 241  
242 -
243 243  Library cues are written like normal cues, they are also defined in a <cues> node, just with the difference that the XML tag is called library instead of cue:
244 244  
245 245  {{code language="xml"}}
... ... @@ -290,11 +290,9 @@
290 290  {{/code}}
291 291  
292 292  {{warning}}
293 -These examples are definitely <u>not</u> examples of good scripting style.
292 +These examples are definitely **__not__ **examples of good scripting style.
294 294  {{/warning}}
295 295  
296 -
297 -
298 298  So when writing the library, you don't have to worry about name confusion, just use the names of cues in your library and it will work as expected when the library is used. Names of cues that do not belong to the library will not be available in expressions (see Foo in the example above), however, names of other libraries in the file are available when referencing them in the ref attribute.
299 299  
300 300  Notes:
... ... @@ -364,8 +364,6 @@
364 364  This sub-section requires basic knowledge of script expressions.
365 365  {{/info}}
366 366  
367 -
368 -
369 369  In case of instances with sub-instances, you will often want to access a related instance from the current one. Like in the non-instance case, you can simply write the cue name in an expression to reference that cue. However, you should be aware of the pitfalls that are accompanied by this.
370 370  
371 371  When you use a cue name from the same script in an expression, it will always be resolved to some cue - usually a static cue, even if it is still in the disabled state, but it can also be an instance, if it is "related" to the current one.
... ... @@ -401,7 +401,7 @@
401 401  
402 402  * **Conditions with results:** If the instantiating cue has conditions with results, those results are stored in variables - but in the variables of the static cue, not of the instance! So in the <actions> you have to access the variables via the **static **keyword:
403 403  
404 -{{code language="xml"}} <debug_text text="static.$foo"/>{{/code}}
399 +{{code language="xml"}}<debug_text text="static.$foo"/>{{/code}}
405 405  It may even be necessary to copy the variables over to the instance because the static variables can be overwritten by the next condition check:
406 406  {{code language="xml"}}<set_value name="$foo" exact="static.$foo"/>{{/code}}
407 407  
... ... @@ -501,10 +501,10 @@
501 501  |true|constant|{{code language="xml"}}null == 0{{/code}}|{{code language="xml"}}true{{/code}}|Integer value 1, useful in Boolean expressions
502 502  |pi|constant|{{code language="xml"}}2 * pi{{/code}}|{{code language="xml"}}6.2831853rad{{/code}}|╧Ç as an angle (same as 180deg)
503 503  |()|delimiter|{{code language="xml"}}(2 + 4) * (6 + 1){{/code}}|{{code language="xml"}}42{{/code}}|Parentheses for arithmetic grouping
504 -|[]|delimiter|{{code language="xml"}}[1, 2, 2+1, 'string']{{/code}}|{{code language="xml"}}[1, 2, 3, 'string']{{/code}}|[[List>>MediaWiki.NULL]] of values
505 -|table[]|delimiter|{{code language="xml"}}table[$foo='bar', {1+1}=40+2]{{/code}}|{{code language="xml"}}table[$foo='bar', {2}=42]{{/code}}|[[Table>>MediaWiki.NULL]] of values
499 +|[]|delimiter|{{code language="xml"}}[1, 2, 2+1, 'string']{{/code}}|{{code language="xml"}}[1, 2, 3, 'string']{{/code}}|[[List>>doc:||anchor="HLists" style="outline-width: 0px !important; user-select: auto !important;"]] of values
500 +|table[]|delimiter|{{code language="xml"}}table[$foo='bar', {1+1}=40+2]{{/code}}|{{code language="xml"}}table[$foo='bar', {2}=42]{{/code}}|[[Table>>doc:||anchor="HTables" style="outline-width: 0px !important; user-select: auto !important;"]] of values
506 506  |{}|delimiter|{{code language="xml"}}{101, 3}{{/code}}|{{code language="xml"}}'Some text'{{/code}}|Text lookup (page ID and text ID) from TextDB
507 -\\(Note: Braces are also used for [[property lookups>>MediaWiki.NULL]])
502 +\\(Note: Braces are also used for [[property lookups>>doc:||anchor="HValueproperties" style="outline-width: 0px !important; user-select: auto !important;"]])
508 508  |+|unary|{{code language="xml"}}+21 * (+2){{/code}}|{{code language="xml"}}42{{/code}}|Denotes positive number (no effect)
509 509  |-|unary|{{code language="xml"}}-(21 * -2){{/code}}|{{code language="xml"}}42{{/code}}|Negates the following number
510 510  |not|unary|{{code language="xml"}}not (21 == 42){{/code}}|{{code language="xml"}}true{{/code}}|Yields true if the following expression is false (equal to zero), false otherwise