Summary
FiF_Core is the shared configuration and infrastructure foundation for ForgedInFire modules.
Description
FiF_Core depends on ScriptLoggerV2. Logging is provided through the named-logger API; Core uses FiF_SL_SLogger.GetLogger("FiF_Core").
FiF_Core contains no gameplay features. Dependent modules own their gameplay behavior and configuration declarations while Core provides the shared runtime registry used to resolve effective configuration values.
RUNTIME CONFIGURATION REGISTRY
FiF_Core maintains typed runtime configuration registries. The current implementation supports:
• bool
• int
Configuration values are registered by a stable, case-sensitive configuration name. The first value registered for a name wins. A later registration of the same name succeeds without overwriting the value already stored in Core.
This allows configuration names to be shared intentionally between modules while leaving unrelated configuration names effectively module-specific.
Dependent modules register configuration entries rather than registering their configuration components with Core:
ref array<ref FiF_CoreConfigEntry> configs = {};
configs.Insert(FiF_CoreConfigEntry.CreateBool(
"FeatureEnabled",
false
));
configs.Insert(FiF_CoreConfigEntry.CreateInt(
"RequiredRank",
1
));
FiF_CoreConfig.RegisterConfigs(configs);
FiF_CoreConfig.GetConfigs(configs);
Individual runtime consumers may retrieve effective values directly from Core:
bool featureEnabled = FiF_CoreConfig.GetBool(
"FeatureEnabled",
false
);
int requiredRank = FiF_CoreConfig.GetInt(
"RequiredRank",
1
);
The supplied fallback is returned if the requested configuration value is not registered.
CONFIGURATION ENTRIES
FiF_CoreConfigEntry provides the typed configuration-entry representation used for bulk registration and retrieval.
Create entries with the named factory appropriate to the value type:
FiF_CoreConfigEntry.CreateBool("FeatureEnabled", false);
FiF_CoreConfigEntry.CreateInt("RequiredRank", 1);
Core can register or retrieve an entire array of entries with:
FiF_CoreConfig.RegisterConfigs(configs);
FiF_CoreConfig.GetConfigs(configs);
FiF_CoreConfig.GetConfigEntryByName() can be used when a module needs a particular entry from its local configuration array.
OPTIONAL MODULE CONFIGURATION COMPONENTS
Dependent mods may own configuration components containing Workbench-editable attributes. These components are optional configuration sources; Core does not know about or depend on their concrete classes.
A dependent mod may look for its own configuration component on the Core entity. If present, the module can convert those configured attributes into FiF_CoreConfigEntry values and register them with Core. If absent, the module can register its built-in defaults instead.
This keeps dependency direction one-way:
Dependent module → FiF_Core → ScriptLoggerV2
FiF_Core never needs to know which dependent modules are installed.
CORE ENTITY
FiF_Core maintains a lightweight entity named FiF_CoreConfigEntity.
If an entity with that name already exists in the world, Core uses it. Otherwise Core spawns the bundled FiF_GameLogic_CoreConfigEntity prefab.
The entity acts as an anchor on which a scenario or server manager may optionally place module-owned configuration components. FiF_Core itself does not require a Core configuration component.
WORLD LIFECYCLE
Configuration registration may occur before Core's OnWorldPostProcess initialization.
Core preserves registrations made for the current world. When accessed from a different gameplay world, the runtime registries are recreated so configuration values from the previous world are not carried forward.
Configuration is runtime/process-local. The registry itself does not persist values or replicate server settings to clients.
LOGGING
FiF_Core uses ScriptLoggerV2 for named logging:
FiF_SL_SLogger.GetLogger("FiF_Core");
Configuration registration, retrieval, initialization, duplicate registration, missing values, and invalid requests are logged through the Core logger.
VERIFIED IN WORKBENCH
The current configuration architecture has been compiled and runtime-tested in Arma Reforger Workbench 1.8.0.13.
AUTHOR
Developed by ForgedInFire
[email protected]License
Arma Public License (APL)