Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Reprobator on March 10, 2011, 08:59:09 am
-
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
-
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.
-
oh right then , my request is already out of date .
-
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.
-
notes taken and saved, thanks Battuta
-
Thank you very much, i'm gonna try it.
-
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:
-
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.
-
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.
-
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?
-
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.
-
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.
-
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.
-
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.
-
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 (http://winmerge.org/) to make copying them over easier.
-
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.
-
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.