Open Oldru opened 3 years ago
is this always the same attachment? if so use a CBA class init eventhandler so it runs when the vehicle spawns and reattaches stuff.
if only for specific vehicles of that type you can store a variable on the vehicle to check before.
in short: this can be handled without persistence i presume.
it's more I don't want certain objects to save, however, if I blacklist them then they won't load at all.
as an example, if I blacklist the cargo net box class name, if I attach a box to a truck and save the mission. then load the mission the box won't load at all and won't even appear in the mission as if it never existed. I did some testing before I posted this question.
I'm not sure I understand the question correctly. grad-persistence can obviously only load what it has previously saved.
Attached objects are not supported, so an object that was attached to something before saving, will be loaded at the last position, but unattached.
What you can do is:
[this] call grad_persistence_fnc_blacklistObjects;
[this, oldru_veh1] call BIS_fnc_attachToRelative;
grad-persistence will then use the editor placed vehicle instead of spawning a new one when loading. The attached walls will not be saved, but will be attached to the vehicle before grad-persistence loads the vehicle's position.
In theory this should work. If it doesn't, your walls were probably not attached before grad-persistence loaded the mission. In that case, use missionWaitCondition, e.g.:
missionWaitCondition = "(missionNamespace getVariable ['CBA_missionTime',0]) > 10";
Would it be possible to support attached Objects or is this not a good idea due to mods using attachTo to simulate cargo inside (e.g. ACE)?
Should be possible by nesting the attached objects in the parent object's save data, so
attachedObjects
and arrayIntersect
with ace_cargo_loaded
When loading, re-attach normal objects manually and ace_cargo objects with ace_cargo_fnc_loadItem.
However I'm sure there are other mods or user created scenarios that would need to be accounted for, so I'm hesitant to implement this.
I got the chance to test what you suggested and it still makes the wall/box just disappear on mission load
I also have a video to show what I mean this time. https://youtu.be/oByOy6dZCxY
I know that you can blacklist objects via class name and variable names, but is there any way to have an object not saved but still loaded on the next load?
EX: a vic that has some walls attached to it via attachTo and I don't want the walls saved so they will attach properly when loading a save once the vic has been moved.