Giter Site home page Giter Site logo

dfreds / dfreds-pocket-change Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 7.0 2.25 MB

A FoundryVTT module that automatically adds money to NPC character sheets when dropped on the canvas.

License: MIT License

JavaScript 96.48% HTML 3.52%
dfreds-modules foundryvtt

dfreds-pocket-change's People

Contributors

deadpyxel avatar dfreds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dfreds-pocket-change's Issues

Incapability with Token HUD Wildcard

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

Cannot open loot sheet after converting to lootable

Describe the bug
Cannot open loot sheet after converting to lootable after latest update of LootSheetNpc5e

To Reproduce
Steps to reproduce the behavior:

  1. Install libWrapper, LootSheetNpc5e, and DFreds Pocket Change and activate them in a new world
  2. Drop an NPC (such as acolyte) onto the canvas (observe that the console log says (dfreds-pocket-change | Generating treasure)
  3. Convert that actor to a lootable (via Convert Selected Tokens to Loot macro included with pocket change)
  4. Attempt to open that NPC's sheet and observe error in console

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)

jopeek/fvtt-loot-sheet-npc-5e#185

Convert Selected Tokens to Loot almost works...

Hey, this is great - but I'm having some bug going on...

When I run the macro then open the token -

  1. It shows the LootSheet5eNPC << so that's good
  2. But the currencies are [object Object], [object Object], [object Object], [object Object], and the last one is [object Object].

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!

Compatibility with Monk's Enhanced Journal loot sheets

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).

currency does not appear to populate when token is dropped

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)

Customize "isHumanoid" behaviour

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.

Items all gone!

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.

Percent chance that armor/weapons are too damaged to be looted

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

Macro to convert back from lootable

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.

Console and chat says loot generated, but not on character sheet

When I drag/drop an actor who could have currency on them, the chat says (for example)

image

And console says it too . . .

image

But as you can see, there's no coins on this guy.

image

Interestingly, if I use the button in that sheet to generate coins - it works:

image

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?

Add support for generating items with rollable tables

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.

Example rollable table:

Additional Sheets Request

I am hoping it might be possible to add the Obsidian compatibility and Merchant Sheet NPC compatibility.

send generated currency amounts to chat

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

damaged items dont work

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:

  1. Change 'Chance of Damaged Items' to 1 (tested on 0 to)
  2. Click on "Convert Lootables" on dead NPC with some stuff (like a Bandit)
  3. Look inside LootSheet5eNPC. I can always loot all items

Expected behavior
Loot nothing in dead body

Screenshots
Capture

Additional context
No error on F12. My compendium and DnD system are in french.

Equipment is never damaged

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.

Convert to Loot does not set the Sheet to a LootSheet

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:

  1. Drag an NPC actor into the canvas
  2. Select the token created
  3. Either use the macro or click in the "convert to Loot" button on NPC sheet
  4. See that features, special itens and such are removed, the permission is set to observer and the overlay icon is set, but the token sheet does not change to a loot sheet

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:
image

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
image

Result after conversion:
image

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?

Damaged items macro not working

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).

macro
loot sheet

Exchange items with items from compendium.

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.

v10 support with Loot Sheet?

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.

Will it be updated to v11?

Hello! Congratulations on the module, I really like it and would like to know if it will be updated to v11.

Move Currency amounts out of JS into Compendium or Rolltable for customization

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.

Mark Loot Sheet NPC 5E as dependency so that the Module Management screen will track it

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

Specific pocket change range (e.g., 2d6 gp, etc.)

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.

"Convert Lootables" button has hidden dependency on "Monk's Tokenbar" module

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:

  1. Create a new test world using D&D5e as a system.
  2. Launch world as gamemaster.
  3. Enable only the following modules: "DFred's Pocket Change", "Loot Sheet NPC 5e", "Monk's Tokenbar"
  4. Observe that the "Convert Lootables" button is visible in the right-hand sidebar.
  5. Disable "Monk's Tokenbar" module.
  6. Observe that the "Convert Lootables" button is no longer visible in the right-hand sidebar.

Expected behavior
The "Convert Lootables" button should appear when only "DFred's Pocket Change" and "Loot Sheet NPC 5e" modules are active.

Screenshots

  1. "Convert Lootables" button visible when "Monk's Tokenbar" module is active
    image
  2. "Convert Lootables" button no longer visible when "Monk's Tokenbar" module is inactive
    image

Additional Context
Foundry Version: 0.8.9
D&D 5e System Version: 1.4.2

"Damaged Items" dont work

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:

  1. Change 'Chance of Damaged Items' to 0.9
  2. Click on "Convert Lootables" on dead NPC with some stuff (like a Gobelin)
  3. Look inside LootSheet5eNPC. I can always loot all items

Expected behavior
Loot must of time nothing in dead body

Screenshots
image
image
image

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".

Add support for CUB triggers in macros

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

Toggle Chest Icon on lootable

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.

Not Lootable Aftet Executing Macro

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.

Feedback/Suggestions

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!

Screen Shot 2021-02-16 at 4 39 07 PM

One entity for all killed NPC after combat

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.

Awsome!

This is awesome, love to integration with other loot tables and one click hords by DC, for truly easy random encounter loot generation.

Converting NPCs with vision to lootable

Description

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

  1. Set the scene vision and lighting settings as shown in the screenshot
    image
  2. Add an NPC and a player token on the scene. Make sure there is no line of sight between the player and the NPC by placing them in different rooms or placing some walls between them.
  3. Add vision to the NPC if it does not already have it. The player token should also have vision enabled.
  4. Make sure the Player and NPC can acctualy see in the current set up, i.e. they have dark vision or lights are placed close to them.
  5. Select the NPC and convert it to lootable.
  6. Logged in as the player, load into the scene and click (or click and drag) on empty space to deselect your character token.
  7. You should now be able to see whatever the lootable NPC can see.

Expected behavior
The player should not be able to see what the lootable NPC can see, under any circumstances.

Screenshots

  1. Player with their charater token selected, they can see what they should.
    foundry_bug_token_selected

  2. Player with their character token deselected, they can see what NPCs converted to lootable can see, based on current light settings.
    foundry_bug_token_not_selected

Suggestion
Automatically disable token vision when it is converted to lootable.

GM must open actor sheet before changes are applied

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:
image

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!

Damaged Item functionality options, instructions

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.

v11 Support

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

FoundryVTT-ItemPiles with Dfreds-pocket-cgabge

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

Add configuration for specifying exact currencies to generate

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.