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 32940.1
edited by Daniel Turner
on 2023/08/22 16:50
Change comment: There is no comment for this version

Summary

Details

Page properties
Tags
... ... @@ -1,1 +1,1 @@
1 -Broken_macro/anchor
1 +Broken_macro/anchor|Broken macro/anchor
Content
... ... @@ -20,9 +20,11 @@
20 20  
21 21  This functionality is only available if the schema files **md.xsd** and **common.xsd** are in the correct folder. If you are editing the XML in the game folder directly, all is well and the files are loaded from the libraries folder. However, if you are editing in a separate folder, copy those XSD files from the libraries folder directly into the folder where your XML files are located.
22 22  
23 -{{note body="Even if your script is free of XSD errors, that does not mean that the script syntax is correct. For example, there are XML elements that require at least one of multiple attributes, but this requirement cannot be reflected in a schema (apart from documentation text). Please notice the XSD documentation of the elements and attributes, e.g. displayed via tooltips in Visual Studio / Visual Web Developer. Please also note additional requirements for MD cue attributes in this guide (see [[NULL|Conditions]]).
23 +{{info}}
24 +Even if your script is free of XSD errors, that does not mean that the script syntax is correct. For example, there are XML elements that require at least one of multiple attributes, but this requirement cannot be reflected in a schema (apart from documentation text). Please notice the XSD documentation of the elements and attributes, e.g. displayed via tooltips in Visual Studio / Visual Web Developer. Please also note additional requirements for MD cue attributes in this guide (see [[NULL|Conditions]]).
24 24  
25 -To check for errors, please pay attention to in-game error messages that are produced while your script is imported, and run-time errors while the script runs. The XSD files can help you a lot, but you should not rely on the absence of XSD errors."/}}
26 +To check for errors, please pay attention to in-game error messages that are produced while your script is imported, and run-time errors while the script runs. The XSD files can help you a lot, but you should not rely on the absence of XSD errors."
27 +{{/info}}
26 26  
27 27  == Script debug output ==
28 28  
... ... @@ -626,8 +626,11 @@
626 626  
627 627  
628 628  
629 -== Strings and formatting ==
631 +(% id="categorybroken_macroanchorstrings-and-formatting" %)== Strings and formatting==
632 +(% id="categorybroken_macroanchorstrings-and-formatting" %)
630 630  
634 +{{{==}}}
635 +
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  
667 +(% 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  
691 +(% 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).
719 +Just like lists, tables are stored as references, so it's possible that multiple variables reference the same table (see above).\\
720 +
715 715  \\
716 716  
723 +(% 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 ===
811 +(% id="lookup-tests-and-suppressing-errors" %)=== Lookup tests and suppressing errors
806 806  
813 +
814 +{{{===}}}
815 +
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" %)
948 +(% id="categorybroken_macroanchormoney-and-time-formatting" %)=== Money and time formatting
940 940  
941 -=== Money and time formatting ===
942 942  
951 +{{{===}}}
952 +
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