Changes for page Mission Director Guide

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

From version 32959.1
edited by Daniel Turner
on 2023/08/22 19:12
Change comment: There is no comment for this version
To version 32957.1
edited by Daniel Turner
on 2023/08/22 19:09
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -84,6 +84,7 @@
84 84  * **Waiting**: Either this is a root cue, or the parent has become active. The cue is checking its conditions and will become active when they are met.
85 85  * **Active**: The cue is about to perform the actions. Child cues have entered the waiting state.
86 86  
87 +
87 87  * **Complete**: The cue has finished performing its actions.
88 88  * **Cancelled**: The cue has been cancelled. This state cannot normally be reached but only if a cue actively cancels itself or another cue. No condition checks or actions are performed in this cue or any sub-(sub-)cue.
89 89  
... ... @@ -155,6 +155,7 @@
155 155  
156 156  * Use //onfail// if the conditions should be checked only once. The possible attribute values are "//cancel//" and "//complete//". If the conditions are met, the cue will activate and perform the cue actions. Otherwise it's a failure and the cue will be cancelled or completed, based on the onfail attribute. Typically //onfail="cancel"// is used to prevent any further action. //onfail="complete"// can be used to continue with the sub-cues even in case of failure (but skipping the current cue actions).
157 157  
159 +
158 158  * With //checkinterval//, you can specify a constant time interval between condition checks. The conditions will be checked regularly forever until they are met, unless the cue's state is changed explicitly by an external event.
159 159  
160 160  Additionally, you can use the attribute **checktime** to set the time of the first condition check (also possible in combination with //onfail//). The //checktime// can be an expression with variables and is evaluated when the cue is enabled (when the condition checks would normally start ΓÇô for root cues that happens at game start, otherwise after the parent cue becomes active).
... ... @@ -561,6 +561,7 @@
561 561  {{code language="xml"}}1 ge 3{{/code}}
562 562  \\{{code language="xml"}}1 <= 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than or equal to
563 563  |(((
566 += =
564 564  )))|binary|{{code language="xml"}}1 + 1 == 2.0{{/code}}|{{code language="xml"}}true{{/code}}|Equal to
565 565  |~!=|binary|{{code language="xml"}}1 + 1 != 2.0{{/code}}|{{code language="xml"}}false{{/code}}|Not equal to
566 566  |and|binary|{{code language="xml"}}true and false{{/code}}|{{code language="xml"}}false{{/code}}|Logical AND (short-circuit semantics)
... ... @@ -574,6 +574,7 @@
574 574  \\{{code language="xml"}}'T'{{/code}}|Conditional operator ("inline if")
575 575  )))
576 576  
580 +
577 577  === Operator precedence rules ===
578 578  
579 579  You can group sub-expressions using parentheses, but if you don't, the following order of operations is applied, so that 5-1+2*3 == 10 as you would expect. The order is the same as in the table above, but there are operators with the same precedence - these are applied from left to right.
... ... @@ -588,6 +588,7 @@
588 588  * or
589 589  * if/then/else (lowest precedence)
590 590  
595 +
591 591  === Type conversion ===
592 592  
593 593  When a binary arithmetic operator is used on numbers of different types, they will be converted to a suitable output type. The resulting type depends on whether a unit data type is involved (types that are not plain integers or floats). The following cases may occur:
... ... @@ -629,6 +629,7 @@
629 629  * Unlike != and ==, the comparison operators <, <=, >, >= are only supported **for numeric values**, **difficulty levels**, and **attention levels**. Comparing other non-numeric values will result in an error and an undefined result.
630 630  * <, <=, >, >= cannot be used in XML directly, so lt, le, gt, ge are provided as alternatives. In some cases you won't have to use them, though - using [[range checks>>MediaWiki.NULL]] with additional XML attributes can be more readable.
631 631  
637 +
632 632  (% id="categorybroken_macroanchorstrings-and-formatting" %)== Strings and formatting==
633 633  
634 634  
... ... @@ -692,16 +692,19 @@
692 692  * null cannot be used as table key (but the number 0 is valid)
693 693  * Lists, tables, groups and buildplans cannot be used as table keys
694 694  
701 +
695 695  These restrictions only apply to the keys, there are no restrictions for values that you assign to them. For example:
696 696  
697 697  * {{code language="xml"}}table[]{{/code}} ⟹ creates an empty table
698 698  * {{code language="xml"}}table[{0} = null]{{/code}} ⟹ creates a table that maps the number 0 to null
699 699  
707 +
700 700  * {{code language="xml"}}table[{'$foo'} = 'bar']{{/code}} ⟹ a table that maps the string '$foo' to the string 'bar'
701 701  * {{code language="xml"}}table[$foo = 'bar']{{/code}} ⟹ exactly the same, just a shorter notation for string keys
702 702  * {{code language="xml"}}table[foo = 'bar']{{/code}} ⟹ error, 'foo' does not start with a '$'
703 703  * {{code language="xml"}}table[{1} = [], {2} = table[]] {{/code}} ⟹ a table that maps 1 to an empty list and 2 to an empty table
704 704  
713 +
705 705  Just like lists, tables are stored as references, so it's possible that multiple variables reference the same table (see above).
706 706  
707 707  == Value properties ==
... ... @@ -726,6 +726,7 @@
726 726  * {{code language="xml"}}[].{'count'}{{/code}} ⟹ 0
727 727  * {{code language="xml"}}table[{21} = 42].{21}{{/code}} ⟹ 42
728 728  
738 +
729 729  In most cases the property key is a fixed string, like "name" or "class". You can write this like above:
730 730  
731 731  * {{code language="xml"}}[42].{'count'}{{/code}}
... ... @@ -733,6 +733,7 @@
733 733  * {{code language="xml"}}$ship.{'class'}{{/code}}
734 734  * {{code language="xml"}}table[$foo='bar'].{'$foo'}{{/code}}
735 735  
746 +
736 736  But it is easier just to write the property key without braces, which is equivalent:
737 737  
738 738  * {{code language="xml"}}[0].count{{/code}}
... ... @@ -740,6 +740,7 @@
740 740  * {{code language="xml"}}$ship.class{{/code}}
741 741  * {{code language="xml"}}table[$foo='bar'].$foo{{/code}}
742 742  
754 +
743 743  (In this case, $ship is a variable. All variables start with a "$", so they cannot be confused with keywords.)
744 744  
745 745  A list has even more properties:
... ... @@ -773,6 +773,7 @@
773 773  
774 774  * {{code language="xml"}}$table.keys.list{{/code}}: Yields a list of all keys in the table (reliably sorted by key if all keys are numeric)
775 775  
788 +
776 776  * {{code language="xml"}}$table.keys.sorted{{/code}}: Yields a list of all keys in the table, sorted by their associated values (which requires that all values are numeric)
777 777  * {{code language="xml"}}$table.keys.random{{/code}}: A randomly chosen key (which requires that the table is non-empty)
778 778  
... ... @@ -788,6 +788,7 @@
788 788  * {{code language="xml"}}$list.{5}?{{/code}} ⟹ true if $list exists and has the property 5, false otherwise
789 789  * {{code language="xml"}}$table.$key?{{/code}} ⟹ Analogously, true if $table exists and has the string property '$key'
790 790  
804 +
791 791  The question mark can even be applied to variables:
792 792  
793 793  * {{code language="xml"}}$list{{/code}} ⟹ The value stored under the name $list, or an error if there is no such variable
... ... @@ -876,9 +876,11 @@
876 876  * player.**money**: The money in the player's account
877 877  * player.**ship**: The ship the player is currently on (not necessarily the player's ship), or null if the player is on a station
878 878  
893 +
879 879  * player.**primaryship**: The player's own ship (but the player is not necessarily on board)
880 880  * player.**entity**: The actual player object
881 881  
897 +
882 882  * player.**zone**, player.**sector**, player.**cluster**, player.**galaxy**: Location of the player entity
883 883  * player.**copilot**: The co-pilot NPC
884 884  
... ... @@ -905,6 +905,7 @@
905 905  * {{code language="xml"}}$money.formatted.{'formatstring'}{{/code}}
906 906  * {{code language="xml"}}$money.formatted.default{{/code}} (using default format string '%s')
907 907  
924 +
908 908  * {{code language="xml"}}$time.formatted.{'formatstring'}{{/code}}
909 909  * {{code language="xml"}}$time.formatted.default{{/code}} (using default format string '%T')
910 910  
... ... @@ -928,6 +928,7 @@
928 928  * %Cr: Localised "Cr" string
929 929  * %%: A % sign
930 930  
948 +
931 931  Examples:
932 932  
933 933  * {{code language="xml"}}(1234Cr).formatted.{'%s'}{{/code}}⟹{{code language="xml"}}'1,234'{{/code}}