I dig the downedpilot idea so I went way overboard and edited the one angster created and TyphoonFr/Gunner98 modified.
I have tested it a fair amount, works well so far, and all events/triggers/actions/refpoints seem to get deleted as needed. I'm sure there is something wrong with it that I just haven't found yet.
- survivor instead of pilot as any unit can have a survivor (ships or AC, probably ground units but that is not tested)
- configurable number of survivors based on unit subtype (set in event action)
- configurable max speed and altitude for pickup - ie rescue unit must be below 100 ft and 10 kts (subs must be surfaced)
- configurable success and failure scores, which are multiplied by number of survivors - this is scary, out of control if there are lots of survivors. Could be much worse than the unit lost point penalty. I kinda think the success points should be 0, and the failure points 1. Though its all relative to the other point awards/penalties.
- survivor unit is a life raft if over water, ground unit if on ground (actual dbids are configurable, beware the type). All survivors of a given unit are represented by that one unit
- survivor unit is set to a configurable neutral side - which must exist (needed to allow pickup by different types of units)
- configurable time it takes to rescue each survivor.
- configurable crew survival percent for multi crew units. Can be used in tandem with the trigger firing percentage likelihood
- enhanced survivor message
- survivor time to live is set to a random time between 30 minutes and 30 hours. Hard coded but could be made more easily configurable
Most of the configuration is at the top of the main script. The action for creating the survivor has the configuration for the number of crew/passengers for a given subtype. Subtypes are like MPA or AWAC though I do not have much info on what they all are. To find them there is a function you can run from the lua console to show the OOB and that is modified to show the subtype of each unit next to its name - GetOOBWithSubType().
The number of crew/passengers/possible survivors is passed into the Create Survivor action like so:
local crew = 1 --default
ScenEdit_UnitX().subtype == '6001' then crew = 3
ScenEdit_UnitX().subtype == '6002' or ScenEdit_UnitX().subtype == '3101' then crew = 12
ScenEdit_UnitX().subtype == '7101' then crew = 75 -- C5 Galaxy?
ScenEdit_UnitX().subtype == '3106' then crew = 350 --CG
ScenEdit_UnitX().subtype == '4002' then crew = 0 -- E3 Sentry testing 0 crew, should be no survivors
If you only want 1 possible survivor then you can just have:
The survivor side should be set to friendly for the player side and neutral for the enemy side. If the enemy side is hostile, they may kill the unit, which is not covered - so none of the triggers/actions/events will get deleted if that happens.
This is probably a little too much, but it was fun to play with.
The scen attached has been updated 08/15/2018, fixed a few things like planes on the ground triggering survivors.
Any further updates will be on the post below:
< Message edited by Whicker -- 8/16/2018 3:23:42 AM >