fantasycalendar / FoundryVTT-ItemPiles

Other
33 stars 52 forks source link

[BUG] - [Dnd5E] - Some Item Pile settings not working #548

Closed TheMightyTeo closed 4 months ago

TheMightyTeo commented 4 months ago

Are you on the latest version of Item Piles? No, v2.8.20

Have you tried to reset Item Piles' system settings? Yes

Describe the bug I use your 'Make tokens lootable' macors via an additional macross, which makes tokens lootable, when status 'Dead' is applied to them. If that token had 1 and only 1 item in their inventory, macros converts token's image and name. 'Display Single Item Image' and 'Use Item Name' checkboxes are toggled off.

To Reproduce Steps to reproduce the behavior:

  1. Create a NPC sheet, add one item to their inventory.
  2. Go to created NPCs 'Item Pile Configuration' -> Other Settings -> Uncheck 'Display Single Item Image' and 'Use Item Name' checkboxes.
  3. Create custom 'Dead' status via DFreds Convenient Effects.
  4. Set two effect macroses: 1. 'On Effect Creation' -> game.itempiles.API.turnTokensIntoItemPiles(token) 2. 'On effect deletion' -> game.itempiles.API.revertTokensFromItemPiles(token). Set created custom effect 'Dead' - 'Add Favourite' and reboot Foundry.
  5. Drag that NPC to the scene and apply macros: game.dfreds.effectInterface.toggleEffect("Dead",{overlay:true})
  6. See error

Expected behavior I expect the token to keep his actor data, token image and name

Screenshots If applicable, add screenshots to help explain your problem. изображение_2024-03-17_130105672 изображение_2024-03-17_130033637

Setup:

Active modules: изображение_2024-03-17_130246396 изображение_2024-03-17_130259354 изображение_2024-03-17_130310797 изображение_2024-03-17_130321065

Additional context If character has more that 1 items, it works just fine, as expected. As far as I think, those 'Display Single Item Image' and 'Use Item Name' checkboxes seems to overwrite themselves when an NPCs status becomes 'Dead'

Haxxer commented 4 months ago

Can you post the macro that you are using for the dead status? If that macro isn't setting the item piles settings on token correctly, it will take the default behavior of your Default Item Pile character.

TheMightyTeo commented 4 months ago

Can you post the macro that you are using for the dead status? If that macro isn't setting the item piles settings on token correctly, it will take the default behavior of your Default Item Pile character.

I don't actually use macro to apply that status. The module (DFredsConvenientEffects) does that by itself, as far as I think. When any NPCs health drops to 0 HP - their status automaticly becomes 'Dead'

Haxxer commented 4 months ago

Then it is a bug with that module, not item piles. Item piles does exactly what it is supposed to do.

TheMightyTeo commented 4 months ago

Then it is a bug with that module, not item piles. Item piles does exactly what it is supposed to do.

Well, I've got one simple macros to set status 'Dead' manually - game.dfreds.effectInterface.toggleEffect("Dead",{overlay:true}) With this macros the same thing happens - actor becomes an item. Is it a problem with DFredsConvEff in that case too? And also, is there a way to set some arguments to that hook? изображение_2024-03-18_202927764

TheMightyTeo commented 4 months ago

I've tried something like this - game.itempiles.API.turnTokensIntoItemPiles(token, {displayOne:false, showItemName:false}), but it doesn't work. I lack some JS knowledge, sadly.

Haxxer commented 4 months ago

The wiki shows you this: https://fantasycomputer.works/FoundryVTT-ItemPiles/#/api?id=turntokensintoitempiles

game.itempiles.API.turnTokensToItemPiles(token, { pileSettings: { displayOne: false, showItemName: false } })
TheMightyTeo commented 4 months ago

The wiki shows you this: https://fantasycomputer.works/FoundryVTT-ItemPiles/#/api?id=turntokensintoitempiles

game.itempiles.API.turnTokensToItemPiles(token, { pileSettings: { displayOne: false, showItemName: false } })

A little typo of yours: not 'TokensToItemPiles' but 'TokensIntoItemPiles'. Replacing my macro on 'Dead' effect creation with yours above worked just fine, my thanks to you! :) To fix this problem without the workaround above, I suppose I should get in touch with the creator of DFredsConvEffect module, am I right?

Haxxer commented 4 months ago

That is correct

TheMightyTeo commented 4 months ago

Thank you kindly, sir! I guess I'll keep using this one until this problem gets a proper fix. Have a nice day! :)