WHITESPINE
WHITESPINE
Explore posts from servers
Migrating to DataModels - how to get data pre `cleanData`?
Hello. In the lancer system, we have some old fields in our Actor/Item models what predate the existence of UUIDs - they instead used a "RegRef" structure to achieve basically the same thing as a UUID now does. For context, a regref example:
{
id: "B1stOACZSDZAJLA7",
fallback_lid: "dep_ms_pattern_a_smoke_charges_smoke_mine",
type: "deployable",
reg_name: "game"
}
{
id: "B1stOACZSDZAJLA7",
fallback_lid: "dep_ms_pattern_a_smoke_charges_smoke_mine",
type: "deployable",
reg_name: "game"
}
Going forward, we'd prefer these just be a UUID string represented via a slightly modified StringField. The issue we are running into, though, is that it is difficult to migrate this data considering that the _source data of all actors is being modified via the DataModel._initializeSource -> BaseActor._initializeSource -> DataModel.cleanData, which destroys the above object and replaces it with "[object Object]". I tried accessing them via game.actors._source but it appears that the transformations in cleanData affect that data too. Is there a good way around this? Thanks
14 replies