Edit: Beta 1.2 out, just minor fixes.
Hey all!
So we all know that persistent campaigns à la Resistance in OFP are damned cool: you have to keep your men and weapons handy and at good health, conserve your resources and otherwise act in a way that is quite different from your average single-mission/campaign modus operandi. I mean, what does it matter if your whole platoon is wiped out in one mission: they'll be right back in the next, eh? Not so in a persistent campaign! However, figuring out how the different saveStatus and saveIdentity and saveVar commands all work is not as easy as it seems.
So to ease the creation of, I'm sure, many new and nice persistent campaigns to be made, I've created a little script suite that should make each mission-editor's life a bit easier. It's ugly, it's pretty undocumented, but it works. Attached is the Beta 1, which I hope can be improved on pending suggestions by you good forum-browsers. It verifiably works, as you can see by the demo campaign (a three-mission 'campaign' that really contains a starting mission + two missions that loop around forever).
Features:
- Comprehensive campaign saving over and beyond default BIS saveStatus/Identity commands:
- Uses saveStatus/saveIdentity to retain each soldier's and vehicle's damage levels, ammo levels and identity: can also be used to persistently keep vehicles 'dead' and load them 'dead' in the next mission.
- Separate scripts save the units' position, velocity, vector up and vector dir (=you can save while flying in the air and load at the exact same speed/velocity/vector etc.)
- Group saving script saves each group member's vehicle and vehicle role (gunner, commander, in cargo etc.), and allows you to load it in the next mission exactly as you left it.
- Various options for how much to load whenever loading (with or without vehicles, at their previous position or somewhere else etc.)
- Uses global variables to store the data needed: you can have as many "saves" as you want to of your units! (in the demo campaign, save your group with radio 0-0-0, which corresponds to a different global variable, end the mission, and then use radio 0-0-9 to load your previous position/status! Note: some restrictions apply)
Setup:
It DOES require some know-how to set up properly, but if you can create a campaign description.ext, then you should be able to handle these scripts. The readme contains step-by-step instructions for how to apply it to your own mission: you can also
Readme + more instructions available in the .rar. Just extract the RUG_Campaign_Beta1 folder into your Arma\Campaigns folder and it will show up with the rest of your campaigns. Enjoy!
(small note concerning personal weapons & their ammo: you will notice you have "reloaded" your gun after each mission IF you have the ammo for it: just drop all your extra mags to find out that saveStatus and loadStatus really DOES save each individual bullet. It also does this for the vehicles [and their fuel status, and localized damage etc. etc.])
Extra disclaimer: NOT tried with mods like HWM or ACE : use at your own risk! (I suspect it should work fine, except that the content of the rucksacks and the like might not compute. Untested, as noted).
NEW VERSION Beta 1.1:
Version History
Beta 1
-first release
Beta 1.1
- Fixed slight player-saving error that would sometimes prevent the player from being saved when inside a vehicle (just forgot a saveVar)
- Added some stuff to the demo campaign
Beta 1.2
- Fixed error in loadVeh.sqf which would prevent proper vectorUp and vectorDir from being applied (using setpos nullified them, so I just moved the setpos to happen before the setvectordirandup)
- Allow the loadGrp.sqf script to also load class "Static" objects (i.e, houses, sandbag walls..) without throwing up an error -> does not work very well with all objects that have the setpos getpos bug (=if you setpos the object on its own getpos repeatedly, it will move across the map), leading to the object becoming sunk into the ground, moving around, etc. Also does not play nice if the object is destroyed -> in most cases it will simply not show up (static objects like houses that cause ruins will not load the ruins, since they're not the same object any longer). In some cases like radio masts, where the destruction is animated, the building shows up in a destroyed state without problems.
Wolfrug out.