melindil / FTSE

Fallout Tactics Scripting Engine
MIT License
8 stars 1 forks source link

Custom variable storage per-entity #7

Open melindil opened 3 months ago

melindil commented 3 months ago

Intent is to allow scripts to save information in an entity, beyond the existing kludge of using the perk section of the temporary attribute table.

Required capabilities:

  1. Allow more than integer types: floating point, string, Lua table, Entity reference
  2. Include a global unique ID in each entity to ensure we can get to the proper custom data, and to allow references to persist across levels
  3. Ensure ID and custom data are persisted to the save file
  4. Support "weak" and "attached" entity references. Weak means the entity referred to currently exists in the level, but may not persist (or may disappear independent of the script code), requiring validation to ensure the entity reference is valid on each access. Attached means the entity is effectively "stored" in the reference, and will carry over with the player between levels if the entity belongs to a squad mate or their inventory.