Changes for page Mission Director Guide

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

From version 31067.1
edited by Daniel Turner
on 2023/04/14 16:47
Change comment: Created page with "{{Info |body = Please note that this is officially-maintained documentation. To ensure that you can rely on the information having been checked by Egosoft, you will not be able to edit this page. }} <span style="color: rgb(0,0,0);text-decoration: none;"><br /> </span> <span style="color: rgb(0,0,0);text-decoration: none;">The Mission Director (MD) is a subsystem of the game and interprets mission scripts, which are written in an XML-based language. The Mission D..."
To version 31073.1
edited by Daniel Turner
on 2023/04/14 17:10
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -80,13 +80,26 @@
80 80  
81 81  (% style="color: rgb(0,0,0);text-decoration: none;" %)The XML root node of an MD file is called ΓÇ£mdscriptΓÇ¥ and looks like this:
82 82  
83 -{{code}}&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;mdscript name=&quot;ScriptName&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;md.xsd&quot;&gt;{{/code}}
83 +{{code language="xml"}}
84 +<?xml version="1.0" encoding="utf-8"?>
85 +<mdscript name="ScriptName" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
86 +{{/code}}
84 84  
85 85  (% style="color: rgb(0,0,0);text-decoration: none;" %)ΓÇ£ScriptNameΓÇ¥ is the name used for this script regardless of the file name. It (%%)**(% style="color: rgb(0,0,0);text-decoration: none;" %)has to start with an upper case letter and must be unique(%%)**(% style="color: rgb(0,0,0);text-decoration: none;" %) among all MD script names. It also should not contain spaces, so other MD scripts can use it as an identifier to access this scriptΓÇÖs contents easily.
86 86  
87 87  (% style="color: rgb(0,0,0);text-decoration: none;" %)The only allowed sub-node of <mdscript> is <cues>, which can only contain <cue> sub-nodes:
88 88  
89 -{{code}}&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;mdscript name=&quot;ScriptName&quot; ...&gt;  &lt;cues&gt;    &lt;cue name=&quot;RootCue1&quot;&gt; [...]    &lt;/cue&gt;    &lt;cue name=&quot;RootCue2&quot;&gt; [...]    &lt;/cue&gt;  &lt;/cues&gt;&lt;/mdscript&gt;{{/code}}
92 +{{code language="xml"}}
93 +<?xml version="1.0" encoding="utf-8"?>
94 +<mdscript name="ScriptName" ...>
95 + <cues>
96 + <cue name="RootCue1"> [...]
97 + </cue>
98 + <cue name="RootCue2"> [...]
99 + </cue>
100 + </cues>
101 +</mdscript>
102 +{{/code}}
90 90  
91 91  (% style="color: rgb(0,0,0);text-decoration: none;" %)┬á
92 92  
... ... @@ -118,7 +118,17 @@
118 118  
119 119  (% style="color: rgb(0,0,0);text-decoration: none;" %)This is how a cue node looks like:
120 120  
121 -{{code}}&lt;cue name=&quot;CueName&quot;&gt;  &lt;conditions&gt; [...]  &lt;/conditions&gt;  &lt;delay exact=&quot;5s&quot; /&gt;  &lt;actions&gt; [...]  &lt;/actions&gt;  &lt;cues&gt; [...]  &lt;/cues&gt;&lt;/cue&gt;{{/code}}
134 +{{code language="xml"}}
135 +<cue name="CueName">
136 + <conditions> [...]
137 + </conditions>
138 + <delay exact="5s" />
139 + <actions> [...]
140 + </actions>
141 + <cues> [...]
142 + </cues>
143 +</cue>
144 +{{/code}}
122 122  
123 123  (% style="color: rgb(0,0,0);text-decoration: none;" %)The rules for naming cues is the same for MD script names: The name **starts with an upper case letter**, and has to be (%%)**(% style="color: rgb(0,0,0);text-decoration: none;" %)unique within this file(%%)**(% style="color: rgb(0,0,0);text-decoration: none;" %). So it is actually possible to use the same cue name in different scripts, which is different from the MD in X3.
124 124  
... ... @@ -137,15 +137,35 @@
137 137  
138 138  (% style="color: rgb(0,0,0);text-decoration: none;" %)Example for an event condition:
139 139  
140 -{{code}}&lt;conditions&gt;  &lt;event_object_destroyed object=&quot;$target&quot;/&gt;&lt;/conditions&gt;{{/code}}
163 +{{code language="xml"}}
164 +<conditions>
165 + <event_object_destroyed object="$target"/>
166 +</conditions>
167 +{{/code}}
141 141  
142 142  (% style="color: rgb(0,0,0);text-decoration: none;" %)Example for an event condition with an additional (non-event) check:
143 143  
144 -{{code}}&lt;conditions&gt;  &lt;event_player_killed_object/&gt;  &lt;check_value value=&quot;event.param.isclass.turret&quot;/&gt;&lt;/conditions&gt;{{/code}}
171 +{{code language="xml"}}
172 +<conditions>
173 + <event_player_killed_object/>
174 + <check_value value="event.param.isclass.turret"/>
175 +</conditions>
176 +{{/code}}
145 145  
146 146  (% style="color: rgb(0,0,0);text-decoration: none;" %)Example for an event condition with two alternative events and a common additional check:
147 147  
148 -{{code}}&lt;conditions&gt;  &lt;check_any&gt;    &lt;event_cue_completed cue=&quot;Cue1&quot;/&gt;    &lt;check_all&gt;      &lt;event_player_killed_object/&gt;      &lt;check_value value=&quot;event.param.isclass.turret&quot;/&gt;    &lt;/check_all&gt;  &lt;/check_any&gt;  &lt;check_age min=&quot;$starttime&quot;/&gt;&lt;/conditions&gt;{{/code}}
180 +{{code language="xml"}}
181 +<conditions>
182 + <check_any>
183 + <event_cue_completed cue="Cue1"/>
184 + <check_all>
185 + <event_player_killed_object/>
186 + <check_value value="event.param.isclass.turret"/>
187 + </check_all>
188 + </check_any>
189 + <check_age min="$starttime"/>
190 +</conditions>
191 +{{/code}}
149 149  
150 150  (% style="color: rgb(0,0,0);text-decoration: none;" %)For more information about expressions and event parameters, see below.
151 151