OhhLoz / Harvester

A QoL FoundryVTT module to improve the harvesting and looting experience.
GNU General Public License v3.0
2 stars 2 forks source link

Cant harvest custom tables that worked 3 weeks ago. #43

Closed Asiermd closed 4 months ago

Asiermd commented 4 months ago

Module Version: v1.8.0

Describe the bug Constant message about no resource being able to be drawn

To Reproduce Steps to reproduce the behavior:

Try to use previously working custom tables See error Expected behavior For the tables to work as previously did

Screenshots image

Browser: Google Chrome Versión 122.0.6261.70 (Build oficial) (64 bits)

Foundry Version:

Version 11 Build 315

Game System:

DnD 5e

p4535992 commented 4 months ago

If you click on the "Roll +" button is working ? (sound like a BRT problem)

Asiermd commented 4 months ago

Yes, it does work. strangely enough, even normal tables have the message, i have tried with an aaracokra, an adult gree ndragon and a giant spider, and it doesnt let me harvest them. My default sheet for tables is the harvest table if that information helps in anything.

p4535992 commented 4 months ago

Can you check out the uuid of the rolltable (click f12 search for the yellow message, the first argument is the rolltable object), i think there is another table with the "Arctic" name on the world ?

That error usually mean the table is not normalized ? Try to click on the "Balance" icon or use this macro

const tableUuid = <UUID OF THE TABLE>;
const table = await fromUuid(tableUuid);
    await table.update({
        results: table.results.map(result => ({
            _id: result.id, weight: result.range[1] - (result.range[0] - 1)
        }))
    });
    await table.normalize();        
Asiermd commented 4 months ago

Here are the warning messages: image

The two tables i use, i want for the first to roll on the second table a number of times depending on how well the characters do their own survival rolls, and i think there is nothing wrong with them, they worked before. image

p4535992 commented 4 months ago

Nothing.. seem all right (it is correct the table is 'Better Harvest Giant Spider Rolltable' not 'Arctic' ???)the last thing i can do is try to replicate the issue on my local macine... can you export these two rolltables (as json then rename with .txt for github stupid rule) and pass to me ? Sorry about this i have done many test, but i must have miss something...

ctbritt commented 4 months ago

having the same issue. I wonder if the issue is two harvester compendia of roll tables

  1. harvester.harvester from the Harvester Module
  2. BRT harvester rolltable from BRT. better-rolltables.brt-harvest-harvester

I have both and can't get rid of the BRT tables, since it's part of the BRT module, and I need that to make Harvester work.

p4535992 commented 4 months ago

It shouldn't be if the BRT is activate there is a priority order https://github.com/OhhLoz/Harvester/blob/06d544171e962fc3ca59f045f2ea91bf8919f3c0/src/scripts/lib/better-rolltables-helpers.js#L61 after this i just get the first rolltables of the array so there is no collision.

Another thing is enable the debug logg and check out the log with the prefix:

HarvestingHelpers | Found RollTablesMatched and LootingHelpers | Found RollTablesMatched They should show the list of tables retrieved by the search filters it's seem like the wrong table is taken ... or the formula used on that rolltable is wrong. the code takes the first rolltable in the list for good for now.

https://github.com/OhhLoz/Harvester/blob/06d544171e962fc3ca59f045f2ea91bf8919f3c0/src/scripts/lib/harvesting-helpers.js#L51

https://github.com/OhhLoz/Harvester/blob/06d544171e962fc3ca59f045f2ea91bf8919f3c0/src/scripts/lib/looting-helpers.js#L72

Asiermd commented 4 months ago

Here are both the first and second artic tables

fvtt-RollTable-arctic-ooRVP3bNhg0LLHG1.txt fvtt-RollTable-gathering_-arctic-n1Sd7x4uzjlxglRm.txt

Asiermd commented 4 months ago

And another screenshot of the warnings, now about an air elemental, as if trying to see if some or any monster at all could work: image and the game settings screenshot, if it helps with something: image image

p4535992 commented 4 months ago

i think the bug was on brt side try out the new combination

NOTE: If the error persist make sure to click the "Update" button on the rolltable at least once

Asiermd commented 4 months ago

I have updated both tables and the error is still there. Tried with a prewritten monster, and the error still there.

ctbritt commented 4 months ago

Yeah. updated as well. Really not sure what is going on.

Here's a screenshot of the latest: CleanShot 2024-04-11 at 16 53 00

p4535992 commented 4 months ago

Did you click on the update button ?

ctbritt commented 4 months ago

Yes

p4535992 commented 4 months ago

Are you sure you don't have any red lock active on the rolltable ? If you see any red lock click "Reset" 2024-04-11 23 17 47

ctbritt commented 4 months ago

CleanShot 2024-04-11 at 17 19 44

p4535992 commented 4 months ago

Can'r replicate uninstall and reinstall the module ? working fine on my side tested and retested. 2024-04-11 23 24 07

p4535992 commented 4 months ago

If you use BRT you must check the other BRt compendium and the rolltable Better Harvester | Hill Giant RollTable

ctbritt commented 4 months ago

I've checked both tables. neither have any red in them. I've both Harvest | Hill Giant and Better Harvester | Hill Giant tables to my world, no red. There is no red in the compendia either.

p4535992 commented 4 months ago

can i access your world ? and made a test ?

ctbritt commented 4 months ago

yes, find me on discord and I'll send you login info. thanks very much! callbritton

p4535992 commented 4 months ago

k i discovered the issue (ty ctbritt) it was my fault.... i should be able to solve this tomorrow, sorry again for this

p4535992 commented 4 months ago

possible resolved with version 1.8.3.... let me know it.

Asiermd commented 4 months ago

I ahve just updated the world, at it seems to be working, will keep trying with all the custom harvests i have i will let you know

Asiermd commented 4 months ago

Strangely enough, there are some official creatures that doesnt let me harvest them, for example the aartuk elder, the Giant Hyena and the air elemental, at least the few ones i have tried

ctbritt commented 4 months ago

seems to be working with caveats.

  1. "Auto Assign to Players" MUST be enabled. it won't return any results otherwise. Suggest just removing this setting, since it seems like the default anyway.
  2. Can't seem to change the regex function to determine which table it gets data from.

for example. I have a monster called a Shadow Cloaker. (It's a beefed up Cloaker. The tables would be identical.) no matter how I name the tables and the monster, which is

source reference in all cases is "Shadow Cloaker"... there's no regex anywhere to be found in these names. But it only pulls results from Better Harvester | Shadow RollTable... I'm getting debug messages like so: CleanShot 2024-04-12 at 13 57 13

And here are the four tables it finds: CleanShot 2024-04-12 at 13 58 16

p4535992 commented 4 months ago

Fixed not removed on next release (because some people like a more manual way ???): "Auto Assign to Players" MUST be enabled. it won't return any results otherwise. Suggest just removing this setting, since it seems like the default anyway.

Fixed on next release: Can't seem to change the regex function to determine which table it gets data from (more test needed ???)

p4535992 commented 4 months ago

The last 2 bug from @ctbritt should be solved on 1.8.4, but the one from @Asiermd not sure... maybe it was the bug on thefake regex ? can you try again ?

Asiermd commented 4 months ago

Updated the module and keeps happening, not with all, but with some, i managed to harvest an otyugh but not a giant spider image image

p4535992 commented 4 months ago

@Asiermd Can i access your world ? sadly i cannot replicate this on my side (contact me on discord)

ctbritt commented 4 months ago

Seems to be working pretty well for me here! there are some edge cases that seem to want custom tables, like a homebrew Cave Dragon not being recognized. But overall, it's working well! thanks for all your hard work on this.

p4535992 commented 4 months ago

For finally close this issue on 1.8.5 i add for @Asiermd a check for min dc (only with BRT) for avoid confusion between "I don't find any table" with "the rolled dc is just not enough"

There are two chat messages now:

'Afsr' attempted to harvest resources from 'Shadow Demon' but failed to find anything for this creature.

'Afsr' try is best to harvest resources from 'Shadow Demon' but failed to find anything for this creature.

and a explicit log on the web console:

The rolled dc 'XXX' is not enough for this table 'YYY' the minimal DC is 'ZZZ'