kypvalanx / Foundry-VTT-StarWars-SagaEdition

25 stars 7 forks source link

Data Model enhancement pt1c - vehicle actors #465

Open TalonKetupa opened 4 months ago

TalonKetupa commented 4 months ago

This is to track the beginnings of migrating data structures to foundry data models. Foundry data models provide the benefits of

validation on initialization and update, and on-the-fly data migration and coercion. It also allows functionality to be delegated out to these models, reducing the burden on the system's Document implementation to solely house such logic https://foundryvtt.com/article/system-data-models/

My current thought for this is to create the base data framework based on the existing way that data is being stored. Also, to transform the data helper/retrieval functions to be separated by the respective document types that use them.

Pt1 will be looking over actors. But I will tackle this one at a time in case there is any feedback in the process. 1a. character actors first - #446 1b. npc actors - #464 1c. vehicle actors then Pt2 Actor Sheet adjustments Pt3 Data migration and test cases

Create draft of vehicle data model

This vehicle data model draft will be temporarily housing transformed versions of helper functions to facilitate a smooth transition when the time comes and also to allow for the data migration functions to be defined at a later time through comparison.

kypvalanx commented 4 months ago

npc actor types are all but completely unused at this point. they are automatically shifted on load and a checkbox on the setting page switches functionality. I'm open to shifting back, i just thought that i might like to use an npc as a base for a PC at some point.

TalonKetupa commented 4 months ago

Yea I did notice that. I may have been a bit ambitious in the goal here, but I think being able to have an npc just as a statblock with rollables would be really nice, something that you can just type in all the stats for and don't have to worry about adding all the items to. In essence, just a manual character sheet: something a bit easier to just toss together without having to use overrides.

kypvalanx commented 4 months ago

I like that. there is currently a manual sheet. I'm kinda thinking more of a text area that then parses the text to add rollables so you could copy paste from a stat block and have it work

TalonKetupa commented 4 months ago

As far as the datamodel goes, npcs would have more source data than a character, so it would not be difficult to have a npc converted to a character.

TalonKetupa commented 4 months ago

For a future enhancement, could parse the text data and auto add items in.

TalonKetupa commented 4 months ago

I like that. there is currently a manual sheet. I'm kinda thinking more of a text area that then parses the text to add rollables so you could copy paste from a stat block and have it work

Oh I see. Copy and paste in would be nice too. ;p