Interrupt SIGNAL_ATTACKED on Stations

The place to discuss scripting and game modifications for X³: Reunion.

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

Post Reply
wwf4668
Posts: 13
Joined: Sat, 27. Mar 04, 18:48
x2

Interrupt SIGNAL_ATTACKED on Stations

Post by wwf4668 » Sun, 5. Apr 15, 23:16

Hi,
Just in case there is still anybody around.......
Trying to write a simple script that sends a message to the player logbook, whenever a factory/station of any race is under attack.

used a setup script with
$station->connect ship command/signal {SIGNAL_ATTACKED} to script 'myscript' with prio 100

on all stations and a 'myscript' with

$station = [THIS]
$attacker = $station->get attacker
play sample 929
write to player logbook: printf: fmt='Calling: %s, Attacker: %s', $station, $attacker,null,null, null

Nothing seems to happen. Thanks for any hings!

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 6. Apr 15, 02:05

the command you used is just for one Station ($station in your case, wich is probably an empty Var):

Code: Select all

$station->connect ship command/signal {SIGNAL_ATTACKED} to script 'myscript' with prio 100 
for your purpose you need this Command:
global script map: set key=<Object Command/Signal>, class=<Var/Class>, race=<Var/Race>, script=<Script Name>, prio=<Var/Number>
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

wwf4668
Posts: 13
Joined: Sat, 27. Mar 04, 18:48
x2

Post by wwf4668 » Mon, 6. Apr 15, 10:03

Wow, I'm quite amazed that I still got an answer :) . Thanks a lot! So the good news is, the signal should in principle run on stations, right?

I should have explained that part better. The setup script runs over a loop over every station in every race sector not xenon or khaak. Actually I've put the '..connect ship command..' line into lv's "race response fleets" setup script for stations and I'm pretty sure that the line gets executed since it also starts lv's station response script which does run on every station.

But I've also tried your suggestion. And put

Code: Select all

global script map: set: key={SIGNAL_ATTACKED}, class={Station}, race={Paraniden}, script='myscript' , prio=100
into a seperate setup script (my own stuff, from which I know that it is beeing executed on everey game load). I've used the race={Paraniden} since thats where I'm testing it with a little argon fighter attack fleet.

Still, nothing happens :(

Is there any way to see which script is connected to the SIGNAL_ATTACKED? maybe it's overwritten, by some other setup script.

Thanks again for any more hints!

Post Reply

Return to “X³: Reunion - Scripts and Modding”