Make merchant to detect when you don't buy anything

late to the party, multiple solutions have been found already, but im tossing another hat into the ring here because why not. We love options.
you could write Object.values($gameParty._items) into a variable before the shopping trip, and then compare Object.values($gameParty._items) afterwards to that variable you wrote to earlier. itll keep track of all the items you have and their counts, but it wont be able to differentiate whether or not the player bought/sold nothing, or if the player bought and then sold the same item though
I understand that part @Sword_of_Dusk. A variable needs to have a base though. And you need the Variable to change in order to generate a different response. In this case, I don't think there is a way to check if the value of the Gold has changed between the Shopping trip, at least with the basic stuff. It requires plugins which these fine folks seem to have.
It just requires two variables. Put the current gold amount into the first, then put the current gold amount into the other right after the shop processing command. Follow it up with a conditional branch to see if the second variable is less than the first and create a message box based on that.
Yeah but is there an actual way to say "Current Gold" = "Variable A"? If there is, then you can try it that way.

Current Gold = Variable A
Shop Processing
Current Gold = Variable B
If
Variable A >= Variable B
Message: Negative Comment
Else
Message: Positive Comment

Of course, like it was stated, if a person Buys an item but then sells two items and the Gold comes up as greater than or equal then the amount before shopping, the merchant will still say something negative.
Yeah but is there an actual way to say "Current Gold" = "Variable A"? If there is, then you can try it that way.

Current Gold = Variable A
Shop Processing
Current Gold = Variable B
If
Variable A >= Variable B
Message: Negative Comment
Else
Message: Positive Comment

Of course, like it was stated, if a person Buys an item but then sells two items and the Gold comes up as greater than or equal then the amount before shopping, the merchant will still say something negat
Maybe this will help.

Yeah but is there an actual way to say "Current Gold" = "Variable A"? If there is, then you can try it that way.
It can be done with a script call.
I have nigh-on the exact same event and it works with a default project for me:
View attachment 281429
If you hit F8 while you're playtesting, you can open up the developer console and take a look for red error text perhaps suggesting that there's a problem with the configuration.

Perhaps also double check that the file is named, exactly, "ConfirmShopBuy.js".

Alternatively, if you're using both mine and Arthran's plugins together, it could be that they're conflicting with each other since they're designed around similar logic.

But! If Arthran's is working without issue and does what you need, I'd say just remove mine from your project and go with that.

Oooohh... It was the name!! I usually follow instructions very carefully but this time it was totally my bad. I installed it before Arthran's but named it "Confirm_Shop_Buy" (don't ask me why) and that was the issue. Now it works perfectly and it seems it does not conflict with Arthran's as far as I can tell!
late to the party, multiple solutions have been found already, but im tossing another hat into the ring here because why not. We love options.
you could write Object.values($gameParty._items) into a variable before the shopping trip, and then compare Object.values($gameParty._items) afterwards to that variable you wrote to earlier. itll keep track of all the items you have and their counts, but it wont be able to differentiate whether or not the player bought/sold nothing, or if the player bought and then sold the same item though

Definitely what I was looking for last night aside $gameParty.numItems(). Will take note of it. Thank you!
Oooohh... It was the name!! I usually follow instructions very carefully but this time it was totally my bad. I installed it before Arthran's but named it "Confirm_Shop_Buy" (don't ask me why) and that was the issue. Now it works perfectly and it seems it does not conflict with Arthran's as far as I can tell!
Mine shouldn't conflict with Zevia's, but there's also no need to use the two plugins together. Mine already has the option to use a switch, like Zevia's does, if you prefer it that way. It just also allows you to access the actual amount of currency spent and earned, should you desire it.
Mine shouldn't conflict with Zevia's, but there's also no need to use the two plugins together. Mine already has the option to use a switch, like Zevia's does, if you prefer it that way. It just also allows you to access the actual amount of currency spent and earned, should you desire it.
Do not worry, I won’t be using both in the future. I used both just for testing/learning purposes in a “Tutorial” project. I like them both and I still have no experience at all to discern which one I’ll use later in time ^^’ Thanks for the tip anyway!

Original thread: https://forums.rpgmakerweb.com/threads/make-merchant-to-detect-when-you-dont-buy-anything.162366/