Page MenuHomeFeedback Tracker

Option Export and Import items to binary
Assigned, UrgentPublic

Description

I've seen a lot of mods, which are trying to implement some kind of item storage, which does not want to rely on the peristence file storage.
Ranging from simple approaches like storing itemname, health and quantity, to trying to support every single mod out there to function with the mod they try to create.

I would love to see a feature, which allows to store items the same way CE saves them in the persistence Files. Maybe add one requirement like items must not have a parent object (if that would make things easier)

So the idea is there is a bool WriteObjectToFile(Object item, FileHandle handle); which writes the (same) binary data to the File like CE does. For example write a Car or BaseBuilding Objects with all their attachments and Cargo to a file. Having the filehandle in the parameters would allow the scripter to call the method multiple times to store more than one item in the file. The bool could return if the Object was written successfully.

And to get the Item / Object back later, add something like bool ReadObjectFromFile(out Object obj, FileHandle handle, vector pos = vector.Zero);. That could be used to spawn the item back into the World with the optional Parameter to spawn it at a certain position or even with the same Flags we can use in the CreateObjectEx method to have some control where the item should spawn. Or not pass the parameter and spawn it back at the original Position.

Just a small list of use cases and Mods, that would really benefit of this feature:

...

I think many modders would really appreciate such functionality, because it saves them the hussle with spawning each item properly and handling edge cases like weapon spawning and all the other 3rd Party mod additions, which would need to be saved

Details

Severity
Feature
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

LBmaster created this task.Dec 16 2022, 2:07 PM

That would really be a great performance gain (both client / server), especially on community servers with large bases.
By saving items / containers with my Virtual Storage Mod, i am able to have a no-wipe strategy running since Oktober 2020!

Geez changed the task status from New to Assigned.Dec 22 2022, 12:05 PM

i will love it.

inkihh added a subscriber: inkihh.Mar 12 2024, 8:47 AM

This would be awesome