Seems it actually bug.
What I'm checking:
posibility to instantly signal a static child cue with parameters several times directly from its static parent cue.
Regarding the MD guide - it is possible, Several conditions must met for this:
1. All cues are static (no instances).
2. <signal_cue_instantly> must be used because there are other way to pass parameters to signalled cue.
3. Child cue must be in WAITING state while its root parent cue is in ACTIVATED state.
Now let's test condition 3 as the most unclear condition.
So, this is test script:
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<mdscript name="TestCueSet2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
<cues>
<!-- resets Cue1 on demand -->
<cue name="Cue0" instantiate="true">
<conditions>
<event_ui_triggered screen="'OptionsMenu'" control="''"/>
</conditions>
<actions>
<debug_text text="'triggered: Reset Cue1'" filter="scripts"/>
<reset_cue cue="Cue1"/>
</actions>
</cue>
<!-- The Cue which is tested -->
<cue name="Cue1" instantiate="false">
<conditions>
<event_ui_triggered screen="'DockedMenu'" control="''"/>
</conditions>
<actions>
<debug_text text="'activated'" filter="scripts"/>
<debug_text text="'[check 1] THIS state: %1'.[this.state]" filter="scripts"/>
<debug_text text="'[check 1] SubCue1 state: %1'.[SubCue1.state]" filter="scripts"/>
<signal_cue_instantly cue="Cue2"/>
<debug_text text="'[check 1] THIS state: %1'.[this.state]" filter="scripts"/>
<debug_text text="'[check 1] SubCue1 state: %1'.[SubCue1.state]" filter="scripts"/>
</actions>
<cues>
<cue name="SubCue1" instantiate="false">
<conditions>
<event_cue_signalled/>
</conditions>
<actions>
<debug_text text="'activated'" filter="scripts"/>
</actions>
<cues/>
</cue>
</cues>
</cue>
<!-- watcher of Cue1 -->
<cue name="Cue2" instantiate="false">
<conditions>
<event_cue_signalled/>
</conditions>
<actions>
<debug_text text="'activated'" filter="scripts"/>
<debug_text text="'Cue1 ext state: %1'.[Cue1.state]" filter="scripts"/>
<debug_text text="'SubCue1 ext state: %1'.[SubCue1.state]" filter="scripts"/>
<reset_cue cue="this"/>
</actions>
</cue>
</cues>
</mdscript>
In this test I check the condition 3: state of child static cue from its static parent root cue.
There are three cues defined:
Cue1/SubCue1 - are tested cues. Cue1 signalls its own child SubCue1.
Cue2 - just external watcher to get states of Cue1/SubCue2 from other root cue. Frankly speaking, it should be implemented as fully external watcher which is activated by separated event. not by Cue1 itself. There is no way to implement delay within <actions> so I can't implement true external watcher.
Cue0 - manual reset of Cue1 for further run of test.
What it does:
Cue1 is started by event and enters ACTIVATED state. At this time (regarding the MD guide) SubCue1 MUST enter WAITING state. So Cue1 prints states of itself and its child (expected states ACTIVATED/WAITING). After that Cue1 instantly signal Cue2, which get prints of Cue1/SubCue1 (expected states ACTIVATED/WAITING). After that Cue1 again prints states of itself and its child (expected states ACTIVATED/WAITING).
But logs show something quite different (I prepended each log line with sequential number):
Code: Select all
1 [Scripts] 2265175.68 *** Context:md.TestCueSet2.Cue1: activated
2 [Scripts] 2265175.68 *** Context:md.TestCueSet2.Cue1: [check 1] THIS state: active
3 [Scripts] 2265175.68 *** Context:md.TestCueSet2.Cue1: [check 1] SubCue1 state: disabled
4 [Scripts] 2265175.68 *** Context:md.TestCueSet2.Cue2: activated
5 [Scripts] 2265175.68 *** Context:md.TestCueSet2.Cue2: Cue1 ext state: active
6 [Scripts] 2265175.68 *** Context:md.TestCueSet2.Cue2: SubCue1 ext state: disabled
7 [Scripts] 2265175.68 *** Context:md.TestCueSet2.Cue1: [check 1] THIS state: active
8 [Scripts] 2265175.68 *** Context:md.TestCueSet2.Cue1: [check 1] SubCue1 state: disabled
Lines 1 and 2 shows that SubCue is still DISABLED after activation of Cue1. it isn't as expected. The same in lines 5/6 and 7/8. Child cue isn't in WAITING state while its root parent cue in is ACTIVATED state. It means, it is impossible to signal a child cue with paremeters directly from its root parent cue.
So... Whether it is a bug or a feature? What MD documentation say on this?