Saibot393/LocknKey

Lock & Key + Item Pile in CSB

Closed this issue · 26 comments

Hey,

I'm trying to make Lock & Key work with Item pile in CSB (since Item Pile just got patched to work in CSB, wich is awesome).

I found some things that do not work as expected in the pickpocket feat :

  • money is not working at all (I can see the money in the pickpocket popup, but when I try to take it, nothing change in both tokens). But on the Item Pile side everything is working fine around money outside of peackpocket (custom money settings of Item Pile, like in the first screenshot).
    image

  • regarding items, I can take them but there is 2 issues :
    1 - Item that are taken during pickpocket and fall to 0 quantity does not disapear form inventory (but the quantity is 0, quantity is
    set up in Item Pile custom quantity, like in the 2nd screenshot).
    image

        2 -  When a token peackpocket an item that is already existing in his inventory, an other pile is created instead of stacking on the 
          already existing item (like Item Pile does since the patch).
    

I don't know if those features are expected in your module (if not feel free to ignore this), but since it's supposed to be compatible with Item Pile I tested it.

Btw, I also have a question about the peackpocket setting, I don't understand the last 3 settings (last screenshot), what is this supposed to do exactly? Is it a DnD5 only feat? I can't test it because I don't understand the mecanism.
image

Sorry for being such a pain man 😭

Also, i'll translate all your modules in FR soon to make it up

  1. I will look into, ist that still the same CSB world file you send me last time?
  2. That is currently intended (more or less) intended. It is basically a safety feature to not accidentally delete or overwrite item data (both the item at 0 remaining and the not stacking)
  3. The last three options are there to allow for a dynamic Pick Pocket DC. In D&D5e for example, these settings would allow for the use of passive perception as the default pick pocket DC (1. setting) or active perception checks to increase/update the Pick Pocket DC (2. and 3. setting)

Don't worry about all the questions, i am happy to answer them

Thanks for your answer,

Yes, it's the same CSB world, I'm doing a bunch of testing of various modules on it.

So, if I understood correctly, the pickpocket DC formula is "based" on the victim's attributes? Like if I try to stole a token with a variable named "paranoia" (=15) then the DC would be 15+ ? And I could use the formula @system.props.paranoia to refer this attribute (in CSB, attributes are stored with the system.props.X path)?

And then, if I want to formula to be dynamic (so every try is based on a new check), then I check the option "auto update" and I put a perception key word? Then everytime a pickpocket is tried, the roll associated with the key word will be rolled?

Does the roll need to be an inline roll in the character sheet? Or could it be a macro as long as the flavour is containing the key word?

Yes, thats correct, the first formula is passiv and the keyword is the active part. However the pick pocket will not trigger another check, instead a check containing the keyword will be used as the new DC(though i could add an aposed check). Every roll that has an ouput in the chat containg the keyword should work. The module also includes a macro to reset tokens pick pocket dc to the default passive/formula calculated value, in case you want to use both methods at the same time.

There is no limit in the peackpocket max try (like in the lockpicking action)? Because if I have a player that try to stole a token and fail because the perception check is a succes, nohting is preventing him to spam it right?

Currently not, but i can add a limit similar to the lock pick attempts.

I think that could be a nice feat indeed.

So I tried again the peack pocket thing, but it seems that whatever I put in the "peack pocker default DC formula" is not being used at all nor whatever I put in the "classic" default peack pocket difficulty. When I create a new token/actor, the default is always -1 (in the token settings), and that value is always the one that is take in consideration for what I saw (changing this value work tho).

Are there any errors in the console when opening the settings sheet of a new actor for the first time? Does the "Reset Pick Pocket DC (selected or scene wide)" macro reset the values correctly?

Also, what is the formula you used for pick pocket dc?

My PP formula is : 1d20 + @actor.system.props.Escamotage + @actor.system.props.AGI_mod (1d20 + dex mod + pick pocket mastery), and it works fine.

Then the set up is :
image
(using dex mod as the check)

But I always get this in the token :
image

I have nothing in the console. I tested this without any other modules.

I tried to replicate the two bugs (money not transferring and the DC not being calculated correctly) with the actor export you send me last month.
This version of the character only has currencies so i tried to base the DC on the currencie and it seemed to work. Did you try to use the reset macro? There is achance, that the -1 value was set previously as the explicit value and is therefore not overwritten by the default formula/value.
Regarding the problem with looting money, was that with an item pile token? In this case, could you send me money data path of such an token/actor (type canvas.tokens.controlled[0].actor.system.props into the console while controlling the token)
Could you send me an up to date export of the actor type for further testing?

No I forgot to try the macro, mb, I'll test it.

About the looting money issue, it was not an item pile ''pile''. It was a classic token actor (NPC like). But I got the issue with both anyway (pile and classic token).

I'll send you the data path and an the actor asap.

image
Here is the screen of props path in that token

If I use the macro (game.LocknKey.ResettoStandardFormulas({pLP : true, pLB : true});), nothing changes and all token that I pop still have -1 as a default difficulty for pick pocket.

Actor template :
fvtt-Actor-pc-tAcPUTXoac404RXK.json

Actual actor :
fvtt-Actor-test-MLXiIiTpEWYb479K.json

(Those are kind of messy because I only use it for testing).

you could try to use this macro:

let vTokens = game.actors.map(actor => actor.prototypeToken);

for (let i = 0; i < vTokens.length; i++) {
	game.modules.get("LocknKey").api.LnKFlags.ResetPickPocketDC(vTokens[i]);
}

That will reset the Pick Pocket DC of all prototype tokens
I am currently looking into the problem with the currency

Regarding the currency pick pocketing, if i use the "Test" actor you included as both the pick pocketed and the pick pocketer it seems to work fine. Could you test that specific case to see if it also works for you?

Well, I find out something weird.

When I try to pick pocket a pile (from item pile), nothing is actualy stolen, but the popup show the right amount and type of money. For exemple :
Stealing this due :
image
Opens this :
image
Money value don't change, but the display is correct.

But when I try to steal from a non-pile token (classic PNJ let say), the display is very weird and do not match at all the actual amonts.
I tried to self steal (as you asked) this token :
image
And I got this pop up :
image

Also I tested the macro :
let vTokens = game.actors.map(actor => actor.prototypeToken);

for (let i = 0; i < vTokens.length; i++) {
game.modules.get("LocknKey").api.LnKFlags.ResetPickPocketDC(vTokens[i]);
}

But still, all tokens that I create have the -1 default and all other tokens don't change their settings.

I think to properly fix this/figure this out, i will need your world file (just the "raw" data without pictures, sounds...)

I'll try to make it in a fresh world with minimum settings to check and then I'll give it to you

I just tried in a new fresh CSB world and it works fine... currency + difficulty settings... I don't understand why that does not work in my main world... I need more testing to understand...

So.... I deleted and recreated actors and token from scratch in my main CSB world and the pick pocket money is working fine... I have NO idea why in my old actors those weird bugs were happening. But I tested so many stuff that maybe I fucked up the settings.

I'm sorry that I made you lose your time over my own mistake...

Regarding the difficulty setting (DC formula), I can't get it to work in my main world (tried both macro) but it work fine in the fresh world, wich I don't know... I tested in without any other module buf still not taking the DC formula settings (even the classic default pick pocket formula is not taken). I'll try to find out.

I'll let you know if I find the origin of the bug, must most likely it's a problem, not your module, again i'm sorry for that. I should have check this deeper before opening the issue.

Don't worry, narrowing down the problem, especially in a modular system, can be hard. Let me know if i can be of any help.

Ok I find where the problem is :

When I use the item pile macro to convert a token into a lootable :

if (!canvas.tokens.controlled.length) return;
game.itempiles.API.turnTokensIntoItemPiles(canvas.tokens.controlled)

And then I turn it back to a regular token with :

if (!canvas.tokens.controlled.length) return;
game.itempiles.API.revertTokensFromItemPiles(canvas.tokens.controlled)

THEN, the token si considered as "lockable" for ever, and right clic + shift on it will open the key making window AND lock the token (even if you don't create a key). Also the "lockable" and "locked" options keep to show up in the token settings (even if it's not a ridable nor a lootable).

I tried multiple ways and only the macro causes this issue. If I turn on and off the lootable via token settings of item pile, there is no issue.

I will look into it, at least the problem with the settings should be easy enought to fix. Part of it sounds though, like it may be a item pile issue, in which case i will try o see if i can fix it via PR.

The bugs you described should now be fixed with v2.3.3.
Thank you for your detailed description of the bug and how to produce it, that was very helpfull in fixing it. Also, thank you for your patience, sorry that it took so long.

Np, thanks for fixing all this so fast. And thanks for your amazing modules.

Just to make sure, i think this issue should be resolved, right? Or did i miss something? Otherwise i would close it.

Yep, this is solve