checking if item was sold?

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
789
Reaction score
502
First Language
Polish
Primarily Uses
RMMV
Is it possible to track/check which(and how much) X item was sold?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,778
Reaction score
1,206
First Language
Portuguese - Br
Primarily Uses
RMMZ
I think you can track it with event commands before open the shop and after close the shop.
before: Check the items that party already have, and record it somehow(in a variable, for example)
Open the shop.
After the player leaves the shop: Compare the items that the player has with the items that the player had before opening the shop.
Through this, you can compare the items the player had before entering the shop with the items he has after leaving the shop.
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
789
Reaction score
502
First Language
Polish
Primarily Uses
RMMV
I think you can track it with event commands before open the shop and after close the shop.
before: Check the items that party already have, and record it somehow(in a variable, for example)
Open the shop.
After the player leaves the shop: Compare the items that the player has with the items that the player had before opening the shop.
Through this, you can compare the items the player had before entering the shop with the items he has after leaving the shop.
Thats pretty clever! Thank you, can't believe myself that the solution was so easy...
 

dwiseman57

Merchant Prince Digital
Veteran
Joined
Jun 29, 2014
Messages
40
Reaction score
1
First Language
English
Primarily Uses
N/A
This works if you only have a few items... but what if you have 100's of different items? You'd need to check and store the number of each item you have in your inventory for each and every item in the database...
Is there not a script/plugin based way to do this? Just a simple plugin that counts the number of each item sold and stores it, rather than having to set up the variables yourself?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,778
Reaction score
1,206
First Language
Portuguese - Br
Primarily Uses
RMMZ
A little script call can do the trick to compare the items player have before and after, and use a code to catch the exceptions.
But I'm busy right now, if no one appears, I see what I can do later.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,227
Reaction score
1,635
First Language
EN
Primarily Uses
RMMZ
Is there not a script/plugin based way to do this? Just a simple plugin that counts the number of each item sold and stores it, rather than having to set up the variables yourself?
I have a plugin that might help: view/download Cae_BuySellVar (Google Drive).

It lets you stick a notetag like <sell var: 12> in an item's notebox; the game should then automatically add 1 to the value of game variable 12 every time the player sells one of those items. :kaophew:
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,227
Reaction score
1,635
First Language
EN
Primarily Uses
RMMZ
This looks perfect thank you! I will give it a try and report back. Do you make a lot of custom plugins caethyril?
Great! And yes, you can find my RMMV plugins over here~
 

Latest Threads

Latest Posts

Latest Profile Posts

Looking back at some sketches, and game design documents on my PC dated summer of 2015. I started development with the release of MZ, but in 2015, I felt a strong desire to make a game out of the blue. I remember feeling sad for no apparent reason, and all these ideas rushed into my head. Now that I think about it, since that day, everything has become easier to do on my PC . . . it’s very creepy.
Everything's going to be alright! We're all in this together. <3
Aaaaannd published my game's tech demo. :D

Feel free to download and play it. And give feedback!
Hey everyone, we know that the edit bar is missing. We're working on it. You can talk about it in the announcement here: https://forums.rpgmakerweb.com/index.php?threads/forum-errors-missing-edit-bar-etc.132715/
So, explain why we can no longer use BBC code or smilies in our posts? This sparks much sadness...

Forum statistics

Threads
107,794
Messages
1,032,255
Members
139,941
Latest member
Finley
Top