sun-dragon-cult / fvtt-system-rqg

Runequest Glorantha Foundry VTT system
https://sun-dragon-cult.github.io/
Apache License 2.0
19 stars 2 forks source link

RQ vs Foundry Interaction of Tokens of Actors with Canonically Missing Attributes (NO CON, NO POW, etc) #699

Open claycle opened 3 months ago

claycle commented 3 months ago

(When the main villain in your next story is a Zorak Zorani deathlord, and skeletons, zombies, and vampires may play a big role, you start running into these issues :-)).

NOTE: Although I believe there are some systemic issues with such actors in RQG, this is probably actually a Foundry interoperability bug. However, I thought it might at least be a good idea to create an issue here so we could track the solution, even if it means bumping the bug up to the Foundry devs if a more system local solution cannot be found.

RQ "Blank Stats" Can Cause Foundry Fits

When creating prototypes of creatures without some primary attributes (for example, spirits or undead), Foundry will begin throwing exceptions:

foundry.js:753  TypeError: An error occurred while rendering TokenConfig 147. Cannot use 'in' operator to search for 'value' in 
    at PrototypeToken.getBarAttribute (foundry.js:25031:24)
    at TokenConfig.getData (foundry.js:81971:34)
    at async TokenConfig._render (foundry.js:5812:18)
    at async TokenConfig._render (foundry.js:6532:5)

leading to broken functions (such as Prototype Token button on the actor sheet) and rendering scenes the token is moved into inoperable.

How: To Reproduce

Try, for example, to create a skeleton actor based on the template given in the RQ Bestiary. Skeletons have only STR, SIZ, and DEX - no CON, POW, INT, or CHA. When the actor is created with a blank CON, this renders the Prototype Token button inoperable because Foundry begins to throw exceptions - this is because (I surmise) that by default, Foundry presets the token prototype to display attribute bars and having a blank CON (or POW) causes the exception.

Expected behavior

RQG actors are not required to have "all the stats". A perfectly reasonable RQG actor (a ghost, for example), may only have INT and POW. The system needs to negotiate better with Foundry (or Foundry needs to bend to the system) to not cause exceptions when such actors are created and used in the system.

Environment - please paste the information from foundry settings tab "support" button:

Foundry Virtual Tabletop: Version 11 Stable, 11.315
Game System: rqg, 3.4.2
Active Modules: 34
Performance Mode: 2

OS: Unknown
Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
GPU: ANGLE (ATI Technologies Inc., AMD Radeon Pro Vega 64 OpenGL Engine, OpenGL 4.1)
Max Texture Size: 16384

Scene: 4512 x 2632 | Grid Size: 100 | Padding Percentage: 0.25
Walls: 0 | Ambient Lights: 0 | Ambient Sounds: 0 | Tiles: 10 | Tokens: 0

Actors: 22 | Items: 14 | Journal Entries: 190 | Rollable Tables: 0 |
Playlists: 6 | Compendium Packs: 80 | Chat Messages: 2

WORKAROUNDS

Setting the "blank attributes" to 0 (with 0 as the default generator as well) ameliorates Foundry afaict, although it is not canonically RQG (eg, 0 CON and NO CON have difference connotations in RQG).