FreeSpace Releases > Scripting Releases

ship save/load script

<< < (17/18) > >>

Admiral MS:
Well, the script is more than 6 years old and I would do many things different today. Especially the limited length of a scripting call required several workarounds that are not necessary anymore.

Both of your suggestions don't seem to be hard to implement there is still the issue of backwards compatibility. All missions have to be changed, old savefiles might be broken,... People also use ScreenCam which comes with this script, so if the mod used an older version saving/loading might not work anymore.


The question is how many people use this script at all and if there is any real interest in an improved version. If yes then I would do the modifications...

Darius:
Your ship save script is amazing and the cornerstone of our checkpoint system, so there is at least one modding team that has an interest in anything you can do to improve it!

mjn.mixael:
Likewise. BtA makes heavy use of it.

Admiral MS:
BtA, BP and whatever Goober does are the projects using the script that I know of.

Goobers suggestions won't add any features or actual functionality to the script. It would just streamline how the script works internally and how it is used in FRED. This means that I have to change a lot and you would have to modify all missions with checkpoints.
My question is if there is any real need for these things. A reason could be that the script slows down the game due to too many savecalls or feature ideas/additions that would be easier to use/implement in a modified script. Otherwise it would just create work for me and the modding teams while the script was already fine before.

What I have in mind is a structure like:
openfile 'filename' (loads data from a file into temporary table, without 'name' just creates an empty table or clears the table)
saveship/savevar 'name' (saves shipdata/variable from mission in temporary table)
loadship/loadvar 'name' (loads shipdata/variable from temporary table into mission)
savefile 'filename' (saves temporary table in file)
removeship/removevar 'name' (removes shipdata/variable from temporary table)

Goober5000:
I'm using the script for two missions in Scroll of Atankharzim so far, and I will almost certainly use it for more.  One of these missions has two checkpoints and would have been quite intractable to playtest without the script.

Your proposed changes sound good.  They are not, strictly speaking, needed, since the script is very satisfactory already (especially now that you've fixed the variable saving).  But they would definitely be appreciated and would improve the ease-of-use of the script for future missions.

The deferred file writing would be welcome.  The complicated Scroll mission I mentioned has a noticeable freeze for about a half-second when a large checkpoint, involving lots of variables and ships, is saved.

I don't think you would need to worry about backwards compatibility.  Just create a new script with a new filename, and make sure that all the function calls are different from the old ones.  To make this obvious, you could use e.g. saveship2 rather than the original saveship.  You should not need to worry about the savefile format because presumably only newly released missions would use the new savefile.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version