dfreds / dfreds-pocket-change Goto Github PK
View Code? Open in Web Editor NEWA FoundryVTT module that automatically adds money to NPC character sheets when dropped on the canvas.
License: MIT License
A FoundryVTT module that automatically adds money to NPC character sheets when dropped on the canvas.
License: MIT License
Enabling functionality of Token HUD Wildcard for certain token disabling auto-generate currency feature. At the same time feature works fine with other "standard" tokens.
P.S. we can generate loot using macro or button in NPC sheet
Describe the bug
Cannot open loot sheet after converting to lootable after latest update of LootSheetNpc5e
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The loot sheet opens and displays the currency
Additional context
foundry.js:2013 TypeError: Cannot create property 'value' on number '0'
[Detected 1 package: lootsheetnpc5e]
at LootSheet5eNPC._prepareGMSettings (lootsheetnpc5e.js:1188)
at LootSheet5eNPC.getData (lootsheetnpc5e.js:141)
at LootSheet5eNPC._render (foundry.js:2049)
at B.🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:466)
at LootSheet5eNPC.🎁Application.prototype._render#lib-wrapper (listeners.js:110)
at LootSheet5eNPC.🎁Application.prototype._render#0 (libWrapper-wrapper.js:161)
at LootSheet5eNPC._render (foundry.js:2736)
at LootSheet5eNPC.render (foundry.js:2011)
at LootSheet5eNPC.render (foundry.js:3231)
at Token5e._onClickLeft2 (foundry.js:46090)
at MouseInteractionManager.callback (foundry.js:35929)
at MouseInteractionManager._handleClickLeft2 (foundry.js:36133)
at MouseInteractionManager._handleMouseDown (foundry.js:36095)
at Token5e.a.emit (index.js:181)
at r.dispatchEvent (interaction.min.js:8)
at r.processPointerDown (interaction.min.js:8)
at t.recursiveFindHit (interaction.min.js:8)
at t.recursiveFindHit (interaction.min.js:8)
at t.recursiveFindHit (interaction.min.js:8)
at t.recursiveFindHit (interaction.min.js:8)
at t.findHit (interaction.min.js:8)
at r.processInteractive (interaction.min.js:8)
at r.onPointerDown (interaction.min.js:8)
Hey, this is great - but I'm having some bug going on...
When I run the macro then open the token -
How can I tell which is which? Also in the lower left for the Coin distribution, the same problem down there.
Maybe it's something with my setup?
Looking forward to the fix, thanks again!
Given that LootsheetNPC5e is broken and hasn't been updated in months, and given the fact that an increasing number of users are using Monk's Enhanced Journal to manage loot, compatibility with MEJ loot sheets would be excellent. Users could choose which lootable system they want to use (MEJ or Lootsheet).
I've tested with confirming NPC type and and zero percent change of no currency. Error message:
TypeError: Cannot read property 'toLowerCase' of undefined
at Validator._isMatchingType (modules/dfreds-pocket-change/scripts/validator.js:84)
Great module, thanks! Would it be possible to have a setting to customize what counts as a humanoid? Or to change the setting to "Add Loot to These Types" and have the value be a list of strings? Possibly defaulting to the list of default 5e player races. A lot of my NPCs are currently set up with just their racial type listed. Meaning "Gnome" instead of "Humanoid (gnome)" or whatever.
This would also allow me to temporarily add "undead" to the list while placing a bunch of skeletons or vampires or whatever else might have some currency, but then remove it when placing the ghosts. Actually, that just made me realize that for now I can just toggle "Humanoids Only" off and on while placing tokens. Still, I think the type-customization might be nice going forward.
I find when I use the macro to change an actor token to a loot sheet, the actor token often loses most of its items and my players and I am unable to open that actor's sheet at all. I have to delete the token and place a new one.
As a user, I want to disable the module and generate currency on demand for selected tokens on the canvas.
Last version available on the Forge is 3.2.1.
Ask (via @dangerdaren): I also would love the option to set a percentage of chance that armor/weapons are too damaged to be included in the loot. I can already imagine my players stockpiling weapons from the dead unnecessarily just because they can.
Use case: Avoid players hording otherwise useless weapons and armor
Potential solution: Add setting similar to percent change of no currency for determining if the item is too damaged. Only consider items of "Common" rarity
If this is a feature, I'm unable to figure it out, sorry. I don't understand macros very well, but I didn't see anything in the ones you've provided that might do this.
Once the party has looted the creature, it would be nice if there was a way to convert it back to normal. Return it to NPC sheet, remove permissions and remove treasure chest overlay (Particularly the overlay, as I can do the other stuff manually if I need to).
-One of the reasons this would be helpful is that sometimes the party would leave a corpse and come back to it later, like a body in a crime scene. The overlay lowers immersion in that particular scene.
-I also like to keep track of what was looted, in case issues arise later where items disappear from bugs or an accidental wipe of inventory from DNDBeyond Importer; I keep bodies on the scene, but hide them after (I keep what was on corpses in a seperate note on the npc). A quicker way to remove permissions would be helpful, so I can mass hide them.
-Or, sometimes the corpses get in the way of combat, with them tiling over each other and players having a hard time selecting themselves, so I hide them but leave them in the same spot, to unhide them after they've moved from the spot. Hiding them, while the players have permissions to observe, leaves it visible to the players. Returning it to a regular NPC, with whatever items or gold is still on the body, then hiding it with a quick right-click, makes it take less time in combat. I can then quickly return it to a lootable item later.
These are just my own reasons, and it's not necessary. It would help smooth things out while playing, keeping everything in the flow, while I manage my players and the canvas.
Thank you for taking the time to read this.
When I drag/drop an actor who could have currency on them, the chat says (for example)
And console says it too . . .
But as you can see, there's no coins on this guy.
Interestingly, if I use the button in that sheet to generate coins - it works:
Perhaps I'm confused on the use, but it SEEMS to think it's generating coins when it isn't. Am I doing something wrong or is this a bug? Perhaps something else stomping on it?
Ask (via @dangerdaren): Finally, (and this probably could be solved with just a macro, or a commented out section in an existing macro that could be replaced), I'd like to be able to trigger a roll table to drop loot into the NPC's inventory. For instance, currently I have it set where CUB triggers your macro to make the NPC lootable. It simultaneously triggers a macro that I have set up that rolls a rolltable of rolltables (using the Loot Table by Better Roll Tables module). Currently all the resulting items from my rolltable show up in the chat window. I'd love it if I could make those items drop into the loot sheet automatically. I've attached an image of my rolltable set up for clarity. Actually, what I'd really love is for a window to pop up where I could approve/disapprove which items from the table will be dropped into the sheet from my rolltable result, but maybe I'm getting out of hand here!
Use case: Auto generation of items/common loot
Potential solution: Unsure. Either hook into LootSheet somehow to use its built-in method, or add new macro that adds items based on a specified roll table.
I am hoping it might be possible to add the Obsidian compatibility and Merchant Sheet NPC compatibility.
Would be good to see how much currency is generated when either macro is run, so that GM can read off to the player(s) when they are looking, instead of having to open sheets to see. (also to make sure that generate currency happened since there is no feedback atm since no field on the default/tidy npc sheets)
Process:
1) select token(s)
2) run generate currency macro
2b) or when gen loot sheet macro run
3) output to chat the amount of currency on each
Describe the bug
Hi,
I have a problem with the option "Damaged Items". I would like to my PC never loot items, just gold.
But damaged items are always intact and never remove.
Hope it's not become I'm french again :)
Thanks
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Loot nothing in dead body
Additional context
No error on F12. My compendium and DnD system are in french.
No matter what I set the sliders to... when I convert the creature to a lootable, the equipment is never damaged, and is always full price.
Describe the bug
When converting a token to loot the token sheet stays the same/the global default.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When using the convert to loot option, the sheet type should change to a loot sheet automatically, as per the documentation.
Screenshots
Here is the output on console about the loot generation:
Additional context
I am using FoundryVTT v10, build 291, with Dnd5e system version 2.1.5
I also have the latest version for both Tidy 5e sheet and lootsheet NPC
I noticed that with the migration for V10, the name fo lootsheet NPC module changed to lootsheet-simple, maybe this is something that is interfering?
I am using the custom damage macro, which I've just reimported from the compendium, and running version 3.1.2 of the module. Using the damaged items settings under module settings, and generating loot from the character sheet, I still never see damaged items (even if set to 100% chance items will be damaged).
Similarly, if I use the macro and set the values to a high chance of damaged items, converting to lootable just puts the full value, undamaged items on the sheet for players to loot.
I am also running Monk's Token Bar, and Monk's Little Details - so not sure if there's some clash there since it also has a convert to loot function (which I've currently got disabled).
It's referencing a controlledToken
variable that doesn't exist.
Is your feature request related to a problem? Please describe.
When converting a npc to loot it's quite common, that the npc has it's own type of an item, not the one players loot.
i.e. Goblins have their own version of a scimitar, that references goblins in the description, might not have value or weight etc.
Describe the solution you'd like
It would be nice to have the option to exchange items with normal versions from a Compendium.
ie. when converting said goblin to loot, look in my configurable items compendium and replace the item with one from the compendium with the same name if it exists. If the item doesn't exist, just convert the same way as it does now.
In the readme, it says this module requires Loot Sheet NPC 5e. That module is not updated for v10. This module says it is updated for v10. How does that work exactly? Is Loot Sheet actually usable with v10, despite saying only v9? I don't want to install it and risk breaking things if its not actually compatible.
Hello! Congratulations on the module, I really like it and would like to know if it will be updated to v11.
I love the simplicity of this module. However, I wonder if there could be an enhancement if the currency tables for various CRs was moved out of the main script into calls to prebuilt compendiums and/or roll tables. This would possibly empower the DM to build their own levels of SP/GP/etc for CR 0-4, CR 5-10, etc..
Granted it does introduce some complexity so may be outside the goals of the module. Loot Populator NPC 5e does this to some degree but I much prefer DFred modules :) Cleaner.
Is your feature request related to a problem? Please describe.
Loot Sheet NPC 5E isn't marked as a dependency, so the Module Management screen won't notify you if you don't have that installed as well. This renders this module non-functional with no clear in-app indication why.
Describe the solution you'd like
Loot Sheet NPC 5E marked as a dependency such that the Module Management screen will notify you if you don't have that installed or enabled.
Describe alternatives you've considered
At the end of the day I figured it out just by reading the module description again, but most other modules have this functionality and I assume (please don't crucify me if it's not) that it's pretty low lift.
Additional context
N/A
I would like an automated way to randomly place a specific range of pocket change into NPC sheets. Per my example in the subject line, a way to place a formula like "2d6[gp]", or "1d2[pp], 3d6[gp], 5d27[cp]", etc., would be great.
A macro would be perfectly fine. Sadly, I'm no good with macros, so all I can do is roll actual (digital) dice and manually enter the results for each NPC. One. At. A. Time.
Describe the bug
The "Convert Lootables" button on the right-hand sidebar is not visible when "Monk's Tokenbar" module is not active.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The "Convert Lootables" button should appear when only "DFred's Pocket Change" and "Loot Sheet NPC 5e" modules are active.
Screenshots
Additional Context
Foundry Version: 0.8.9
D&D 5e System Version: 1.4.2
Describe the bug
Hi,
Thanks for your module, I use it from the start.
I have a problem with the option "Damaged Items". I have set the "Chance of Damaged Item" to 0.9 but items are always intact.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Loot must of time nothing in dead body
Additional context
No error on F12. My compendium and DnD system are in french.
Try only with Tidy5e; Tidy UI, LootSheet and your module.
Try with "1" for "Chance of Damaged Item".
Ask (via @dangerdaren): One concern is it might be best if instead of triggering on the selected token, I wonder if there is a way to make it apply to "whichever token triggered the event". Just in case I'm selecting someone else when an NPC dies. Maybe as simple as a new macro/line of code in existing macro to get triggered instead?
Use case: convert token to loot when token reaches 0 HP
Potential solution: Add support for passing a token in as an argument to all macros
The chest icon is a nice touch, but a bit too obvious for my players. Right now on death my npcs become bloody corpses thanks to CUB, but the chest icon hides all of it.
The quality of life I get from pocket change and the call to change to lootable automatically is really great, the chest icon is a minor annoyance in my games.
After executing the 'convert to lootable' macro, the npc's attribute sheet still shows up instead of the lootable sheet, and therefore cannot be looted. When I change it to the lootsheet manually, noting appears. The lootable icon will still show up on the token however.
Fantastic module! I've got a few ideas that would make it insanely perfect (for my very specific use anyway):
I'm running the Combat Utility Belt module, and I've rigged it with Triggler so when an NPC hits zero hit points, it triggers the "Generate Currency and Convert to Loot for Selected Tokens" macro. This is awesome, since once the NPC's health drops to <=0, it pops up a window asking if I wanna convert said NPC. Beautiful!
Feedback:
1.) One concern is it might be best if instead of triggering on the selected token, I wonder if there is a way to make it apply to "whichever token triggered the event". Just in case I'm selecting someone else when an NPC dies. Maybe as simple as a new macro/line of code in existing macro to get triggered instead?
2.) Settings wise, I would love a bit more granularity. For example. I never use platinum in my game, and would like the option to nix that from being handed out (similar to how I also don't use electrum, which I do appreciate being able to nix that one in the options!).
3.) I also would love the option to set a percentage of chance that armor/weapons are too damaged to be included in the loot. I can already imagine my players stockpiling weapons from the dead unnecessarily just because they can, lol.
4.) Finally, (and this probably could be solved with just a macro, or a commented out section in an existing macro that could be replaced), I'd like to be able to trigger a roll table to drop loot into the NPC's inventory. For instance, currently I have it set where CUB triggers your macro to make the NPC lootable. It simultaneously triggers a macro that I have set up that rolls a rolltable of rolltables (using the Loot Table by Better Roll Tables module). Currently all the resulting items from my rolltable show up in the chat window. I'd love it if I could make those items drop into the loot sheet automatically. I've attached an image of my rolltable set up for clarity. Actually, what I'd really love is for a window to pop up where I could approve/disapprove which items from the table will be dropped into the sheet from my rolltable result, but maybe I'm getting out of hand here!
Is your feature request related to a problem? Please describe.
Hi, simple request for this beautifull module. When combats are finish my players rush to open all killed NPC. It's pretty cool, but it's a little chaos when they are 30 deads bodys.
Describe the solution you'd like
A "chest" with all items and currency will pop on the battlemap at the end of the fight.
Describe alternatives you've considered
All items/currency will be transfert from dead NPC at the end of the combat. On the next battle this chest will be clear from previous items.
Additional context
Monk's TokenBar make something like that but without damaged items or a good monnaie calcul. So a easier way will be to use you currency calcul and create a new macro for destroy items. We can use Monk TokenBar just for transfer all items to a single entity.
Please add an option to convert the generated money for the silver standard rules:
10 copper to 1 silver,
100 silver to 1 gold,
100 gold to 1 platinum.
This is awesome, love to integration with other loot tables and one click hords by DC, for truly easy random encounter loot generation.
When converting an NPC to lootable, if the NPC has vision, players can see what the NPC sees when the deselect their character.
Repo steps:
This is happening on
FVTT v. 0.8.8
DnD5e v. 1.4.2
Expected behavior
The player should not be able to see what the lootable NPC can see, under any circumstances.
Screenshots
Player with their charater token selected, they can see what they should.
Player with their character token deselected, they can see what NPCs converted to lootable can see, based on current light settings.
Suggestion
Automatically disable token vision when it is converted to lootable.
Hello! Thank you for the excellent module. I'm using Foundry 0.7.9
When I use the Generate Currency and Convert to Loot for Selected Tokens macro, if a player tries to access the generated LootSheet they get this error:
To avoid this, I must run the macro and then open each token's sheet one-by-one.
I'm not sure if this is a Foundry limitation or a module incompatibility on my end, if so I apologize for the bad ticket!
It would be great to have a way to set the Damaged Items criteria from the default of only items with a rarity of Common to be able to choose items with either Common, blank, or both. Alternatively an automated function could be included for npc equipment to be updated to non-blank rarities so the items will work with this functionality (for example when an npc actor is placed in a scene or a way to update lots of actors at once such as those in the actors tab or a compendium).
An example of blank rarity items is non-magic equipment and items added from D&D Beyond Importer. These items and any non-magic equipment on imported npcs from this source have a rarity of blank, which would require manually editing every piece of equipment on the npcs/actors in order for their items to be potentially damaged.
Could the Readme instructions also be updated to include some information about how to know whether an item will be applicable for the Damaged Items functionality? I think this could help prevent some confusion for users who aren't seeing non-magic items damaged as expected.
Is your feature request related to a problem? Please describe.
Pocket Change works great in v10, but it doesn't seem to be supported in v11.
Describe the solution you'd like
I was just wondering whether it'll be support v11+.
Describe alternatives you've considered
I was going to look at Innocenti's Loot, but I really like how clean the DFred documentation is and how easy it is to use the modules.
Additional context
Nothing, just thanks for all the hard work you put into these modules
Is your feature request related to a problem? Please describe.
Integration of this macro NPC-to-Coin-Pile in the module, but in general a integration with Item Piles is the right direction to follow.
Optional feature: add a Token HUD button for convert the token to lootable and reverse, item pile let you do that.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
Is your feature request related to a problem? Please describe.
Loot Sheet NPC 5e is'nt compatible with v10
Describe the solution you'd like
Find a alternative to Loot Sheet NPC 5e
Describe alternatives you've considered
Hi, do you think you can make this module compatible with FoundryVTT-ItemPiles ainstead of Loot Sheet ?
Additional context
Thanks
Ask (via @dangerdaren): Settings wise, I would love a bit more granularity. For example. I never use platinum in my game, and would like the option to nix that from being handed out (similar to how I also don't use electrum, which I do appreciate being able to nix that one in the options!).
Use case: Finer control over exactly which currencies are in the game
Potential solution: Add settings to enable/disable generation for platinum, gold, electrum, and silver and convert between them based on the settings. Copper is always enabled as the fallback.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.