Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Boomer20 on January 22, 2015, 04:02:13 pm

Title: Multiple Shipsaves in One Mission
Post by: Boomer20 on January 22, 2015, 04:02:13 pm
Hey Guys, so I'm in a bit of a pickle.
I'm using Admiral MS's shipsave/load script. So in my mission I have a checkpoint (which is working fine) and at the end I plan on saving the ship health of the friendlies etc to carry onto the next mission.
I know you can have other save files loaded up on follow up missions but is it possible to have multiple save files created and looked for on the one mission?

So you understand me a bit better, the second mission continues straight after the first so I want all the health and ammo etc to carry over. But at the same time I want the ability if say a user decides they want to replay the first mission that they don't have the checkpoint show up at the start because its detecting the shipsaves for the end of the mission which would just put everything into wack.

Would I be better off using Red Alert? Is it still buggy for some?

Hope this makes sense to anyone reading.
Title: Re: Multiple Shipsaves in One Mission
Post by: mjn.mixael on January 30, 2015, 08:48:24 pm
Oh yeah, you can definitely do this. Create a string variable called 'filename' if you haven't already. At the beginning of the mission, set it to whatever you want for the checkpoint system.

At the end of the mission (you can do this in a single SEXP), change 'filename' to something else like 'missionredalert' and then save the ship data. In the next mission, set 'filename' to the same thing like 'missionredalert' and then load the data. After that you can change 'filename' to whatever and still have a checkpoint in the second mission.
Title: Re: Multiple Shipsaves in One Mission
Post by: Boomer20 on January 31, 2015, 03:41:15 pm
Awesome. I take it I will have to campaign-persistent that variable.
The manual was a little confusing at that point and how it worked.
Title: Re: Multiple Shipsaves in One Mission
Post by: mjn.mixael on January 31, 2015, 04:29:53 pm
For 'filename'? You could, or you could just remember to set it for each mission what it's supposed to be. It's not like the string you choose will be dynamic based on how the player plays the mission.
Title: Re: Multiple Shipsaves in One Mission
Post by: Boomer20 on January 31, 2015, 04:39:05 pm
okay thanks mjn

In theory (though my fredding skills are not up to the caliber of this just yet.) could you set up multiple save variables that save different ships to then load there health and weapons etc into different mission say 3 or 4 missions down the track? Though I realise that this sort of scenario would be rare if not difficult to set up, I'm more thinking in the hypothetical. Or would their be an easier method to that.
Title: Re: Multiple Shipsaves in One Mission
Post by: mjn.mixael on January 31, 2015, 05:00:27 pm
I'm not clear on what that last question was, but here.

Admiral MS's shipsave script doesn't save anything to variables, really. It saves all the data to a file that it creates. So variables being campaign or player persistent in this case do not matter. You simple direct the shipsave script to the right file to load data from any point in time. Heck, you could save data in a mission in one campaign, start another campaign and load that same data there, all without the use of FRED variables to save any ship data.

You could do this in FRED variables (I'm pretty sure BP R1 and R2 did just that), but I see little point when this script is far, far superior and easier.
Title: Re: Multiple Shipsaves in One Mission
Post by: Boomer20 on January 31, 2015, 05:03:39 pm
Yeah you basically answered my question just then anyway.

Thanks for the help