Changes for page Mission Director Guide

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

From version 32935.1
edited by Daniel Turner
on 2023/05/26 13:11
Change comment: There is no comment for this version
To version 32938.1
edited by Daniel Turner
on 2023/08/22 16:49
Change comment: Rollback to version 32934.1

Summary

Details

Page properties
Tags
... ... @@ -1,1 +1,1 @@
1 -Broken_macro/anchor
1 +Broken_macro/anchor|Broken macro/anchor
Content
... ... @@ -626,8 +626,11 @@
626 626  
627 627  
628 628  
629 -== Strings and formatting ==
629 +(% id="categorybroken_macroanchorstrings-and-formatting" %)== Strings and formatting==
630 +(% id="categorybroken_macroanchorstrings-and-formatting" %)
630 630  
632 +{{{==}}}
633 +
631 631  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:
632 632  
633 633  * {{code}}'The %1 %2 %3 jumps over the %5 %4'.['quick', 'brown', 'fox', 'dog', 'lazy']{{/code}}
... ... @@ -659,8 +659,8 @@
659 659  
660 660  \\
661 661  
665 +(% id="categorybroken_macroanchorlists" %)
662 662  
663 -
664 664  == Lists ==
665 665  
666 666  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]].
... ... @@ -683,8 +683,8 @@
683 683  
684 684  \\
685 685  
689 +(% id="categorybroken_macroanchortables" %)
686 686  
687 -
688 688  == Tables ==
689 689  
690 690  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.\\
... ... @@ -711,11 +711,12 @@
711 711  
712 712  
713 713  
714 -Just like lists, tables are stored as references, so it's possible that multiple variables reference the same table (see above).
717 +Just like lists, tables are stored as references, so it's possible that multiple variables reference the same table (see above).\\
718 +
715 715  \\
716 716  
721 +(% id="categorybroken_macroanchorvalue-properties" %)
717 717  
718 -
719 719  == Value properties ==
720 720  
721 721  Properties are a crucial concept in script expressions. In the previous sections you have seen mostly constant expressions, which are already evaluated when they are parsed at game start. For reading and writing variables and evaluating the gameΓÇÖs state, properties are used.
... ... @@ -802,8 +802,11 @@
802 802  
803 803  
804 804  
805 -=== Lookup tests and suppressing errors ===
809 +(% id="lookup-tests-and-suppressing-errors" %)=== Lookup tests and suppressing errors
806 806  
811 +
812 +{{{===}}}
813 +
807 807  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:
808 808  
809 809  * {{code}}$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
... ... @@ -936,10 +936,11 @@
936 936  
937 937  These properties will not cause errors when used on ΓÇ£nullΓÇ¥ or on a destroyed object (which may still be accessible from scripts in some cases), and produce null or false as results, respectively. (The keyword ΓÇ£availableΓÇ¥ is used for trades, not for objects. Trades can also become invalid.) However, when using such a property on a different data type like a number, there will still be an error.
938 938  
939 -(% id="categorybroken_macroanchormoney-and-time-formatting" %)
946 +(% id="categorybroken_macroanchormoney-and-time-formatting" %)=== Money and time formatting
940 940  
941 -=== Money and time formatting ===
942 942  
949 +{{{===}}}
950 +
943 943  **[New as of X Rebirth 4.0]**
944 944  \\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.
945 945