[Question] SETA-related events in MD
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
[Question] SETA-related events in MD
Hi, community and scripting experts.
I would like to perform some actions via a Mission Director script when SETA is activated/deactivated. I checked all X4 built-in scripts as weel as all *.XSD but there are no any SETA-related events. Is there a way to capture them in MD?
Thank you.
I would like to perform some actions via a Mission Director script when SETA is activated/deactivated. I checked all X4 built-in scripts as weel as all *.XSD but there are no any SETA-related events. Is there a way to capture them in MD?
Thank you.
-
- Posts: 65
- Joined: Sat, 14. May 16, 22:13
Re: [Question] SETA-related events in MD
i think you can do it like this:
but this will fire every second... as long as SETA is active
but this will fire every second... as long as SETA is active
Code: Select all
<cue name="JP_TestMod_MD" instantiate="true" checkinterval="1s">
<conditions>
<check_value value="player.timewarp.active"/>
</conditions>
<actions>
<show_help custom="'TEST'" duration="1s"/>
</actions>
</cue>
Re: [Question] SETA-related events in MD
At a glance, it looks like there are "setaActivated" and "setaDeactivated" events available in lua. See "Crosshair Handling.lua" for code that listens to these events. If you can hook into that, then you can set up the signals for md cues.
-
- EGOSOFT
- Posts: 13093
- Joined: Sat, 9. Nov 02, 11:45
Re: [Question] SETA-related events in MD
There's not an event and no, you can't hook into that UI event from MD unless you want to try modding a new UI event.
As it's a simple enough check, just having a cue check every frame if the 'player.timewarp.active' value has changed is probably good enough.
As it's a simple enough check, just having a cue check every frame if the 'player.timewarp.active' value has changed is probably good enough.
Code: Select all
<cue name="SETA_Toggled" instantiate="true" checkinterval="1ms">
<conditions>
<check_value value="not $SETA_Active? or player.timewarp.active != $SETA_Active"/>
</conditions>
<actions>
<set_value name="$SETA_Active" exact="player.timewarp.active" comment="Save the new state"/>
<do_if value="$SETA_Active">
<signal_cue cue="SETA_Activated" comment="Signal the cue which deals with activating SETA"/>
</do_if>
</actions>
</cue>
<cue name="SETA_Activated" instantiate="true">
<conditions>
<event_cue_signalled/>
</conditions>
<actions>
<debug_text text="'SETA was activated'"/>
</actions>
</cue>
Come watch me on Twitch where I occasionally play several of the X games
-
- Posts: 158
- Joined: Fri, 12. Jul 19, 14:03
Re: [Question] SETA-related events in MD
If you were going to check on an interval then I think 1ms is a bad idea but vanilla gets it this way:Xenon_Slayer wrote: ↑Wed, 6. Nov 19, 20:37There's not an event and no, you can't hook into that UI event from MD unless you want to try modding a new UI event.
As it's a simple enough check, just having a cue check every frame if the 'player.timewarp.active' value has changed is probably good enough.
Code: Select all
<cue name="SETA_Toggled" instantiate="true" checkinterval="1ms"> <conditions> <check_value value="not $SETA_Active? or player.timewarp.active != $SETA_Active"/> </conditions> <actions> <set_value name="$SETA_Active" exact="player.timewarp.active" comment="Save the new state"/> <do_if value="$SETA_Active"> <signal_cue cue="SETA_Activated" comment="Signal the cue which deals with activating SETA"/> </do_if> </actions> </cue> <cue name="SETA_Activated" instantiate="true"> <conditions> <event_cue_signalled/> </conditions> <actions> <debug_text text="'SETA was activated'"/> </actions> </cue>
Code: Select all
<cue name="Mode_SETA" instantiate="true">
<conditions>
<event_object_signalled object="player.entity" param="'startactivity'" param2="activity.seta" />
</conditions>
-
- EGOSOFT
- Posts: 13093
- Joined: Sat, 9. Nov 02, 11:45
Re: [Question] SETA-related events in MD
Right, I forgot this is an activity now.
As for 1ms checks, that essentially just means check each frame because you ain't gonna have the game running in less that 1ms. And it's a simple call to make for one frame.
As for 1ms checks, that essentially just means check each frame because you ain't gonna have the game running in less that 1ms. And it's a simple call to make for one frame.
Come watch me on Twitch where I occasionally play several of the X games
Re: [Question] SETA-related events in MD
Yes, I found this in built-in scripts:
to catch deactivation of SETA. But is there a way to get reason on deactivation? I mean is there a way to know whether SETA was disabled by player or by side-event like notification ans something else?<event_object_signalled object="player.entity" param="'stoptactivity'" param2="activity.seta" />