Author Topic: Addons in save files  (Read 972 times)

Firstly, I did a search and nothing came up, which kind of surprised me so I probably didn't look hard enough.

Anyway, is there, or can there be, some kind of modification which when you select a save file in 'Load' GUI:
- Tells you what addons were used in the save
- Tells you what addons are not enabled/missing which are required for the save

It's not too difficult to keep track of addons used in, say, an RPG you made a week ago, but for complicated things made months ago it becomes an issue, especially if the lack of them will ruin whatever it is you saved.

If it's been suggested before, then consider this a re-bump. If not, then why not?


This would likely increase the save file size to well over 1mb if you have an RPG, but it wouldn't be very hard to do. Just run a loop to see all enabled add-ons in a server, and write them to a textfile, lets say addons.txt, or addons.tmp. After that, package the save function and add a fileobject that reads addons.txt, and copies it to a file in the saves folder, not the raw .blb, but a text file.

The folder would look something like
save1.bls save1.jpg save1.txt

Then, copy the contents of save1.txt into the description of the save, and run a loop with an if check that checks if the server has the add-ons enabled.

You're thinking way too hard. All you'd have to do would be to add a list of required add-ons to the beginning or end of the save file. Probably the beginning would work best.

Also, this would be best as a Blockland change, not a mod.

Recording what add-ons are required and writing them as part of the save will only really work for bricks, weapons, vehicles, etc, stuff that are actually included in the build.
For other things, especially add-ons that are just script, there's no way the game could reliably figure out which is required, so you'd have to record every add-on of that type, the large amount of which are entirely unneeded to run the save.

If you're making a gamemode, use forceRequiredAddon
« Last Edit: December 23, 2011, 03:25:59 PM by Headcrab Zombie »

Totally supporting this.

and im 100% sure this is possible.

If you load a save file, and there are missing custom bricks, you can check the console and it will let you know what bricks are missing. Then you can just download the brick pack that contains those bricks.

I'm not sure if the console tells you if there are any missing weapon spawns though.

If you load a save file, and there are missing custom bricks, you can check the console and it will let you know what bricks are missing. Then you can just download the brick pack that contains those bricks.

I'm not sure if the console tells you if there are any missing weapon spawns though.
It doesn't tell you anything except what bricks are missing, and even then it gives a simple brick name, not the name of the addon it originated from.

Either way, you don't want to trawl through the console to pick up a missing addon do you?

This would likely increase the save file size to well over 1mb if you have an RPG
- The .bls files store EVERY brick in text. They're not that large.
- All the addon, or indeed official implementation, needs to do is check what addons were loaded at the time and check which are used. By simply logging a single instance of a brick or weapon, the save would know from that what the addon was. No need to log every instance.

Who said anything about having to trawl through the console to check what bricks are missing?

I already mentioned that once you have the brick name, you should have an idea of what brick pack that missing brick belongs to.

Unless you took this save from someone else's server and are trying to host it yourself, because most of the time Gallery topics with saves list the required Add-Ons in the OP.

Just thought of something: There's a description box when saving, you could simply list everything there for reference.

Just thought of something: There's a description box when saving, you could simply list everything there for reference.
True, but automatic is better than manual, and sometimes you may use an addon without actually realising it is one (eg. a brick)

Recording what add-ons are required and writing them as part of the save will only really work for bricks, weapons, vehicles, etc, stuff that are actually included in the build.
For other things, especially add-ons that are just script, there's no way the game could reliably figure out which is required, so you'd have to record every add-on of that type, the large amount of which are entirely unneeded to run the save.

Loop through the file mask Add-Ons/*_*/description.txt, find the name of the parent folder and check if it's enabled with if( $AddOn__[ %parent_folder ] ).

Loop through the file mask Add-Ons/*_*/description.txt, find the name of the parent folder and check if it's enabled with if( $AddOn__[ %parent_folder ] ).
Everything the host has enabled =/= what is actually required

This is one of the best suggestions I've seen in a long time.
/support

Everything the host has enabled =/= what is actually required
True in far too many cases.
If you only use the P90pack alongside the default addons there is no reason to log the entirety of your addons list. Inconveniently, logging everything is exactly what the game does when loading up datablocks, hence the apparent freeze as it loads a ton of stuff.