DocumentData shennanegins

TIL: It is possible to update an Actor or Item's data.data with arbitrary information that isn't defined in the system template. This data survives database compaction.
No description
9 Replies
Calego
CalegoOP4y ago
No description
Calego
CalegoOP4y ago
Similar story to flags here, you can completely nuke an actor's data.data more stupid games to win stupid prizes
Calego
CalegoOP4y ago
Dare I try with id?
No description
Calego
CalegoOP4y ago
Ah, having done this I can no longer delete this actor (even with delete()) I played a stupid game and won a stupid prize. Restarting the world the actor fails to initialize, but the world starts fine (I guess this is a good reminder to try catch your initialization for actors
Daniel Thorp
Daniel Thorp4y ago
I assume you can't remove the ID because that's from nedb, right?
Calego
CalegoOP4y ago
one would think, I'm not sure though. @ghost @manaflower I messed around some a few days ago and found this stuff out ^
Mana
Mana4y ago
Template.json doesn't enforce anything (Id on't think), it just makes sure some structures are present. It's mostly useful for defining default values for non-derived data. And basic expected structure. In my case, my skills structure in the template.json is just an empty object because all skills are fully optional.
Mana
Mana4y ago
Though on that, I found a neat use for template.json I define optional structures there for filling in defaults for sub objects. Since Foundry doesn't prune it, that is all available via game.system.template.Data for me :3
No description
Mana
Mana4y ago
I think game.system.template by itself is Just the template.json file As Is. This surprises me greatly. But then yes, you earned that result.
Want results from more Discord servers?
Add your server