Changes for page Mission Director Guide

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

From version 32970.6
edited by Michael Baumgardt
on 2023/10/27 12:28
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
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.Michael
1 +xwiki:XWiki.Daniel
Content
... ... @@ -157,7 +157,7 @@
157 157  
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 -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).
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).
161 161  
162 162  Examples:
163 163  
... ... @@ -326,7 +326,7 @@
326 326  </cue>
327 327  {{/code}}
328 328  
329 -The values (including default values) can be variable expressions and will be evaluated when the cue is enabled, i.e. when it starts checking the conditions. They will be available to the cue as variables, using the parameter name with a '$' prefix. In the example above, the variables $foo, $bar, and $baz would be created.
329 +The values (including default values) can be variable expressions and will be evaluated when the cue is enabled, i.e. when it starts checking the conditions. They will be available to the cue as variables, using the parameter name with a ΓÇÿ$' prefix. In the example above, the variables $foo, $bar, and $baz would be created.
330 330  
331 331  {{code language="xml"}}
332 332  <library name="Lib">
... ... @@ -417,6 +417,8 @@
417 417  Since octal numbers are hardly ever used (usually unknowingly), the parser is will produce a warning if an octal number is encountered."
418 418  {{/info}}
419 419  
420 +
421 +
420 420  You can write string literals by putting the string in single quotes:
421 421  
422 422  * {{code language="xml"}}'Hello world'{{/code}}
... ... @@ -507,7 +507,7 @@
507 507  \\{{code language="xml"}}typeof 'Hello world'{{/code}}|
508 508  {{code language="xml"}}datatype.null{{/code}}
509 509  \\{{code language="xml"}}datatype.integer{{/code}}
510 -\\{{code language="xml"}}datatype.string{{/code}}|Yields the [[data type of the following sub-expression>>||anchor="typeof" style="outline-width: 0px !important; user-select: auto !important;"]]
512 +\\{{code language="xml"}}datatype.string{{/code}}|Yields the [[data type of the following sub-expression>>MediaWiki.NULL]]
511 511  |sin|unary|
512 512  {{code language="xml"}}sin(30deg){{/code}}
513 513  \\{{code language="xml"}}sin(pi){{/code}}|
... ... @@ -517,41 +517,7 @@
517 517  {{code language="xml"}}cos(60deg){{/code}}
518 518  \\{{code language="xml"}}cos(pi){{/code}}|
519 519  {{code language="xml"}}0.5{{/code}}
520 -\\{{code language="xml"}}-1.0{{/code}}|Cosine (function-style, parentheses required)
521 -|tan|unary|
522 -{{code language="xml"}}tan(-45deg){{/code}}
523 -\\{{code language="xml"}}tan(45deg){{/code}}|
524 -{{code language="xml"}}-1.0{{/code}}
525 -\\{{code language="xml"}}1.0{{/code}}|(((
526 -Tangent (function-style, parentheses required)
527 -
528 -Available from X4 v7.0
529 -)))
530 -|asin|unary|
531 -{{code language="xml"}}asin(-0.5f){{/code}}
532 -\\{{code language="xml"}}asin(1){{/code}}|
533 -{{code language="xml"}}-0.523599rad{{/code}}
534 -\\{{code language="xml"}}1.5708rad{{/code}}|(((
535 -Inverse sine (function-style, parentheses required)
536 -
537 -Available from X4 v7.0
538 -)))
539 -|acos|unary|
540 -{{code language="xml"}}acos(-0.5f){{/code}}
541 -\\{{code language="xml"}}acos(1.0f){{/code}}|
542 -{{code language="xml"}}2.0944rad{{/code}}
543 -\\{{code language="xml"}}0rad{{/code}}|(((
544 -Inverse cosine (function-style, parentheses required)
545 -
546 -Available from X4 v7.0
547 -)))
548 -|atan|unary|
549 -{{code language="xml"}}atan(1.0f){{/code}}|
550 -{{code language="xml"}}0.785398rad{{/code}}|(((
551 -Inverse tangent (function-style, parentheses required)
552 -
553 -Available from X4 v7.0
554 -)))
522 +\\{{code language="xml"}}0.0{{/code}}|Cosine (function-style, parentheses required)
555 555  |sqrt|unary|{{code language="xml"}}sqrt(2){{/code}}|{{code language="xml"}}1.414213LF{{/code}}|Square root (function-style, parentheses required)
556 556  |exp|unary|{{code language="xml"}}exp(1){{/code}}|{{code language="xml"}}2.71828LF{{/code}}|Exponential function (function-style, parentheses required)
557 557  |log|unary|{{code language="xml"}}log(8) / log(2){{/code}}|{{code language="xml"}}3.0LF{{/code}}|Natural logarithm (function-style, parentheses required)
... ... @@ -581,12 +581,12 @@
581 581  gt
582 582  \\> (>)|binary|
583 583  {{code language="xml"}}1 gt 3{{/code}}
584 -\\{{code language="xml"}}1 > 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than
552 +\\{{code language="xml"}}1 < 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than
585 585  |
586 586  ge
587 587  \\>=|binary|
588 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
557 +\\{{code language="xml"}}1 <= 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
... ... @@ -655,18 +655,21 @@
655 655  * "and" and "or" use short-circuit semantics: The right side of the operation can be skipped if the left side already determines the outcome of the operation
656 656  ** Example:{{code language="xml"}} false and $foo{{/code}} ⟹ {{code language="xml"}}false{{/code}} (the value of $foo is not checked at all)
657 657  * 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.
658 -* <, <=, >, >= 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>>doc:||anchor="HValuecomparisons"]] with additional XML attributes can be more readable.
626 +* <, <=, >, >= 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.
659 659  
660 -== (% id="categorybroken_macroanchorstrings-and-formatting" %)Strings and formatting(%%) ==
628 +(% id="categorybroken_macroanchorstrings-and-formatting" %)== Strings and formatting==
661 661  
630 +
631 +{{{==}}}
632 +
662 662  You can concatenate string literals using the + operator, but there is also a printf-like formatting syntax, which is easier to use than concatenating lots of small pieces:
663 663  
664 664  * {{code language="xml"}}'The %1 %2 %3 jumps over the %5 %4'.['quick', 'brown', 'fox', 'dog', 'lazy']{{/code}}
665 665  * {{code language="xml"}}'%1 + %2 = %3'.[$a, $b, $a + $b]{{/code}}
666 666  
667 -See also the section about [[value properties>>doc:||anchor="HValueproperties" style="outline-width: 0px !important; user-select: auto !important;"]].
638 +See also the section about [[value properties>>MediaWiki.NULL]].
668 668  
669 -Instead of '%1 %2 %3', you can also use '%s %s %s', which is also compatible with Lua string formatting in the UI system. However, this should only be used if you are sure that the order is the same in all supported languages. If you want to make translators aware that they can change the order of parameters, you should prefer '%1 %2 %3'.
640 +Instead of ΓÇÿ%1 %2 %3', you can also use ΓÇÿ%s %s %s', which is also compatible with Lua string formatting in the UI system. However, this should only be used if you are sure that the order is the same in all supported languages. If you want to make translators aware that they can change the order of parameters, you should prefer '%1 %2 %3'.
670 670  \\To get a percent character in the result string, use '%%' in the format string.
671 671  \\\\\\If you need a more sophisticated method for text substitution, try **<substitute_text>**. See the XML schema documentation for this script action.
672 672  \\**[New as of X Rebirth 4.0]**
... ... @@ -683,14 +683,14 @@
683 683  * "." must be followed by a single digit (0-9). In case of ".0" any fractional digits are discarded (rounding towards zero, not half away from zero).
684 684  
685 685  {{info}}
686 -There are also special methods to [[format money values and time values>>doc:||anchor="HMoneyandtimeformatting" style="outline-width: 0px !important; user-select: auto !important;"]] using the "formatted" property.
657 +There are also special methods to [[NULL|format money values and time values]] using the "formatted" property.
687 687  {{/info}}
688 688  
689 689  == Lists ==
690 690  
691 -Another example for a non-numeric value is a list: It is an ordered collection of other arbitrary values (called array or vector in other languages). It can be constructed within an expression using the [[~[~] syntax>>doc:||anchor="HOperators"]]. It may also be generated by special actions and conditions, and there are actions that can [[insert or remove values>>doc:||anchor="HCreatingandremovingvariables" style="outline-width: 0px !important; user-select: auto !important;"]].
662 +Another example for a non-numeric value is a list: It is an ordered collection of other arbitrary values (called array or vector in other languages). It can be constructed within an expression using the [[~[~] syntax>>MediaWiki.NULL]]. It may also be generated by special actions and conditions, and there are actions that can [[insert or remove values>>MediaWiki.NULL]].
692 692  
693 -A list can contain values of arbitrary data types, even mixed in the same list - so a list can actually contain other lists. However, some of the things that you can do with lists require that all contained elements are of a certain type. The contents of a list can be accessed via properties, see the section about [[value properties>>doc:||anchor="HValueproperties"]]. Lists can be empty, these are written as "[ ]".
664 +A list can contain values of arbitrary data types, even mixed in the same list - so a list can actually contain other lists. However, some of the things that you can do with lists require that all contained elements are of a certain type. The contents of a list can be accessed via properties, see the section about [[value properties>>MediaWiki.NULL]]. Lists can be empty, these are written as "[ ]".
694 694  
695 695  {{info}}
696 696  When accessing a list's elements, the numbering is '''1-based''', so the first element has number 1. This is intuitive but different from 0-based numbering in most programming languages."
... ... @@ -709,7 +709,7 @@
709 709  (% id="categorybroken_macroanchortables" %)
710 710  == Tables ==
711 711  
712 -Tables are associative arrays - they are like lists, but you can assign values to (almost) arbitrary keys, not just to index numbers. A table is constructed within an expression using the [[table~[~] syntax>>doc:||anchor="HOperators" style="outline-width: 0px !important; user-select: auto !important;"]]. See the section about [[value properties>>doc:||anchor="HValueproperties" style="outline-width: 0px !important; user-select: auto !important;"]] for how to access the contents of a table. [[Creating and removing entries>>doc:||anchor="HCreatingandremovingvariables" style="outline-width: 0px !important; user-select: auto !important;"]] works similarly to lists, but instead of inserting, you simply assign a value to a table key. If the key does not exist yet, it will be created.
683 +Tables are associative arrays - they are like lists, but you can assign values to (almost) arbitrary keys, not just to index numbers. A table is constructed within an expression using the [[table~[~] syntax>>MediaWiki.NULL]]. See the section about [[value properties>>MediaWiki.NULL]] for how to access the contents of a table. [[Creating and removing entries>>MediaWiki.NULL]] works similarly to lists, but instead of inserting, you simply assign a value to a table key. If the key does not exist yet, it will be created.
713 713  
714 714  Almost all values are allowed as table keys, but there are a few exceptions:
715 715  
... ... @@ -802,7 +802,7 @@
802 802  * {{code language="xml"}}$table.keys.random{{/code}}: A randomly chosen key (which requires that the table is non-empty)
803 803  
804 804  {{info}}
805 -The string formatting syntax that you have seen [[above>>doc:||anchor="HStringsandformatting" style="outline-width: 0px !important; user-select: auto !important;"]] is also based on the property system. You basically pass a list as property key to a string. Braces around the brackets are not required, so 'foo'.[...] is just a convenient alternative notation for 'foo'.{[...]}.
776 +The string formatting syntax that you have seen [[NULL|above]] is also based on the property system. You basically pass a list as property key to a string. Braces around the brackets are not required, so 'foo'.[...] is just a convenient alternative notation for 'foo'.{[...]}.
806 806  {{/info}}
807 807  
808 808  === (% id="lookup-tests-and-suppressing-errors" %)Lookup tests and suppressing errors(%%) ===
... ... @@ -854,11 +854,11 @@
854 854  |profile|
855 855  profile.flat
856 856  \\profile.increasing
857 -\\profile.bell|Probability distribution profile (see [[random ranges>>doc:||anchor="HRandomranges" style="outline-width: 0px !important; user-select: auto !important;"]])
828 +\\profile.bell|Probability distribution profile (see [[random ranges>>MediaWiki.NULL]])
858 858  |cuestate|
859 859  cuestate.waiting
860 860  \\cuestate.active
861 -\\cuestate.complete|[[Cue states>>||anchor="HCues" style="outline-width: 0px !important; user-select: auto !important;"]]
832 +\\cuestate.complete|[[Cue states>>MediaWiki.NULL]]
862 862  |level|
863 863  level.easy
864 864  \\level.medium
... ... @@ -878,8 +878,6 @@
878 878  \\faction.argongovernment|Factions
879 879  )))
880 880  
881 -{{id name="typeof"/}}
882 -
883 883  {{info}}
884 884  With the ''typeof'' operator you can get the datatype of any expression and compare it with what you expect, for example:
885 885  
... ... @@ -927,7 +927,7 @@
927 927  === (% id="categorybroken_macroanchormoney-and-time-formatting" %)Money and time formatting(%%) ===
928 928  
929 929  **[New as of X Rebirth 4.0]**
930 -\\Numbers don't have any properties, except for money and time: They have a "**formatted**" property, which allows you to get a custom string representation with more advanced options than the [[generic formatting method>>||anchor="HStringsandformatting" style="outline-width: 0px !important; user-select: auto !important;"]] for numbers.
899 +\\Numbers don't have any properties, except for money and time: They have a "**formatted**" property, which allows you to get a custom string representation with more advanced options than the [[generic formatting method>>MediaWiki.NULL]] for numbers.
931 931  
932 932  * {{code language="xml"}}$money.formatted.{'formatstring'}{{/code}}
933 933  * {{code language="xml"}}$money.formatted.default{{/code}} (using default format string '%s')
... ... @@ -963,7 +963,7 @@
963 963  * {{code language="xml"}}(1234Cr).formatted.{'%1s'}{{/code}}⟹{{code language="xml"}}'1 k'{{/code}} (rounding towards zero)
964 964  * {{code language="xml"}}(1234Cr).formatted.{'%cM'}{{/code}}⟹{{code language="xml"}}'0 M'{{/code}}
965 965  
966 -For documentation of time format strings, see the Lua function ConvertTimeString() in the [[Lua function overview>>doc:X Rebirth Wiki.Modding support.UI Modding support.Lua function overview.WebHome||style="outline-width: 0px !important; user-select: auto !important;"]].
935 +For documentation of time format strings, see the Lua function ConvertTimeString() in the [[MediaWiki.ARCHIVE.XRWIKIModding_supportUI_Modding_supportLua_function_overview]].
967 967  
968 968  Examples:
969 969  
... ... @@ -982,7 +982,7 @@
982 982  scriptproperties.html has to load files from different folders, which modern browsers do not allow by default for security reasons. In order to open scriptproperties.html, the following is required:
983 983  
984 984  * Firefox: On the about:config page, the value of "security.fileuri.strict_origin_policy" has to be changed to "false".
985 -* Chrome: The Chrome launcher has to be started with the command-line parameter --~-~---allow-file-access-from-files
954 +* Chrome: The Chrome launcher has to be started with the command-line parameter --allow-file-access-from-files--
986 986  {{/info}}
987 987  
988 988  This provides you with a complete list of all supported "base keywords" and properties. To filter in this list, you can enter an expression in the text field:
... ... @@ -1106,6 +1106,7 @@
1106 1106   <set_value name="$foo" min="-20" max="20" profile="profile.increasing" scale="4"/>
1107 1107  {{/code}}
1108 1108  
1078 +
1109 1109  = Variables and namespaces =
1110 1110  
1111 1111  As you have seen above, you can easily access variables by writing their name (including $ prefix) in an expression. Namespaces define in which cue the variables are actually stored (and from which cue they are read).
... ... @@ -1160,6 +1160,7 @@
1160 1160  
1161 1161  Removing an entry from a list shifts all following elements down by one. If you want to clear an entry without removing it from the list, just use <set_value> instead.
1162 1162  
1133 +
1163 1163  == Accessing remote variables ==
1164 1164  
1165 1165  You can also read and write variables in other cues by using the variable name as property key: