Question ^
I should add: "something" as in, the opposite of "nothing was bought".
I should add: "something" as in, the opposite of "nothing was bought".
◆Control Variables:#0001 check = The number of Potion
◆Shop Processing:Potion
: :Super Potion
◆Control Variables:#0001 check -= The number of Potion
◆Control Variables:#0001 check *= -1
◆If:check > 0
◆Text:None, None, Window, Bottom
: :You bought \v[1] Potion(s)!
◆
:End$gameParty.allItems().reduce((a, c) => a + $gameParty.numItems(c), 0)
forums.rpgmakerweb.com
Seems statistically unlikely, but then there are the code options caethyril offered.
She did recommend the AutoSwitchVars plugin specifically for that. 😉
var _Scene_Shop_doBuy = Scene_Shop.prototype.doBuy;
Scene_Shop.prototype.doBuy = function(number){
_Scene_Shop_doBuy.call(this, number);
$gameSwitches.setValue(42, true);
}
var _Scene_Shop_doSell = Scene_Shop.prototype.doSell;
Scene_Shop.prototype.doSell = function(number){
_Scene_Shop_doSell.call(this, number);
$gameSwitches.setValue(42, true);
}
I can't seem to find it. I'd prefer to stick to VS plugins only as otherwise things can't get messy real fast IMO.
@target MZ directive to suppress a Plugin Manager warning (which can otherwise hide other, useful warnings, e.g. about load order)./*:
* @target MZ
*/
;(function() {
var _Scene_Shop_doBuy = Scene_Shop.prototype.doBuy;
Scene_Shop.prototype.doBuy = function(number){
_Scene_Shop_doBuy.call(this, number);
$gameSwitches.setValue(42, true);
}
})();
Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-check-if-something-was-purchased-from-a-shop.152853/