Changes for page Mission Director Guide

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

From version 32978.1
edited by Heinrich Unrau
on 2024/10/17 13:53
Change comment: There is no comment for this version
To version 32984.1
edited by Klaus Meyer
on 2025/03/31 16:39
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.Heinrich
1 +xwiki:XWiki.Klaus
Content
... ... @@ -220,8 +220,6 @@
220 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
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.
... ... @@ -228,8 +228,11 @@
228 228  
229 229  **<do_while>** also exists, but should be used carefully, since it is the only action that could cause an infinite loop, which freezes the game without any chance of recovery.
230 230  
231 -Every action can have a //**chance**// attribute, if you only want it to be performed with that chance, given as percentage. Otherwise it will simply be skipped. If chance is used on a conditional action such as <do_if>, the script will behave as if the condition check failed.
229 +Every action can have a //**chance**// attribute, if you only want it to be performed with that chance, given as percentage. Otherwise it will simply be skipped.
232 232  
231 +* If chance is used on a conditional action such as <do_if>, the script will behave as if the condition check failed.
232 +* If chance is provided on an action within a <do_any>, it will have no effect on the random selection of the action. Only when the action gets selected, the chance will determine whether the action actually gets performed or skipped.
233 +
233 233  = Libraries =
234 234  
235 235  Libraries are cues which are not created directly but only serve as templates for other cues. This allows for modularisation, so you can re-use library cues in many different missions.
... ... @@ -569,24 +569,20 @@
569 569  |-|binary|{{code language="xml"}}1 - 1{{/code}}|{{code language="xml"}}0{{/code}}|Subtraction
570 570  |
571 571  lt
572 -\\< (<)|binary|
573 -{{code language="xml"}}1 lt 3{{/code}}
574 -\\{{code language="xml"}}1 < 3{{/code}}|{{code language="xml"}}true{{/code}}|Less than
573 +\\&lt; (<)|binary|
574 +{{code language="xml"}}1 lt 3{{/code}}|{{code language="xml"}}true{{/code}}|Less than
575 575  |
576 576  le
577 -\\<=|binary|
578 -{{code language="xml"}}1 le 3{{/code}}
579 -\\{{code language="xml"}}1 <= 3{{/code}}|{{code language="xml"}}true{{/code}}|Less than or equal to
577 +\\&lt;=|binary|
578 +{{code language="xml"}}1 le 3{{/code}}|{{code language="xml"}}true{{/code}}|Less than or equal to
580 580  |
581 581  gt
582 -\\> (>)|binary|
583 -{{code language="xml"}}1 gt 3{{/code}}
584 -\\{{code language="xml"}}1 > 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than
581 +\\&gt; (>)|binary|
582 +{{code language="xml"}}1 gt 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than
585 585  |
586 586  ge
587 -\\>=|binary|
588 -{{code language="xml"}}1 ge 3{{/code}}
589 -\\{{code language="xml"}}1 >= 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than or equal to
585 +\\&gt;=|binary|
586 +{{code language="xml"}}1 ge 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than or equal to
590 590  |(((
591 591  
592 592  )))|binary|{{code language="xml"}}1 + 1 == 2.0{{/code}}|{{code language="xml"}}true{{/code}}|Equal to
... ... @@ -715,7 +715,7 @@
715 715  
716 716  * Strings must start with '$', like variables
717 717  * null cannot be used as table key (but the number 0 is valid)
718 -* Lists, tables, groups and buildplans cannot be used as table keys
715 +* Lists, tables, groups, buildplans, loadouts and constructionsequences cannot be used as table keys
719 719  
720 720  These restrictions only apply to the keys, there are no restrictions for values that you assign to them. For example:
721 721  
... ... @@ -726,6 +726,8 @@
726 726  * {{code language="xml"}}table[$foo = 'bar']{{/code}}⟹ exactly the same, just a shorter notation for string keys
727 727  * {{code language="xml"}}table[foo = 'bar']{{/code}}⟹ error, 'foo' does not start with a '$'
728 728  * {{code language="xml"}}table[{1} = [], {2} = table[]] {{/code}}⟹ a table that maps 1 to an empty list and 2 to an empty table
726 +* {{code language="xml"}}table[faction.argon = 'bar']{{/code}}⟹ error, the expression faction.argon will not be resolved into a key value. Requires { } braces.
727 +* {{code language="xml"}}table[{faction.argon} = 'bar'] {{/code}}⟹ a table that maps the value faction.argon to the string 'bar'
729 729  
730 730  Just like lists, tables are stored as references, so it's possible that multiple variables reference the same table (see above).
731 731  
... ... @@ -1007,7 +1007,7 @@
1007 1007  
1008 1008  * MD scripts and cues are identified by their names. So a script can only be refreshed if it has the same script name as before (file name is irrelevant).
1009 1009  * If there are new script files or new cue nodes (i.e. scripts/cues with new names) they are created and added properly. If you remove script files or cue nodes, the corresponding scripts/cues are removed from the game, including instances.
1010 -** (!) Pitfall: For savegame compatibility, it is recommendet that released cues are not removed, but instead emptied out and marked as deprecated, to prevent future cues with the same name leading to errors (see example below).
1009 +** (!) Pitfall: It is recommended that cues are not removed if they were previously released in public builds, to prevent future cues with the same name leading to errors (see example below). Instead they can be emptied and marked as deprecated.
1011 1011  * As a consequence, you CANNOT rename scripts or cues if you want to refresh them. Doing so would remove the old script or cue and add a new one with the new name.
1012 1012  * You CANNOT change a <cue> to a <library> or vice versa.
1013 1013  * You CANNOT add, remove, or change the "ref" attribute of a cue. But it is possible to remove the whole cue. (If all references to a library are removed you can also remove the library itself.)