I want an event so that when you scan a ship, a message is sent, the ship is disabled. The ship being disabled triggers a second event that causes the ship to self destruct (so it self destructs a couple of second after the message has been sent). I want this to happen everytime one of a series of ships is scanned.
I tried this like this:
$Formula: ( every-time-argument
( any-of
"Red 1"
"Red 2"
"Red 3"
"Red 4"
"Red 5"
"Red 6"
"Blue 1"
"Blue 2"
"Blue 3"
"Blue 4"
"Blue 5"
"Blue 6"
)
( and
( is-cargo-known-delay 1 "<argument>" )
( not
( is-disabled-delay 0 "<argument>" )
)
)
( invalidate-argument "<argument>" )
( send-random-message
"<argument>"
"High"
"Panic 1"
"Panic 2"
"Panic 3"
"Panic 4"
"Panic 5"
"Panic 6"
)
( sabotage-subsystem
"<argument>"
"engine"
101
)
)
+Name: Raider scanned
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( every-time-argument
( any-of
"Red 1"
"Red 2"
"Red 3"
"Red 4"
"Red 5"
"Red 6"
"Blue 1"
"Blue 2"
"Blue 3"
"Blue 4"
"Blue 5"
"Blue 6"
)
( and
( is-cargo-known-delay 3 "<argument>" )
( not
( is-destroyed-delay 0 "<argument>" )
)
)
( invalidate-argument "<argument>" )
( self-destruct "<argument>" )
)
+Name: Raider Dies
+Repeat Count: 1
+Interval: 1
+Team: 0
The problem I have is that while scanning a ship causes it to first be disabled and then destroyed as I want, the random message is sent over and over again without stopping. I put the not disabled/not destroyed sexps in to the events in an attempt to stop this. This didn't fix the message problem, but did result in the ship self-destructing (which previously it didn't, though it did become untargettable as if it had been destroyed but it never actually exploded).
I tried replacing the message sexp with one that updated a variable to be equal to 1, and having a third event (using the everytime conditional) that checked the value of the variable, sent a message and then reset the variable to 0. The message was never sent.
Can anyone see what I've done wrong?
I'm using the 3.6.5 build of the SCP (the last official release version) with TBP.