Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Speshal on January 18, 2007, 04:44:06 am

Title: Global sabotage
Post by: Speshal on January 18, 2007, 04:44:06 am
Okay here's one for you lot, I've got a mission where there's a large convoy with a few friendly fighter wings.  I've created a sort of EMP bomb that when gets destroyed will disable every ship in the mission.  To do this I've coded a sabotage weapons and engines sexp for when the bomb detonates.  Trouble is I've now got to do this for every ship in the mission which will take too long.

Is there anyway I can do this without making an event for every ship?
Title: Re: Global sabotage
Post by: karajorma on January 18, 2007, 04:53:12 am
Using FS2_Open this is a lot easier

when-argument
-every-of
-List of ships
-true                 <-----------------------Replace with your event trigger SEXPs
-set-subsystem-strength
--<argument>
--Weapons
--0
-set-subsystem-strength
--<argument>
--Engines
--0


You may have to do a bit of cutting and pasting to get it to accept those subsystems once you change the ship name to <argument> but it will work in game for any ship which has a subsystem called engines. You may also need to have a seperate event/events for ships with subsystems called engine 1 etc.

Either way this is still easier than doing it manually for every ship most likely. At the very least you can handle all the fighters with one event.
Title: Re: Global sabotage
Post by: Turey on January 18, 2007, 05:20:30 am
Also, you can open a .fs2 in notepad and mass copy events, but that's a bit harder.
Title: Re: Global sabotage
Post by: Speshal on January 18, 2007, 06:23:06 am
Using FS2_Open this is a lot easier

when-argument
-every-of
-List of ships
-true                 <-----------------------Replace with your event trigger SEXPs
-set-subsystem-strength
--<argument>
--Weapons
--0
-set-subsystem-strength
--<argument>
--Engines
--0


You may have to do a bit of cutting and pasting to get it to accept those subsystems once you change the ship name to <argument> but it will work in game for any ship which has a subsystem called engines. You may also need to have a seperate event/events for ships with subsystems called engine 1 etc.

Either way this is still easier than doing it manually for every ship most likely. At the very least you can handle all the fighters with one event.

Excellent job that did it!  You're the man :)