Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Phaserbank on September 17, 2010, 12:06:03 pm

Title: reactor->turret lock
Post by: Phaserbank on September 17, 2010, 12:06:03 pm
just supose for a minute that there's a diablo and all four of its reactors got shot out. i would like to make a script that locks all of the beam turrrets in this situation, but i'm lost and any help would be appreciated.

Ive been looking through posted scripts and i havent seen anything that involves subsystems.
is there a variable to check like Ship.ReactorSubsystemLeft or something?



ths other things i should mention is that i am noob and when i try to use the deathflash script nothing happens.
 
Title: Re: reactor->turret lock
Post by: The E on September 17, 2010, 12:13:06 pm
Easy to do via sexps, no need to use lua scripts. Simply use
Code: [Select]
( when
    ( and
       ( is-subsystem-destroyed-delay <Ship name> <Reactor 1> 0 )
       ( is-subsystem-destroyed-delay <Ship name> <Reactor 2> 0 )
       ( is-subsystem-destroyed-delay <Ship name> <Reactor 3> 0 )
       ( is-subsystem-destroyed-delay <Ship name> <Reactor 4> 0 )
    )
   (beam-lock-all <ship name>)
)

As for the death flash script, don't use it; Rather copy the configuration data from the 3.6.12 MVPs and edit that for your own mod.
Title: Re: reactor->turret lock
Post by: General Battuta on September 17, 2010, 12:18:01 pm
Simply use is-subsystem-destroyed-delay in FRED. Like The_E said, no need for LUA whatsoever.
Title: Re: reactor->turret lock
Post by: Phaserbank on September 17, 2010, 12:24:07 pm
True, for a single ship but, honestly i'd like to add a bunch of subsystems like power relays, bridge, aux_power, life support and so on, and defining the effects as these susbsystems get damaged or destroyed is annoying to do for many ships in fred.   
Title: Re: reactor->turret lock
Post by: General Battuta on September 17, 2010, 12:26:08 pm
True, for a single ship but, honestly i'd like to add a bunch of subsystems like power relays, bridge, aux_power, life support and so on, and defining the effects as these susbsystems get damaged or destroyed is annoying to do for many ships in fred.   

Well, I'll just say that if I were you I'd definitely do it in FRED. It can be set up in a single event using a bunch of nested conditionals and a high trigger count. You can then copy-paste that event across mission files if you like.

A single event using a when-argument could cover every ship of that class in the mission.
Title: Re: reactor->turret lock
Post by: Phaserbank on September 17, 2010, 12:27:47 pm
Sir Yes Sir.
Title: Re: reactor->turret lock
Post by: General Battuta on September 17, 2010, 12:31:58 pm
Sir Yes Sir.

I swear it's less painful than it sounds. I can get you an example if you like.
Title: Re: reactor->turret lock
Post by: Phaserbank on September 17, 2010, 08:17:09 pm
That would be nice.