Save Only Specific Item(s)

  1. 7 years ago

    Is there a way to tell ALiVE to ONLY save a specific item while blacklisting literally everything else?

  2. A little more on this topic - essentially I need whitelist.

    I want to have ALiVE persistence (logistics) to only save one specific item: "Land_Cargo20_red_F". I don't want it to save any other objects to the database. Just that one container.

    Perhaps there is a way to do this by defining custom save data with ALIVE_fnc_setData?

  3. http://alivemod.com/wiki/index.php/Database#Editor_Notes

    ["My Custom Variable", _value] call ALiVE_fnc_setData
    _value = ["My Custom Variable"] call ALiVE_fnc_getData

  4. Edited 7 years ago by SpyderBlack723

    Put All in the blacklist field

    Then add this to your init.sqf

    if (isserver) then {
    	[] spawn {
    		ALiVE_save_object_enabled = true;
    		ALiVE_objectsToSave = [YOUR_OBJECT_NAME];
    
    		while {ALiVE_save_object_enabled} do {
    			{
    				if (!isnull _x) then {
    					[ALiVE_sys_logistics,"updateObject", _x] call ALIVE_fnc_logistics;
    				};
    			} foreach ALiVE_objectsToSave;
    		};
    	};
    };

    Replace YOUR_OBJECT_NAME with the variable name for your object (name it in the editor)

  5. @SpyderBlack723 Thanks for the reply! Great to see how these functions can be utilized.

    Question regarding the blacklist field, are you referring to the field inside the Player Logistics (Disable) module?

  6. Logistics (Disable) module

  7. Edited 7 years ago by SpyderBlack723
    if (isserver) then {
        [] spawn {
            ALiVE_typesToStore = ["YOUR TYPE CLASSNAME HERE"];
    
            while {true} do {
                if (!isnil "ALiVE_sys_logistics") then {
                    {
                        private _type = [_x,"ALiVE_SYS_LOGISTICS_TYPE"] call ALiVE_fnc_hashGet;
    
                        if (({_type isKindOf _x} count ALiVE_typesToStore) == 0) then {
                            private _id = [_x,"ALiVE_SYS_LOGISTICS_ID"] call ALiVE_fnc_hashGet;
                            [ALiVE_sys_logistics_store,_id] call ALiVE_fnc_hashRem;
                        };
                    } foreach (ALiVE_sys_logistics_store select 2);
                };
    
                sleep 10;
    
                systemchat "removed objects"; // debug
            };
        };
    };
 

or Sign Up to reply!