Implementing GCS‐like data models - crnormand/gurps GitHub Wiki
Note
This page is Work in Progress.
This page covers implementing the GCS data model for characters, various item types (traits, skills, equipment, etc.) and other related utility functions in GGA. The functionality of GGA differs from that of GCS, so some adjustment will be necessary, but the data should be able to be converted without any data loss or difficulty.
Actors for now consist only of Characters. This corresponds to the Entity
structure defined in GCS' model/gurps/entity.go
The below table shows the GCS data model fields as well as suggested corresponding field names and types for GGA.
GCS Key | GCS JSON Key | GCS Type | GGA Key | GGA Type | Description |
---|---|---|---|---|---|
Version | version | int | version | NumberField | GCS file version field. Used for compatibility checking |
ID | id | tid.TID | tid | StringField / TidField | ID used within GCS. Can be used for validation |
TotalPoints | total_points | fxp.Int | totalPoints | NumberField | Character point total. May be deprecated in GCS? (to check) |
PointsRecord | points_record | []*PointsRecord | pointsRecord | ArrayField | Record of point changes with timestamps and notes. |
Profile | profile | Profile | profile | SchemaField | Record of description info (height, weight, SM, TL, etc.) |
SheetSettings | settings | *SheetSettings | settings | SchemaField | Various display settings as well as hit location table and attributes setup. Ideal structure may vary from GCS', see CharacterSettingsSchema below. |
Attributes | attributes | *Attributes | attributes | AttributesField | Set of current attribute values. See AttributesField below. |
Traits | traits | []*Trait | traits | accessor () => subset of actor.items | List of character advantages/disadvantages (hierarchical) |
Skills | skills | []*Skill | skills | accessor () => subset of actor.items | List of character skills/techniques (hierarchical) |
Spells | spells | []*Spell | spells | accessor () => subset of actor.items | List of character spells (hierarchical) |
CarriedEquipment | equipment | []*Equipment | carriedEquipment | accessor () => subset of actor.items | List of carried character equipment (hierarchical) |
OtherEquipment | other_equipment | []*Equipment | otherEquipment | accessor () => subset of actor.items | List of non-carried character equipment (hierarchical) |
Notes | notes | []*Note | notes | ArrayField (needs discussion) | List of character notes (hierarchical) |
CreatedOn | created_date | jio.Time | createdDate | StringField / TimeField (needs discussion) | Date on which character was created |
ModifiedOn | modified_date | jio.Time | modifiedDate | StringField / TimeField (needs discussion) | Date on which character was last modified |
ThirdParty | third_party | map[string]any | Special1 | Special1 | Used by GCS for non-GCS data |
The GCS Entity struct also makes use of properties which are not written to the file but rather exist only in the initialised Entity. These, alongside their proposed GGA equivalents, are as follows:
GCS Key | GCS Type | GGA Key | GGA Type | Description |
---|---|---|---|---|
LiftingStrengthBonus | fxp.Int | #cache.liftingStrengthBonus | number | Cached lifting strength bonus |
StrikingStrengthBonus | fxp.Int | #cache.strikingStrengthBonus | number | Cached striking strength bonus |
ThrowingStrengthBonus | fxp.Int | #cache.throwingStrengthBonus | number | Cached throwing strength bonus |
DodgeBonus | fxp.Int | #cache.dodgeBonus | number | Cached dodge bonus |
ParryBonus | fxp.Int | #cache.parryBonus | number | Cached all-weapon parry bonus |
BlockBonus | fxp.Int | #cache.blockBonus | number | Cached all-weapon block bonus |
ParryBonusTooltip | string | #cache.parryBonusTooltip | string | Cached all-weapon parry bonus tooltip text |
BlockBonusTooltip | string | #cache.blockBonusTooltip | string | Cached all-weapon block bonus tooltip text |
features | features | features |