help with: signalled cue has no corresponding listeners

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

help with: signalled cue has no corresponding listeners

Post by kuertee »

can anyone help me, please, with this error message "Signalled cue md.MyScript.Init has no corresponding listeners"? what does it mean?
the error comes up only when it is first signalled. subsequent signals to the cue doesn't produce the error.

the error occurs on the lines shown in the code below.
Spoiler
Show

Code: Select all

... SNIPPED ...
<cues>
  <cue name="MyScript" namespace="this">
    <conditions><check_any><event_game_started /><event_game_loaded /></check_any></conditions>
    <actions>
        ... SNIPPED ...
        <signal_cue cue="Init" /><!-- ERROR here. This is line 13 as listed by the error message shown at the end of this post. -->
    </actions>
    <cues>
        <cue name="Init" instantiate="true">
            <conditions><event_cue_signalled /></conditions>
            <actions>
              <debug_text text="'inited'" />
              ... SNIPPED ...
            </actions>
        </cue>
        <cue name="GameRestartedOrReLoaded">
          <conditions><check_any><event_game_started /><event_game_loaded /></check_any></conditions>
          <actions>
            ... SNIPPED ...
            <signal_cue cue="Init" /><!-- NO ERROR here -->
          </actions>
        </cue>
        ... SNIPPED ...
        <cue name="CleanUp">
          <conditions>... SNIPPED ...</conditions>
          <actions>
            ... SNIPPED ...
            <signal_cue cue="Init" /><!-- NO ERROR here -->
          </actions>
        </cue>
    </cues>
  </cue>
</cues>
...
the error on the debuglog looks like this:
note that the signalled cue, Init, still executes AFTER that error message. weird.

Code: Select all

[Scripts] 327863.96 *** Context:md.MyScriptMD.MyScript: 
[General] 327863.96 ======================================
[=ERROR=] 327863.96 Error in MD cue md.MyScriptMD.MyScript: Signalled cue md.MyScriptMD.Init has no corresponding listeners
* Expression: Init
* Action: <signal_cue>, line 13
[General] 327863.96 ======================================
[Scripts] 327863.96 *** Context:md.MyScriptMD.Init<inst:871434>: inited
SirNukes
Posts: 549
Joined: Sat, 31. Mar 07, 23:44
x4

Re: help with: signalled cue has no corresponding listeners

Post by SirNukes »

You are signalling a cue that hasn't been created.
- MyScript condition is met
- actions run
- Init error because what is this?!
- subcues are set up
- Init comes into existence

Consider that in some cases the subcues will depend on variables set up in their parent actions (eg. for checkdelay value), so actions are processed first by default. One option would be to put a delay before the actions to make them get processed second (caveat: the actions won't fire while the game is paused in this case, since delay is in game time). A better solution for your situation is to create a non-instanced subcue with no condition, which then signals Init.
kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Re: help with: signalled cue has no corresponding listeners

Post by kuertee »

Thanks! That worked - on new game starts and on saved game reloads (regardless on whether the mod was previously active or not).
I also removed the cue for game started or game loaded and added their relevant conditions to Init instead.

Code: Select all

... SNIPPED ...
<cues>
  <cue name="MyScript" namespace="this">
    <delay exact="5s" />
    <actions>
        ... SNIPPED ...
        <signal_cue cue="Init" /><!-- NO ERROR. -->
    </actions>
    <cues>
        <cue name="Init" instantiate="true">
            <conditions><check_any><event_cue_signalled /><event_game_started /><event_game_loaded /></check_any></conditions>
            <actions>
                <debug_text text="'inited'" />
                ... SNIPPED ...
            </actions>
        </cue>
        ... SNIPPED ...
    </cues>
</cues>
... SNIPPED ...

Return to “X4: Foundations - Scripts and Modding”