checking if item was sold?

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
788
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,777
Reaction score
1,201
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
788
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,777
Reaction score
1,201
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,226
Reaction score
1,633
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,226
Reaction score
1,633
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

Not sure if it's true (and I won't judge or blame anyone if it is, really), but I heard from confident sources that you guys (and girls) really really like to
How is this new year for everyone? Hope you are well. Still deep in Covid in the US. Its like a vampire and refuses to die with even more strains. I need some holy water to kill it with.
in my game, what's known as HeadSpace is combining with the real world...
oh looks like the forums updated while I wasn't looking and we can put a banner now. Neat!
Treating this as a devlog

Forum statistics

Threads
107,664
Messages
1,031,255
Members
139,790
Latest member
TransDiv
Top