TeaWithLucas / DNDBeyond-DM-Screen

The script aims to provide a simple DM screen by displaying handy stats and info on the campaign screen.
MIT License
33 stars 15 forks source link

Tasha's Ability Score Bonuses #5

Closed FerrocCaldrson closed 3 years ago

FerrocCaldrson commented 3 years ago

So was looking over some characters in the campaign I'm running, and I noticed some of the values displayed on the DM screen do not match up with the actual values of the character as far as Ability Scores. Did some investigating and found out that if a character is using the Tasha's Cauldron of Everything optional custom racial bonuses feature, in which they can choose where the racial bonuses of their character is invested, those Ability Scores on the DM Screen do not reflect the actual value. Figured this might just be a result of an update the DNDBeyond team added to accommodate the custom racial bonuses. Is there any way to fix this?

FerrocCaldrson commented 3 years ago

Adding Pictures as evidence @TeaWithLucas Desktop Screenshot 2021 01 11 - 14 40 19 02 Desktop Screenshot 2021 01 11 - 14 40 09 52 As can be seen here, there is a discrepancy between the Ability Scores on the DM screen and the character sheet, and this character has toggled the Ability Score options in character builder. # # # #

TeaWithLucas commented 3 years ago

@FerrocCaldrson Ah, I'll have a look, it shouldn't require too much to fix!

FerrocCaldrson commented 3 years ago

Just wanted to check in and see if there were any updates? @TeaWithLucas

TeaWithLucas commented 3 years ago

Just wanted to check in and see if there were any updates? @TeaWithLucas

Sorry, I have been very busy recently. I have now looked into it and I think I can see why it's not working. Unfortunately, it's not an super easy fix, but I have found the solution: basically, it needs the data from these places: https://character-service.dndbeyond.com/character/v4/game-data/racial-trait/collection https://character-service.dndbeyond.com/character/v4/game-data/class-feature/collection put into the definitionPool part, I tested it manually putting in the below and it worked.

definitionPool: { "racial-trait": { accessTypeLookup: {4566739: 1, 4566742: 1}, definitionLookup:{ 4566739: {"id":4566739,"definitionKey":"racial-trait:4566739","entityTypeId":1960452172,"displayOrder":10,"name":"Languages","description":"<p>You can choose to replace each language in your Languages trait with \r\n\t\t\ta language from the following list: Abyssal, Celestial, Common, Deep Speech, Draconic, Dwarvish, Elvish, Giant, Gnomish, Goblin, Halfling, Infernal, Orc, Primordial, Sylvan, or Undercommon.</p>\r\n\t\t\t<p>Your DM may add or remove languages from that list, depending on what languages are appropriate for your campaign.</p>","snippet":"","hideInBuilder":false,"hideInSheet":true,"activation":null,"sourceId":1,"sourcePageNumber":null,"creatureRules":[],"spellListIds":[],"featureType":3,"sources":[{"sourceId":1,"pageNumber":null,"sourceType":1}],"affectedFeatureDefinitionKeys":["racial-trait:167"],"isCalledOut":false,"entityType":"racial-trait","entityID":4566739,"entityRaceId":24,"entityRaceTypeId":1743923279}, 4566742: {"id":4566742,"definitionKey":"racial-trait:4566742","entityTypeId":1960452172,"displayOrder":100,"name":"Ability Score Increase","description":"<p>Choose an ability score to increase by 1, instead of the previously granted strength score increase.</p><p>If you gain more than one increase, you can’t apply those increases to the same ability score, and you can’t increase a score above 20.</p>","snippet":"","hideInBuilder":false,"hideInSheet":true,"activation":null,"sourceId":1,"sourcePageNumber":null,"creatureRules":[],"spellListIds":[],"featureType":3,"sources":[{"sourceId":1,"pageNumber":null,"sourceType":1}],"affectedFeatureDefinitionKeys":["racial-trait:172"],"isCalledOut":false,"entityType":"racial-trait","entityID":4566742,"entityRaceId":20,"entityRaceTypeId":1228963568}}, } },

FerrocCaldrson commented 3 years ago

Oh no worries of course! Ok, so I tried copy/pasting that code into the definitionPool part, and i dont think anything has changed. Have I done this right? Sorry, i have very little experience with code much. Desktop Screenshot 2021 03 08 - 14 49 59 41

TeaWithLucas commented 3 years ago

Oh no worries of course! Ok, so I tried copy/pasting that code into the definitionPool part, and i dont think anything has changed. Have I done this right? Sorry, i have very little experience with code much.

Hey, sorry my post was a bit misleading. I was mainly outlining what needed to be done by me, and giving me some notes to refer to when fixing this! Unfortunately, its not as simple as copy pasting that code, I just put that as an example of what the outputted code would look like when i have implemented it :) Ill let you know once it is fixed

TeaWithLucas commented 3 years ago

@FerrocCaldrson All resolved. it should be working now, please let me know if its all working and if there are any further issues.

FerrocCaldrson commented 3 years ago

Thank you, you're awesome!