Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Items not displaying properly on PDF #35

Closed
codeGlaze opened this issue Jan 19, 2019 · 7 comments · Fixed by #605
Closed

Custom Items not displaying properly on PDF #35

codeGlaze opened this issue Jan 19, 2019 · 7 comments · Fixed by #605
Assignees
Labels
area/pdf bug Something isn't working

Comments

@codeGlaze
Copy link

When creating custom items, normally weapons, often times the name and sometimes the damage dice do not display in the PDF export.

This bug can even occasionally crop up in the browser view too, iirc.

@codeGlaze codeGlaze added bug Something isn't working area/application Task related to orcpub application itself labels Jan 19, 2019
@ptemberton
Copy link

I have experienced this bug a lot and it has caused some issues on my end. Anything you could do to fix that would be most appreciated.

@datdamnzotz datdamnzotz added area/pdf and removed area/application Task related to orcpub application itself labels Apr 7, 2019
@windspawn
Copy link

I have had the same issue. Although for me it is every time I try to create this particular magic item.

I posted a bug ticket on larrychristensens issue list here: larrychristensen#143

The original text of my bug post was as follows:
I tried creating a custom magic item based on this: https://the-lost-mine-of-phandelver-9.obsidianportal.com/wiki_pages/lightbringer

Under the "attacks & spellcasting" section of the printed character sheet I get the following issue.
Creating it seems to work fine, and so does viewing it in orcpub, but when printing my character the name does not show up, my proficiency bonus is not added, the magical attack bonus is not added and the damage only reads (d + 4) so the damage is missing the +1 damage bonus and is missing the base Mace damage and type. (the +4 is the damage bonus from my stat)

I created the item in the item builder as follows:
Item name: Lightbringer
Type: weapon
Rarity: rare
Description: "This +1 mace was made for a cleric of Lathander, the god of dawn. The head of the mace is shaped like a sunburst and made of solid brass. Named Lightbringer, this weapon glows as bright as a torch when its wielder commands. While glowing, the mace deals an extra 1d6 radiant damage to undead creatures."
Base Weapon: Mace (checked)
Magic Damage Bonus: 1
Magic Attack Bonus: 1
And nothing else selected.

To me this should show up as "Lightbringer +7 1D6+5 bludgeoning"

Also, it would be nifty if the item and description showed up somewhere.

@sehrgut
Copy link

sehrgut commented Sep 4, 2022

I'm experiencing this also. I've created a custom weapon, and it shows up in the PDF simply as ".+3, d+3" as noted in #559

@Cheata
Copy link

Cheata commented Mar 4, 2023

As far as i can tell the problem with the custom weapons not displaying correctly is caused by the fact that the weapon map used to parse the character weapons only contains the weapon info that is hard coded into the site and not the homebrew info. Ill post the code locations and references later tonight when im sitting infront of my pc and not on my cell.

@Cheata
Copy link

Cheata commented Mar 4, 2023

In pdf_spec.cljc line 433 sets all-weapons (the map used to populate the weapon field in the pdf), this uses mi5e/equipped-item-details which is defined in magic_items.cljc line 3137 to take a map of weapons from the players inventory and a map of all available weapons then pull from all available weapons those found the the players inventory and merge in some stats from the char inv map.

However if you trace the code back through the generation of the map of all weapons. (mi5e/all-weapons-map defined in magic_items.cljc line 3089) it never takes into account the homebrew items and only pulls data from the hard coded information in magic_items.cljc and weapons.cljc. (non of the component definitions do either).

Because the homebrew weapon is not contained in the map that generates the stats for the character sheet they cannot be extracted by the equipped-item-details function thus only contain the info that comes from the character data(modifier+prof to hit and modifer+prof for dammage) without the name because that too is pulled from the all-weapons-map and not the character data.

obvious solution would be to add the homebrew data to the all-weapons-map

@codeGlaze
Copy link
Author

In pdf_spec.cljc line 433 sets all-weapons (the map used to populate the weapon field in the pdf), this uses mi5e/equipped-item-details which is defined in magic_items.cljc line 3137 to take a map of weapons from the players inventory and a map of all available weapons then pull from all available weapons those found the the players inventory and merge in some stats from the char inv map.

However if you trace the code back through the generation of the map of all weapons. (mi5e/all-weapons-map defined in magic_items.cljc line 3089) it never takes into account the homebrew items and only pulls data from the hard coded information in magic_items.cljc and weapons.cljc. (non of the component definitions do either).

Because the homebrew weapon is not contained in the map that generates the stats for the character sheet they cannot be extracted by the equipped-item-details function thus only contain the info that comes from the character data(modifier+prof to hit and modifer+prof for dammage) without the name because that too is pulled from the all-weapons-map and not the character data.

obvious solution would be to add the homebrew data to the all-weapons-map

I'm not sure how this flew so far under the radar, but thank you for the suggestion. I'll be looking into it soon!

@codeGlaze
Copy link
Author

codeGlaze commented Mar 12, 2024

So. to finally put the nail in this annoying bug:

mi5e/all-weapons-map as defined was not the properly updated version of the map. The all-weapons-map needed to be, or should have been, subscribed to the updated reagent/re-frame function/handler.

all we needed to do was change mi5e/all-weapons-map on pdf_spec.cljc line 433 to @(subscribe [::mi5e/all-weapons-map])

This took years for all of us non-clojurians to stab at and not crack until now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/pdf bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants