Components that require persistence need to define a SaveData class extending EPF_ComponentSaveDataClass
:
[EPF_ComponentSaveDataType(OVT_SomeManagerOrControllerComponent)]
class OVT_SomeSaveDataClass : EPF_ComponentSaveDataClass {};
class OVT_SomeSaveData : EPF_ComponentSaveData
{
void ReadFrom(OVT_SomeManagerOrControllerComponent component) { ... }
void ApplyTo(OVT_SomeManagerOrControllerComponent component) { ... }
}
The EPF system handles save/load operations and data persistence in Overthrow. It provides:
/mnt/n/Projects/Arma 4/EnfusionPersistenceFramework
Use #ifdef PLATFORM_CONSOLE
for both Xbox and PlayStation (Arma Reforger only provides PLATFORM_CONSOLE and PLATFORM_WINDOWS).
All FileIO operations and EPF persistence calls must be wrapped in PLATFORM_CONSOLE checks:
#ifdef PLATFORM_CONSOLE
// Console-specific code (no persistence)
#else
// PC code with EPF persistence
EPF_PersistenceManager.GetInstance().Save(component);
#endif
The standard pattern for component persistence:
[EPF_ComponentSaveDataType(OVT_ExampleComponent)]
class OVT_ExampleSaveDataClass : EPF_ComponentSaveDataClass {};
class OVT_ExampleSaveData : EPF_ComponentSaveData
{
// Data members to persist
int m_iExampleValue;
string m_sExampleString;
ref array<ref OVT_ExampleData> m_aExampleArray;
void ReadFrom(OVT_ExampleComponent component)
{
m_iExampleValue = component.GetExampleValue();
m_sExampleString = component.GetExampleString();
m_aExampleArray = component.GetExampleArray();
}
void ApplyTo(OVT_ExampleComponent component)
{
component.SetExampleValue(m_iExampleValue);
component.SetExampleString(m_sExampleString);
component.SetExampleArray(m_aExampleArray);
}
}
/mnt/n/Projects/Arma 4/EnfusionDatabaseFramework
#ifdef PLATFORM_CONSOLE
checks