Changes for page Mission Director Guide

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

From version 31071.1
edited by Daniel Turner
on 2023/04/14 17:02
Change comment: There is no comment for this version
To version 31075.1
edited by Daniel Turner
on 2023/04/14 17:13
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}}<?xml version="1.0" encoding="utf-8"?><mdscript name="ScriptName" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">{{/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  
... ... @@ -147,15 +147,35 @@
147 147  
148 148  (% style="color: rgb(0,0,0);text-decoration: none;" %)Example for an event condition:
149 149  
150 -{{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}}
151 151  
152 152  (% style="color: rgb(0,0,0);text-decoration: none;" %)Example for an event condition with an additional (non-event) check:
153 153  
154 -{{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}}
155 155  
156 156  (% style="color: rgb(0,0,0);text-decoration: none;" %)Example for an event condition with two alternative events and a common additional check:
157 157  
158 -{{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}}
159 159  
160 160  (% style="color: rgb(0,0,0);text-decoration: none;" %)For more information about expressions and event parameters, see below.
161 161  
... ... @@ -173,11 +173,21 @@
173 173  
174 174  (% style="color: rgb(0,0,0);text-decoration: none;" %)Check conditions every 5 seconds, but start checking only 1 hour after game start.
175 175  
176 -{{code}}&lt;cue name=&quot;Foo&quot; checktime=&quot;1h&quot; checkinterval=&quot;5s&quot;&gt;  &lt;conditions&gt;  [...]&lt;/cue&gt;{{/code}}
209 +{{code language="xml"}}
210 +<cue name="Foo" checktime="1h" checkinterval="5s">
211 + <conditions>
212 + [...]
213 +</cue>
214 +{{/code}}
177 177  
178 178  (% style="color: rgb(0,0,0);text-decoration: none;" %)Check conditions 3 seconds after the cue is enabled, and cancel the cue in case of failure.
179 179  
180 -{{code}}&lt;cue name=&quot;Foo&quot; checktime=&quot;player.age + 3s&quot; onfail=&quot;cancel&quot;&gt;  &lt;conditions&gt;  [...]&lt;/cue&gt;{{/code}}
218 +{{code language="xml"}}
219 +<cue name="Foo" checktime="player.age + 3s" onfail="cancel">
220 + <conditions>
221 + [...]
222 +</cue>
223 +{{/code}}
181 181  
182 182  (% style="color: rgb(0,0,0);text-decoration: none;" %)(% style="color: rgb(0,0,0);text-decoration: none;" %)(% style="color: rgb(0,0,0);text-decoration: none;" %)The attributes //onfail//, //checkinterval//, //checktime// are not allowed for cues with event conditions.
183 183  
... ... @@ -197,11 +197,15 @@
197 197  
198 198  (% style="color: rgb(0,0,0);text-decoration: none;" %)The <actions> node contains the actions that are performed one after another, without any delay inbetween. You can enforce a delay after activation of the cue and actual action performance, using a <delay> node right before the <actions>:
199 199  
200 -{{code}}&lt;delay min=&quot;10s&quot; max=&quot;30s&quot;/&gt;{{/code}}
243 +{{code language="xml"}}
244 +<delay min="10s" max="30s"/>
245 +{{/code}}
201 201  
202 202  (% style="color: rgb(0,0,0);text-decoration: none;" %)Note that during the delay the cue is already in the active state, and the sub-cues have been enabled! If you want to make sure that a sub-cue only becomes active after this cue is complete, there is a useful event condition for that:
203 203  
204 -{{code}}&lt;event_cue_completed cue=&quot;parent&quot;/&gt;{{/code}}
249 +{{code language="xml"}}
250 +<event_cue_completed cue="parent"/>
251 +{{/code}}
205 205  
206 206  (% style="color: rgb(0,0,0);text-decoration: none;" %)<actions> is optional. Leaving it out may be useful if you only want to enable sub-cues after the cueΓÇÖs condition check. The state transition from active to complete will still take the <delay> node into account.
207 207  
... ... @@ -209,8 +209,18 @@
209 209  
210 210  (% style="color: rgb(0,0,0);text-decoration: none;" %)Example, which selects one of the three texts randomly:
211 211  
212 -{{code}}&lt;actions&gt; &lt;do_any&gt;   &lt;debug_text text=&quot;'Hello world'&quot;/&gt;   &lt;debug_text text=&quot;'Welcome to the MD'&quot;/&gt;   &lt;debug_text text=&quot;'And now for something completely different'&quot;/&gt; &lt;/do_any&gt;&lt;actions&gt;{{/code}}
259 +{{code language="xml"}}
260 +<actions>
261 + <do_any>
262 + <debug_text text="'Hello world'"/>
263 + <debug_text text="'Welcome to the MD'"/>
264 + <debug_text text="'And now for something completely different'"/>
265 + </do_any>
266 +<actions>
267 +{{/code}}
213 213  
269 +
270 +
214 214  {{note body="<span style=~"color: rgb(0,0,0);text-decoration: none;~">Messages printed with &lt;debug_text&gt; are usually only visible when the ΓÇ£scriptsΓÇ¥ debug filter is enabled, see [[NULL|Script debug output]].</span>"/}}
215 215  
216 216