Author Topic: Vital flag for subsystem  (Read 2790 times)

0 Members and 1 Guest are viewing this topic.

Vital flag for subsystem
Hi,
I was wondering if there was a possibility to add a feature to subsystems, like a "vital explodes' and a "vital play dead" flag that would explodes or disable the whole parent ship when the subsystem is destroyed for example :

"Vital play dead" case :
I shoot a fighter , i target and destroyed it's 'cockpit' subsystem, as i have a "vital playdead" flag on the ship's subsystem  table well the pilots is killed so the IA does not move anymore (or continue on it's last vector/speed) if it's the player who was shot on its subsystem well he receive a game over.

"Vital explodes" case :
On a cap ship i have a "nuclear power plant" subsystem (that's just an example uh) and i want that when someone shoot that subsystem the entire capship goes to boom regardless it's remaining hitpoint.

I realize that it could be achieve in Fred via sexp , but having to do it for everyship and every mission would be quite... heavy.

I hope I've explain my self well  ;7
$Formula: ( every-time
   ( has-time-elapsed "0" )
   ( Do-Nothing
   )
   ( send-message
      "#Dalek"
      "High"
      "Pro-crasti-nate"
   )
   )
)
+Name: Procratination
+Repeat Count: 99999999999
+Interval: 1

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Vital flag for subsystem
You could do this in FRED with just one event, you know.  :nervous: I mean I know you know it can be done in FRED, you said that, but you don't even have to have a separate event for each ship.

 
Re: Vital flag for subsystem
oh right then , my request is already out of date .
$Formula: ( every-time
   ( has-time-elapsed "0" )
   ( Do-Nothing
   )
   ( send-message
      "#Dalek"
      "High"
      "Pro-crasti-nate"
   )
   )
)
+Name: Procratination
+Repeat Count: 99999999999
+Interval: 1

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Vital flag for subsystem
Your setup would be

when-argument
any-of
(a list of every ship you want to blow up when subsystem Reactor is destroyed)

subsystem-destroyed-delay
<argument> - this argument should go wherever the SEXP would normally take a ship name
0
Reactor

self-destruct (or sabotage-subsystem, hull, 100)
<argument>

invalidate-argument

Set trigger count to the number of ships that could possibly blow up this way.

 

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Skype
    • Twitter
    • Headdie on Deviant Art
Re: Vital flag for subsystem
notes taken and saved, thanks Battuta
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art

 
Re: Vital flag for subsystem
Thank you very much, i'm gonna try it.
$Formula: ( every-time
   ( has-time-elapsed "0" )
   ( Do-Nothing
   )
   ( send-message
      "#Dalek"
      "High"
      "Pro-crasti-nate"
   )
   )
)
+Name: Procratination
+Repeat Count: 99999999999
+Interval: 1

 

Offline Sushi

  • Art Critic
  • 211
Re: Vital flag for subsystem
Your setup would be

when-argument
any-of
(a list of every ship you want to blow up when subsystem Reactor is destroyed)

subsystem-destroyed-delay
<argument> - this argument should go wherever the SEXP would normally take a ship name
0
Reactor

self-destruct (or sabotage-subsystem, hull, 100)
<argument>

invalidate-argument

Set trigger count to the number of ships that could possibly blow up this way.

TIL a valuable FREDding trick.  :yes:

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Vital flag for subsystem
Now, this is almost entirely off-topic, but wouldn't it be great if a mod could define global mission events which would automatically get inserted into every mission played using that mod? :nervous: SEXP implementations of mod-wide gameplay mechanic changes like this might work great otherwise, but it's really unwieldy to copypaste the event into every mission you'll ever have in your mod.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: Vital flag for subsystem
You may use a template.
Just make a mission with every event you want to be used everywhere and import these events into each mission you make.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Vital flag for subsystem
You may use a template.
Just make a mission with every event you want to be used everywhere and import these events into each mission you make.

And what do you do when you need to fix or change something in that event, or add a new one, as you'd inevitably need to do?

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: Vital flag for subsystem
You'd have to do this manually, so it'd be good to test the template and make sure it contains everything you want.
Alternatively, use scripting.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Vital flag for subsystem
You'd have to do this manually, so it'd be good to test the template and make sure it contains everything you want.
Alternatively, use scripting.

Well... I guess that means you think it's a good idea then. Scripting is a whole new skillset to learn and it can't really do but a small part of what SEXPs can do.

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Vital flag for subsystem
You'd have to do this manually, so it'd be good to test the template and make sure it contains everything you want.
Alternatively, use scripting.

Well... I guess that means you think it's a good idea then. Scripting is a whole new skillset to learn and it can't really do but a small part of what SEXPs can do.
Scripting can to everything that SEXPs can do, by virtue of scripting able to call arbitrary SEXPs.  Unfortunately I don't recall the name of the function right now.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Vital flag for subsystem
Well... I guess that means you think it's a good idea then. Scripting is a whole new skillset to learn and it can't really do but a small part of what SEXPs can do.
Scripting can to everything that SEXPs can do, by virtue of scripting able to call arbitrary SEXPs.  Unfortunately I don't recall the name of the function right now.

I guess I should have said events, not SEXPs: scripts can't create mission events, and I'm not entirely sure if scripts can perfectly simulate event trigger conditionals by running mn.evaluateSEXP every frame. If they can, then yes, you're right. At that point you'd only need to figure out the undocumented and messy syntax for doing that.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Vital flag for subsystem
You'd have to do this manually, so it'd be good to test the template and make sure it contains everything you want.

However if you're sensible and make sure your templated sections are always in the same part of the mission file you could use something like winmerge to make copying them over easier.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Vital flag for subsystem
It should also be pretty simple to write a Lua script which goes and automatically adds the contents of a pre-defined file to missions/*.fs2 when the game starts (meaning you'd never have to copy the events around manually), but somehow I think people might not be comfortable with the risk of something going wrong.

  

Offline Tomo

  • 28
Re: Vital flag for subsystem
This thread has got me thinking that some kind of "Include Mission Chunk" option would be useful.

Not sure whether that ought to be FRED-side or on mission load - both have advantages and disadvantages.