Changes for page Mission Director Guide

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

From version 32962.1
edited by Daniel Turner
on 2023/08/24 10:04
Change comment: There is no comment for this version
To version 32970.12
edited by Heinrich Unrau
on 2024/10/17 12:56
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.Daniel
1 +xwiki:XWiki.Heinrich
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">
... ... @@ -407,22 +407,20 @@
407 407  
408 408  Most of the attribute values in actions and conditions are interpreted as script expressions and parsed accordingly. An expression is a phrase that can be evaluated to a single value. The simplest expressions are actual numeric values and strings, so called **literals:**
409 409  
410 -* {{code language="xml"}}0{{/code}} (integer number)
411 -* {{code language="xml"}}0772{{/code}} (leading 0 means octal integer number)
412 -* {{code language="xml"}}3.14159{{/code}} (floating point number)
413 -* {{code language="xml"}}5e12{{/code}} (float in exponent notation, "times ten to the power of")
414 -* {{code language="xml"}}0xCAFE{{/code}} (hexadecimal integer number)
410 +* {{code language="xml"}}0{{/code}}(integer number)
411 +* {{code language="xml"}}0772{{/code}}(leading 0 means octal integer number)
412 +* {{code language="xml"}}3.14159{{/code}}(floating point number)
413 +* {{code language="xml"}}5e12{{/code}}(float in exponent notation, "times ten to the power of")
414 +* {{code language="xml"}}0xCAFE{{/code}}(hexadecimal integer number)
415 415  
416 416  {{info}}
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 -
422 422  You can write string literals by putting the string in single quotes:
423 423  
424 424  * {{code language="xml"}}'Hello world'{{/code}}
425 -* {{code language="xml"}}''{{/code}} (empty string)
423 +* {{code language="xml"}}''{{/code}}(empty string)
426 426  * {{code language="xml"}}'String with a line break\n'{{/code}}
427 427  
428 428  {{info}}
... ... @@ -434,12 +434,12 @@
434 434  
435 435  Numbers can have a suffix that determines their numeric type. There are also numerical data types like "money" or "time" which can only be expressed by using an appropriate unit suffix:
436 436  
437 -* {{code language="xml"}}5000000000L{{/code}} (large integer)
438 -* {{code language="xml"}}1f{{/code}} (floating point number, same as 1.0, just 1 would be an integer)
439 -* {{code language="xml"}}1000Cr{{/code}} (Money in Credits, converted to 100000 cents automatically)
440 -* {{code language="xml"}}500m{{/code}} (Length in metres)
441 -* {{code language="xml"}}10s{{/code}} (Time in seconds)
442 -* {{code language="xml"}}1h{{/code}} (Time in hours, which is converted to 3600s automatically)
435 +* {{code language="xml"}}5000000000L{{/code}}(large integer)
436 +* {{code language="xml"}}1f{{/code}}(floating point number, same as 1.0, just 1 would be an integer)
437 +* {{code language="xml"}}1000Cr{{/code}}(Money in Credits, converted to 100000 cents automatically)
438 +* {{code language="xml"}}500m{{/code}}(Length in metres)
439 +* {{code language="xml"}}10s{{/code}}(Time in seconds)
440 +* {{code language="xml"}}1h{{/code}}(Time in hours, which is converted to 3600s automatically)
443 443  
444 444  A space between number and suffix is allowed.
445 445  
... ... @@ -509,7 +509,7 @@
509 509  \\{{code language="xml"}}typeof 'Hello world'{{/code}}|
510 510  {{code language="xml"}}datatype.null{{/code}}
511 511  \\{{code language="xml"}}datatype.integer{{/code}}
512 -\\{{code language="xml"}}datatype.string{{/code}}|Yields the [[data type of the following sub-expression>>MediaWiki.NULL]]
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;"]]
513 513  |sin|unary|
514 514  {{code language="xml"}}sin(30deg){{/code}}
515 515  \\{{code language="xml"}}sin(pi){{/code}}|
... ... @@ -519,7 +519,41 @@
519 519  {{code language="xml"}}cos(60deg){{/code}}
520 520  \\{{code language="xml"}}cos(pi){{/code}}|
521 521  {{code language="xml"}}0.5{{/code}}
522 -\\{{code language="xml"}}0.0{{/code}}|Cosine (function-style, parentheses required)
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 +)))
523 523  |sqrt|unary|{{code language="xml"}}sqrt(2){{/code}}|{{code language="xml"}}1.414213LF{{/code}}|Square root (function-style, parentheses required)
524 524  |exp|unary|{{code language="xml"}}exp(1){{/code}}|{{code language="xml"}}2.71828LF{{/code}}|Exponential function (function-style, parentheses required)
525 525  |log|unary|{{code language="xml"}}log(8) / log(2){{/code}}|{{code language="xml"}}3.0LF{{/code}}|Natural logarithm (function-style, parentheses required)
... ... @@ -549,12 +549,12 @@
549 549  gt
550 550  \\> (>)|binary|
551 551  {{code language="xml"}}1 gt 3{{/code}}
552 -\\{{code language="xml"}}1 < 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than
584 +\\{{code language="xml"}}1 > 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than
553 553  |
554 554  ge
555 555  \\>=|binary|
556 556  {{code language="xml"}}1 ge 3{{/code}}
557 -\\{{code language="xml"}}1 <= 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than or equal to
589 +\\{{code language="xml"}}1 >= 3{{/code}}|{{code language="xml"}}false{{/code}}|Greater than or equal to
558 558  |(((
559 559  
560 560  )))|binary|{{code language="xml"}}1 + 1 == 2.0{{/code}}|{{code language="xml"}}true{{/code}}|Equal to
... ... @@ -598,8 +598,8 @@
598 598  
599 599  There is a way to convert a number into a different type manually: You append the corresponding suffix to a sub-expression in parentheses, like this:
600 600  
601 -* {{code language="xml"}}(1 + 1)f{{/code}} ⟹ {{code language="xml"}}2f{{/code}} ⟹ {{code language="xml"}}2.0{{/code}}
602 -* {{code language="xml"}}(1h) m / (180deg) i{{/code}} ⟹ {{code language="xml"}}(3600s) m / (3.14rad) i{{/code}} ⟹ {{code language="xml"}}3600m / 3{{/code}} ⟹ {{code language="xml"}}1200m{{/code}}
633 +* {{code language="xml"}}(1 + 1)f{{/code}}⟹ {{code language="xml"}}2f{{/code}} ⟹ {{code language="xml"}}2.0{{/code}}
634 +* {{code language="xml"}}(1h) m / (180deg) i{{/code}}⟹ {{code language="xml"}}(3600s) m / (3.14rad) i{{/code}} ⟹ {{code language="xml"}}3600m / 3{{/code}} ⟹ {{code language="xml"}}1200m{{/code}}
603 603  
604 604  When converting to a non-default unit type, this means you interpret the number as in the given units: "{{code language="xml"}}(1km + 500m)h{{/code}}" means that you interpret 1500m as 1500 hours, so the resulting value will be 1500x3600 seconds. (As stated above, the default unit for a length is metres.)
605 605  
... ... @@ -607,8 +607,8 @@
607 607  
608 608  Every data type can be combined with a string with the + operator, and will be converted to a string representation. That way you can also concatenate strings and numbers:
609 609  
610 -* {{code language="xml"}}'One plus one is equal to ' + (1+1) + '.'{{/code}} ⟹ {{code language="xml"}}'One plus one is equal to 2.'{{/code}}
611 -* {{code language="xml"}}'One plus one is not equal to ' + 1 + 1 + '.'{{/code}} ⟹ {{code language="xml"}}'One plus one is not equal to 11.'{{/code}}
642 +* {{code language="xml"}}'One plus one is equal to ' + (1+1) + '.'{{/code}}⟹ {{code language="xml"}}'One plus one is equal to 2.'{{/code}}
643 +* {{code language="xml"}}'One plus one is not equal to ' + 1 + 1 + '.'{{/code}}⟹ {{code language="xml"}}'One plus one is not equal to 11.'{{/code}}
612 612  
613 613  As you can see, operators of the same precedence (+ in this case) are always evaluated from left to right.
614 614  
... ... @@ -623,29 +623,26 @@
623 623  * "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
624 624  ** Example:{{code language="xml"}} false and $foo{{/code}} ⟹ {{code language="xml"}}false{{/code}} (the value of $foo is not checked at all)
625 625  * 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.
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.
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.
627 627  
628 -(% id="categorybroken_macroanchorstrings-and-formatting" %)== Strings and formatting==
660 +== (% id="categorybroken_macroanchorstrings-and-formatting" %)Strings and formatting(%%) ==
629 629  
630 -
631 -{{{==}}}
632 -
633 633  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:
634 634  
635 635  * {{code language="xml"}}'The %1 %2 %3 jumps over the %5 %4'.['quick', 'brown', 'fox', 'dog', 'lazy']{{/code}}
636 636  * {{code language="xml"}}'%1 + %2 = %3'.[$a, $b, $a + $b]{{/code}}
637 637  
638 -See also the section about [[value properties>>MediaWiki.NULL]].
667 +See also the section about [[value properties>>doc:||anchor="HValueproperties" style="outline-width: 0px !important; user-select: auto !important;"]].
639 639  
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'.
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'.
641 641  \\To get a percent character in the result string, use '%%' in the format string.
642 642  \\\\\\If you need a more sophisticated method for text substitution, try **<substitute_text>**. See the XML schema documentation for this script action.
643 643  \\**[New as of X Rebirth 4.0]**
644 644  \\ With the formatting syntax above, it is even possible to control how the parameter is formatted, using modifiers between "%" and the parameter specifier ("s" or the parameter number):
645 645  
646 -* {{code language="xml"}}'%,s'.[12345678]{{/code}} ⟹ {{code language="xml"}}'12,345,678'{{/code}} (the "," modifier shows a number with thousands separators, correctly localised)
647 -* {{code language="xml"}}'%.3s'.[123.4]{{/code}} ⟹ {{code language="xml"}}'123.400'{{/code}} (show 3 fractional digits, rounding half away from zero - decimal point correctly localised)
648 -* {{code language="xml"}}'%,.1s'.[12345.67]'{{/code}} ⟹ {{code language="xml"}}'12,345.7'{{/code}} (combination of the above)
675 +* {{code language="xml"}}'%,s'.[12345678]{{/code}}⟹ {{code language="xml"}}'12,345,678'{{/code}} (the "," modifier shows a number with thousands separators, correctly localised)
676 +* {{code language="xml"}}'%.3s'.[123.4]{{/code}}⟹ {{code language="xml"}}'123.400'{{/code}} (show 3 fractional digits, rounding half away from zero - decimal point correctly localised)
677 +* {{code language="xml"}}'%,.1s'.[12345.67]'{{/code}}⟹ {{code language="xml"}}'12,345.7'{{/code}} (combination of the above)
649 649  
650 650  Additional remarks:
651 651  
... ... @@ -654,14 +654,14 @@
654 654  * "." 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).
655 655  
656 656  {{info}}
657 -There are also special methods to [[NULL|format money values and time values]] using the "formatted" property.
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.
658 658  {{/info}}
659 659  
660 660  == Lists ==
661 661  
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]].
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;"]].
663 663  
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 "[ ]".
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 "[ ]".
665 665  
666 666  {{info}}
667 667  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."
... ... @@ -680,7 +680,7 @@
680 680  (% id="categorybroken_macroanchortables" %)
681 681  == Tables ==
682 682  
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.
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.
684 684  
685 685  Almost all values are allowed as table keys, but there are a few exceptions:
686 686  
... ... @@ -690,13 +690,13 @@
690 690  
691 691  These restrictions only apply to the keys, there are no restrictions for values that you assign to them. For example:
692 692  
693 -* {{code language="xml"}}table[]{{/code}} ⟹ creates an empty table
694 -* {{code language="xml"}}table[{0} = null]{{/code}} ⟹ creates a table that maps the number 0 to null
722 +* {{code language="xml"}}table[]{{/code}}⟹ creates an empty table
723 +* {{code language="xml"}}table[{0} = null]{{/code}}⟹ creates a table that maps the number 0 to null
695 695  
696 -* {{code language="xml"}}table[{'$foo'} = 'bar']{{/code}} ⟹ a table that maps the string '$foo' to the string 'bar'
697 -* {{code language="xml"}}table[$foo = 'bar']{{/code}} ⟹ exactly the same, just a shorter notation for string keys
698 -* {{code language="xml"}}table[foo = 'bar']{{/code}} ⟹ error, 'foo' does not start with a '$'
699 -* {{code language="xml"}}table[{1} = [], {2} = table[]] {{/code}} ⟹ a table that maps 1 to an empty list and 2 to an empty table
725 +* {{code language="xml"}}table[{'$foo'} = 'bar']{{/code}}⟹ a table that maps the string '$foo' to the string 'bar'
726 +* {{code language="xml"}}table[$foo = 'bar']{{/code}}⟹ exactly the same, just a shorter notation for string keys
727 +* {{code language="xml"}}table[foo = 'bar']{{/code}}⟹ error, 'foo' does not start with a '$'
728 +* {{code language="xml"}}table[{1} = [], {2} = table[]] {{/code}}⟹ a table that maps 1 to an empty list and 2 to an empty table
700 700  
701 701  Just like lists, tables are stored as references, so it's possible that multiple variables reference the same table (see above).
702 702  
... ... @@ -717,10 +717,10 @@
717 717  
718 718  You can look up a property by appending a dot and the key in curly braces:
719 719  
720 -* {{code language="xml"}}[100, 200, 300, 400].{1}{{/code}} ⟹ 100 (reading the first element)
721 -* {{code language="xml"}}[100, 200, ['Hello ', 'world']] .{3}.{2}{{/code}} ⟹ 'world' (second element of the inner list, which is the third element of the outer list)
722 -* {{code language="xml"}}[].{'count'}{{/code}} ⟹ 0
723 -* {{code language="xml"}}table[{21} = 42].{21}{{/code}} ⟹ 42
749 +* {{code language="xml"}}[100, 200, 300, 400].{1}{{/code}}⟹ 100 (reading the first element)
750 +* {{code language="xml"}}[100, 200, ['Hello ', 'world']] .{3}.{2}{{/code}}⟹ 'world' (second element of the inner list, which is the third element of the outer list)
751 +* {{code language="xml"}}[].{'count'}{{/code}}⟹ 0
752 +* {{code language="xml"}}table[{21} = 42].{21}{{/code}}⟹ 42
724 724  
725 725  In most cases the property key is a fixed string, like "name" or "class". You can write this like above:
726 726  
... ... @@ -744,19 +744,19 @@
744 744  
745 745  **min'** and '**max'** return the minimum or maximum (all elements have to be numeric)
746 746  
747 -* {{code language="xml"}}[1, 6, 8].min{{/code}} ⟹ 1
776 +* {{code language="xml"}}[1, 6, 8].min{{/code}}⟹ 1
748 748  
749 749  **average'** returns the average (but all element types have to be compatible)
750 750  
751 -* {{code language="xml"}}[1, 6, 8].average{{/code}} ⟹ 5
780 +* {{code language="xml"}}[1, 6, 8].average{{/code}}⟹ 5
752 752  
753 753  **indexof'** is followed by another property, and the index of the first occurence of that key in the list is returned, or 0 if it's not in the list
754 754  
755 -* {{code language="xml"}}[1, 6, 8].indexof.{8}{{/code}} ⟹ 3
784 +* {{code language="xml"}}[1, 6, 8].indexof.{8}{{/code}}⟹ 3
756 756  
757 757  **clone'** creates a shallow copy of the list (i.e. lists that are contained as elements in the list are not copied, only the reference to them)
758 758  
759 -* {{code language="xml"}}[1, 6, 8].clone{{/code}} ⟹ {{code language="xml"}}[1, 6, 8]{{/code}}
788 +* {{code language="xml"}}[1, 6, 8].clone{{/code}}⟹ {{code language="xml"}}[1, 6, 8]{{/code}}
760 760  
761 761  A table has different properties:
762 762  
... ... @@ -773,7 +773,7 @@
773 773  * {{code language="xml"}}$table.keys.random{{/code}}: A randomly chosen key (which requires that the table is non-empty)
774 774  
775 775  {{info}}
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'.{[...]}.
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'.{[...]}.
777 777  {{/info}}
778 778  
779 779  === (% id="lookup-tests-and-suppressing-errors" %)Lookup tests and suppressing errors(%%) ===
... ... @@ -780,20 +780,20 @@
780 780  
781 781  If you look up a property that does not exist, there will be an error, and the result will be null. To test whether a property exists, you can append a question mark "?" to the lookup, which yields true or false:
782 782  
783 -* {{code language="xml"}}$list.{5}{{/code}} ⟹ The fifth element of a list - however, if $list has less than 5 elements (and if it's also not a table with the key 5), there will be an error
784 -* {{code language="xml"}}$list.{5}?{{/code}} ⟹ true if $list exists and has the property 5, false otherwise
785 -* {{code language="xml"}}$table.$key?{{/code}} ⟹ Analogously, true if $table exists and has the string property '$key'
812 +* {{code language="xml"}}$list.{5}{{/code}}⟹ The fifth element of a list - however, if $list has less than 5 elements (and if it's also not a table with the key 5), there will be an error
813 +* {{code language="xml"}}$list.{5}?{{/code}}⟹ true if $list exists and has the property 5, false otherwise
814 +* {{code language="xml"}}$table.$key?{{/code}}⟹ Analogously, true if $table exists and has the string property '$key'
786 786  
787 787  The question mark can even be applied to variables:
788 788  
789 -* {{code language="xml"}}$list{{/code}} ⟹ The value stored under the name $list, or an error if there is no such variable
790 -* {{code language="xml"}}$list?{{/code}} ⟹ true if the variable exists, false otherwise
818 +* {{code language="xml"}}$list{{/code}}⟹ The value stored under the name $list, or an error if there is no such variable
819 +* {{code language="xml"}}$list?{{/code}}⟹ true if the variable exists, false otherwise
791 791  
792 792  To look up the value of a property although it may not exist, you can use the at-sign "@" as prefix:
793 793  
794 -* {{code language="xml"}}@$list.{5}{{/code}} ⟹ The result of the $list lookup if $list exists and has the property 5, otherwise null (without error message)
795 -* {{code language="xml"}}@$list{{/code}} ⟹ The list if this variable exists, null otherwise
796 -* {{code language="xml"}}@$list.{5}.{1}{{/code}} ⟹ The first element of the fifth element of $list, if it exists, null otherwise
823 +* {{code language="xml"}}@$list.{5}{{/code}}⟹ The result of the $list lookup if $list exists and has the property 5, otherwise null (without error message)
824 +* {{code language="xml"}}@$list{{/code}}⟹ The list if this variable exists, null otherwise
825 +* {{code language="xml"}}@$list.{5}.{1}{{/code}}⟹ The first element of the fifth element of $list, if it exists, null otherwise
797 797  
798 798  As you can see, an error is already prevented if any link in the property chain does not exist. But use the @ prefix with care, since error messages are really helpful for detecting problems in your scripts. The @ prefix only suppresses property-related error messages and does not change any in-game behaviour.
799 799  
... ... @@ -825,11 +825,11 @@
825 825  |profile|
826 826  profile.flat
827 827  \\profile.increasing
828 -\\profile.bell|Probability distribution profile (see [[random ranges>>MediaWiki.NULL]])
857 +\\profile.bell|Probability distribution profile (see [[random ranges>>doc:||anchor="HRandomranges" style="outline-width: 0px !important; user-select: auto !important;"]])
829 829  |cuestate|
830 830  cuestate.waiting
831 831  \\cuestate.active
832 -\\cuestate.complete|[[Cue states>>MediaWiki.NULL]]
861 +\\cuestate.complete|[[Cue states>>||anchor="HCues" style="outline-width: 0px !important; user-select: auto !important;"]]
833 833  |level|
834 834  level.easy
835 835  \\level.medium
... ... @@ -849,7 +849,8 @@
849 849  \\faction.argongovernment|Factions
850 850  )))
851 851  
852 -{{id name="typeof" /}}
881 +{{id name="typeof"/}}
882 +
853 853  {{info}}
854 854  With the ''typeof'' operator you can get the datatype of any expression and compare it with what you expect, for example:
855 855  
... ... @@ -897,13 +897,13 @@
897 897  === (% id="categorybroken_macroanchormoney-and-time-formatting" %)Money and time formatting(%%) ===
898 898  
899 899  **[New as of X Rebirth 4.0]**
900 -\\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.
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.
901 901  
902 902  * {{code language="xml"}}$money.formatted.{'formatstring'}{{/code}}
903 -* {{code language="xml"}}$money.formatted.default{{/code}} (using default format string '%s')
933 +* {{code language="xml"}}$money.formatted.default{{/code}}(using default format string '%s')
904 904  
905 905  * {{code language="xml"}}$time.formatted.{'formatstring'}{{/code}}
906 -* {{code language="xml"}}$time.formatted.default{{/code}} (using default format string '%T')
936 +* {{code language="xml"}}$time.formatted.default{{/code}}(using default format string '%T')
907 907  
908 908  In scripts, money is stored in cents, not Credits. The formatted representation always shows the value in Credits, including thousands separators.
909 909  
... ... @@ -933,14 +933,14 @@
933 933  * {{code language="xml"}}(1234Cr).formatted.{'%1s'}{{/code}}⟹{{code language="xml"}}'1 k'{{/code}} (rounding towards zero)
934 934  * {{code language="xml"}}(1234Cr).formatted.{'%cM'}{{/code}}⟹{{code language="xml"}}'0 M'{{/code}}
935 935  
936 -For documentation of time format strings, see the Lua function ConvertTimeString() in the [[MediaWiki.ARCHIVE.XRWIKIModding_supportUI_Modding_supportLua_function_overview]].
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;"]].
937 937  
938 938  Examples:
939 939  
940 -* {{code language="xml"}}(151s).formatted.{'%T'}{{/code}} ⟹ {{code language="xml"}}'00:02:31'{{/code}}
941 -* {{code language="xml"}}(151s).formatted.default{{/code}} ⟹ {{code language="xml"}}'00:02:31'{{/code}} (same as {'%T'})
942 -* {{code language="xml"}}(151s).formatted.{'%.3T'}{{/code}} ⟹ {{code language="xml"}}'00:02:31.000'{{/code}}
943 -* {{code language="xml"}}(151s).formatted.{'%h:%M'}{{/code}} ⟹ {{code language="xml"}}'0:02'{{/code}}
970 +* {{code language="xml"}}(151s).formatted.{'%T'}{{/code}}⟹ {{code language="xml"}}'00:02:31'{{/code}}
971 +* {{code language="xml"}}(151s).formatted.default{{/code}}⟹ {{code language="xml"}}'00:02:31'{{/code}} (same as {'%T'})
972 +* {{code language="xml"}}(151s).formatted.{'%.3T'}{{/code}}⟹ {{code language="xml"}}'00:02:31.000'{{/code}}
973 +* {{code language="xml"}}(151s).formatted.{'%h:%M'}{{/code}}⟹ {{code language="xml"}}'0:02'{{/code}}
944 944  
945 945  === Complete property documentation ===
946 946  
... ... @@ -952,7 +952,7 @@
952 952  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:
953 953  
954 954  * Firefox: On the about:config page, the value of "security.fileuri.strict_origin_policy" has to be changed to "false".
955 -* Chrome: The Chrome launcher has to be started with the command-line parameter --allow-file-access-from-files--
985 +* Chrome: The Chrome launcher has to be started with the command-line parameter --~-~---allow-file-access-from-files
956 956  {{/info}}
957 957  
958 958  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:
... ... @@ -977,6 +977,27 @@
977 977  
978 978  * 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).
979 979  * 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 +** If you remove a cue and then later add another cue with the same name, old save files will not know that the cue has been removed inbetween. In the following example the first cue was created setting $val_1 and the game is saved. If the Cue is deleted and years later a new cue with the same name appears, the old save will consider the new cue as already completed without 
1011 +{{code language="xml"}}<cue name="Deprecated_Test1" namespace="this">
1012 + <actions>
1013 + <set_value name="$val_1" exact="'old value'"/>
1014 + <debug_text text="$val_1"/>
1015 + </actions>
1016 +</cue>
1017 +
1018 +<cue name="Deprecated_Test1" namespace="this">
1019 + <actions>
1020 + <set_value name="$val_2" exact="'new value'"/>
1021 + <debug_text text="$val_2"/>
1022 + </actions>
1023 + <cues>
1024 + <cue name="PrintValue">
1025 + <actions>
1026 + <debug_text text="parent.$val_2"/>
1027 + </actions>
1028 + </cue>
1029 + </cues>
1030 +</cue>{{/code}}
980 980  * 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.
981 981  * You CANNOT change a <cue> to a <library> or vice versa.
982 982  * 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.)
... ... @@ -1076,7 +1076,6 @@
1076 1076   <set_value name="$foo" min="-20" max="20" profile="profile.increasing" scale="4"/>
1077 1077  {{/code}}
1078 1078  
1079 -
1080 1080  = Variables and namespaces =
1081 1081  
1082 1082  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).
... ... @@ -1131,7 +1131,6 @@
1131 1131  
1132 1132  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.
1133 1133  
1134 -
1135 1135  == Accessing remote variables ==
1136 1136  
1137 1137  You can also read and write variables in other cues by using the variable name as property key: