Skip to content

Configuration

McDiod edited this page May 19, 2023 · 28 revisions

You can configure this module in your description.ext. This is entirely optional however, since every setting has a default value.
Add the class CfgGradPersistence to your description.ext, then add any of these attributes to configure the module.

Attributes

General Settings

Attribute Default Value Explanation
missionTag missionName String - The tag that everything in this mission will be saved under. Two missions with the same tag will overwrite each other when saving, even on different terrains. One mission can load the data of a different mission, if they are both saved under the same tag.
loadOnMissionStart 0 0/1 - Toggles automatic loading on start of mission.
missionWaitCondition "true" Statement - Condition before data will be automatically loaded. Also applies to automatic loading of JIP players.
playerWaitCondition "true" Statment - Condition before a player will be loaded. Evaluated on server. Passed parameters are [unit,side of unit,unit classname,unit roleDescription].
playerWaitConditionLocal "true" Statment - Condition before a player will be loaded. Evaluated on client. No passed parameters.

Objects

Attribute Default Value Explanation
saveUnits 1 0/1/2/3 - AI units.
saveVehicles 1 0/1/2/3 - Vehicles, static weapons, certain objects.
saveContainers 1 0/1/2/3 - Containers such as ammo boxes.
saveStatics 1 0/1/2/3 - Static objects such as houses, walls, trees, etc. excluding those created with grad-fortifications.
saveGradFortificationsStatics 3 0/3 - Static objects that were created with grad-fortifications during mission runtime.

...read more

Players

Attribute Default Value Explanation
savePlayerInventory 1 0/1 - Toggles saving of player inventories.
savePlayerDamage 1 0/1 - Toggles saving of player health.
savePlayerPosition 1 0/1 - Toggles saving of player position.
savePlayerMoney 1 0/1 - Toggles saving of player money. Needs GRAD ListBuymenu or GRAD Moneymenu

...read more

Other

Attribute Default Value Explanation
saveMarkers 0 0/1/2/3 - Same as objects: 0 - disabled, 1 - editor-placed, etc. Of user created markers, only those in global channel will be saved. ...read more
saveTasks 0 0/1 - Only saves tasks that are assigned globally or to a side. ...read more
saveTriggers 0 0/1/2 - 0 to disable, 1 to enable, 2 to enable and re-execute the statements of triggers which have already been activated. ...read more
saveTeamAccounts 1 0/1 - Toggles saving of shared team money. Needs GRAD ListBuymenu
saveTimeAndDate 1 0/1 - Toggles saving of time and date.

...read more

Blacklisting

You can blacklist objects from being loaded by adding their classnames to the blacklist. This works independent of the object's type (unit / vehicle / container / ...).

Attribute Default Value Explanation
blacklist [] Array - Array of classnames that are blacklisted from being loaded.

...read more

Custom Variables

You can save custom variables by adding the customVariables class to CfgGradPersistence and then adding a class per variable with the following attributes:

Attribute Explanation
varName String - The variable's name.
varNamespace String - The variable's namespace.
public 0/1 - Make variable public. (third setVariable parameter)

...read more

Example

class CfgGradPersistence {
    missionTag = "my_persistent_mission";
    loadOnMissionStart = 1;
    missionWaitCondition = "true";
    playerWaitCondition = "true";

    saveUnits = 2;
    saveVehicles = 1;
    saveContainers = 1;
    saveStatics = 1;
    saveGradFortificationsStatics = 3;
    saveMarkers = 0;
    saveTasks = 0;
    saveTriggers = 0;

    savePlayerInventory = 1;
    savePlayerDamage = 0;
    savePlayerPosition = 0;
    savePlayerMoney = 1;

    saveTeamAccounts = 0;

    blacklist[] = {
        "B_Truck_01_mover_F",
        "MapBoard_seismic_F"
    };

    class customVariables {
        class var1 {
            varName = "mcd_myVariable_test";
            varNamespace = "mission";
            public = 0;
        };
        class var2 {
            varName = "mcd_myPublicVariableOnAUnit_test";
            varNamespace = "unit";
            public = 1;
        };
    };
};