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!
Interrupt SIGNAL_ATTACKED on Stations
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
the command you used is just for one Station ($station in your case, wich is probably an empty Var):
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>
Code: Select all
$station->connect ship command/signal {SIGNAL_ATTACKED} to script 'myscript' with prio 100
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
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
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
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!
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
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!