This is a UHC Plugin (UPL) made specifically for the Improvement Mod in Age of Empires III. It enables AI scripters to persist data between game sessions using JSON (but in a very rudimentary way because XS is extremely limited).
| Storage type | Path |
|---|---|
| SPS (Shared) | My Games\AoE3 Improvement Mod\AIM\persistent\shared.json |
| OPS (Owned) | My Games\AoE3 Improvement Mod\AIM\persistent\<ai_name>.json |
Warning
Please be extremely careful with shared persistent storage: your saves may be corrupted if multiple AIs write at the same time.
// Write to shared storage
bool aiSPSSetBool(string key, bool value);
bool aiSPSSetInt(string key, int value);
bool aiSPSSetFloat(string key, float value);
bool aiSPSSetString(string key, string value);
// Read from shared storage
bool aiSPSGetBool(string key);
int aiSPSGetInt(string key);
float aiSPSGetFloat(string key);
string aiSPSGetString(string key);Normally, everything is already in the mod so you don't have to do anything. This repository is mainly for development purposes.
- Per-AI owned storage (
aiOPSSetInt,aiOPSGetInt, etc.) - Support for all (non-vector) XS data types
- Safety checks
- Delete/clear functions (
aiSPSClear(),aiSPSRemoveKey())1
1 There is intentionally no function to delete the persistent files themselves (same as the .personality, .dmp.txt and .lxs files)
- AoE3UnHardcoded: the original UHC Project
- UHC2: a fork of UHC with more features and occasional updates
- Improvement Mod: the mod this plugin is made for
- pugixml
- nlohmann/json
This project is published under the MIT License
