Mod Configs

ArkFrame introduces a standardized system of persistant mod configs. This system is intended to be an alternative to using the GameUserSettings.ini for persistant settings.

Mod Config object only exist server side in the case of a dedicated server, and require admin privileges in order to change settings options via the ArkFrame management UI. This allows server admins control over their config settings from within the game.

Setting up a new mod config

If not specified, the system implements a default mod config for each mod that implements any settings that it already uses for itself. To declare a mod config open the ModData BP and click the + icon next to ConfigSaveClass.

_images/modConfig_newObject.png

Declaring displayable settings

A fresh mod config blueprint comes with the default settings that ArkFrame implements, these settings should not be removed.

The Displayable Options Collection does not create the actual variables that are saved to disk, it is used to map your own declared variables to autogenerated standardized settings widgets in the ArkFrame Management UI for players to interact with. To add additional displayable settings that can be adjusted by server admins, add new elements to the Displayable Options Collection

_images/modConfig_defaults.png

The available options that need to be set depends on the type of displayable setting that is chose.

First enter a ModOptionID, this integer only needs to be unique within your own mod.

The OptionDisplayText is the string that is used as the options displayable text. This should be easy to understand for the player.

The RequiresRestart bool sets a warning icon on the control widget signifying to users that the option requires a restart to be fully implemented with the new values.

Select an OptionType, this determines the type of widget and interface controls use for the option. The option types map to the data parameters as follows:

Option Type Bounding Option
Toggle The toggle does not have a bounding option as it displays a simple checkbox
DropDown Uses the DropDownOptions array for the options list
Slider Uses the SliderMin and SliderMax parameters to define the slider bounding values
Text Input Text input does not use a bounding option

Parameters that aren’t used by the selected option type are ignored when contructing the setting widget.

Declaring persistant variables

The newly created blueprint is derived from the standard UE4 SaveGame class. To add new mod settings simply create a new variable of whatever type desired. The SaveGame property is not necessary for these variables.

NOTE: It is not required that every variable created in the mod config object be exposed to the UI the system can be used to save values not exposed to the end user.

Exposing variables to ArkFrame

Variables have to be manually exposed to ArkFrame by the mod author. Unfortunately this means overriding a system function which will require that the ArkFrame options be implemented by the mod author as well. The following shows how to implement the required variables when overriding the Get Config Options Saved Values function:

_images/modConfig_requiredValues.png

This also show how to expose your own variables to the system. simply add new pins to the return array and hook them up as you need for each displayable option that was declared in the defaults. The ModOptionID‘s must match what was declared in the defaults.

Accessing the mod config

The mod config object can be retrieved in the graph of any blueprint that has been declared in the ClassRegistry in the Mod Data BP. This is a requirement. If attempting to access the mod config from a class not declared in the Mod Data BP the macro will return as invalid. Do not forget to declare your mod class blueprints.

Remember that these config objects only exist with the authority/server.

The following node will retrieve the mod config object for your specific mod:

_images/modConfig_getObject.png

If the object is valid, cast to your newly created config class and access the class variables as you would any other object.

Saving mod config values

It is recommended that you save the mod config any time you change any of your config values. Doing this is as simple as calling this macro node from any graph blueprint that has been declared in the ClassRegistry of the Mod Data BP (Must be called by the authority/server).

_images/modConfig_saveObject.png