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.
9 Replies

Similar story to
flags
here, you can completely nuke an actor's data.data
more stupid games to win stupid prizesDare I try with
id
?
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 actorsI assume you can't remove the ID because that's from nedb, right?
one would think, I'm not sure though.
@ghost @manaflower I messed around some a few days ago and found this stuff out ^
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.
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

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.