FreeSpace Releases > Scripting Releases

ship save/load script

<< < (4/18) > >>

Admiral MS:
Finally finished the script.

There are 4 functions usable with script-eval in fred:

saveship('shipname')
saves the data of a ship to the savefile

deleteship('shipname')
deletes the data of a ship out of the savefile

deleteshipsavefile()
obvious

loadship('shipname')
loads the saved data of a ship into the game, has a number of optional arguments besides the standard use which tell the script what data and how to load the data.
For shipnames too long for the characterlimit in script-eval there is an option to load the shipname from a variable defined in fred.

An explanation of the features is in the readme.txt or you can just ask me here if it's hard to understand. I was trying to make the use really simple but somehow after reading my readme it feels complicated.

Download:
http://www.mediafire.com/?3bc31gfn2c2k9vw

The .zip contains two missions as example, the script and a readme. It is now in a .tbm enabling the modular use everyone likes ;) and no more parts of the script are in #Global Hooks.

I tested everything I could think of in 3.6.12 but if you encounter any problems just report it in this thread.

General Battuta:
It feels like my era is over as soon as it came. What place is there for a FREDder with these brilliant new minds and their 'scripts'?

Admiral MS:

--- Quote from: General Battuta on February 25, 2011, 04:55:26 pm ---It feels like my era is over as soon as it came. What place is there for a FREDder with these brilliant new minds and their 'scripts'?

--- End quote ---

A lot of places after all... Considering that I'm working on my campaign for many years and the only things of it i actually finished are 5 missions which are of no use unless i finish the others and this script that may never see the light of the day inside the campaign i made it for   :sigh:

Nuke:
there still needs to be mission designers. this script really just means they have new toys to play with. this is one of the reasons ive always tried to push for mission-embedded scripts so that missions could include scripting without needing any other external tables or scripts, and that scripted missions may be validated for multi and not require mods to run.

also a note for functions that are to be called from sexp, i helps to keep arguments and function names as short as possible, because, iirc, you are limited to 32 byte strings. i usually just use a proxie function to allow a shorthand version that can be used if you need a lot of arguments or long arguments (some ships have really long names), it might call for a series of functions or globals to be set before calling the function to do the job. but in this case i think it should be enough space.

General Battuta:
Yeah I am pretty much joking cats

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version