gruppe-adler / grad-persistence

Save/Load mission progress in server's profileNamespace
26 stars 13 forks source link

[question] Is it possible to save objects based on variables applied to them? #45

Open Elvensbane opened 3 years ago

Elvensbane commented 3 years ago

As title says, I'm wondering if its possible to adapt the save mechanics that already exist to make it save ONLY things with a specific variable? Would I be able to enable Grads-Fortification support in Grads-Persistence and trick it into saving objects by perhaps adding the exact same variables to placed objects?

Elvensbane commented 3 years ago

I did a dirty trick by finding all 5,6k entries of createvehicle and added [this] call grad_persistence_fnc_blacklistObjects; to each of them, then not putting it on player spawned vehicles / objects to only save the vehicles / objects they placed and interacted with. This worked, but was a lot of work. Is there easier method on the future?

McDiod commented 3 years ago

There is no whitelisting, but if all you are trying to do is to only save objects that were created during the mission, read this:

https://github.com/gruppe-adler/grad-persistence/wiki/saving-objects#values

E.g. saveVehicles = 3; will only save vehicles that were not present on mission start.

Elvensbane commented 3 years ago

I ended up doing that, coupled with making every instance of createVehicle have a grad_persistence_fnc_blacklistObjects directly under it, the FPS is stable and incredibly smooth doing 3 on the vehicles and static objects.