Pluggin: http://sumrndm.site/switch-shop/
How can I edit the code to allow the party to gain the bought item? I'm looking at the code from line 296. I added the fourth line:
However, I'm not certain how to do this right - I don't understand why the numbers [2] and [1] are not the same.
Edit: So from line 184 there's this. So not certain, but I'd be experimenting on which number to use next I guess.
Reason for why I want to edit this:
So I've noticed that the "item" bought isn't added to your inventory. Only the switch is turned on. Is it possible to allow the item to also be added as an option?
I'd like to set items bought via the switch shop as hidden items, so that they're still invisible to the player, but I can do further manipulation behind the scenes. I wanted to use possession of hidden items as a conditional check to "restock" the item in the shop by turning off the switch.
How can I edit the code to allow the party to gain the bought item? I'm looking at the code from line 296. I added the fourth line:
Code:
Scene_SwitchShop.prototype.doBuy = function(number) {
$gameParty.loseGold(this._item[2]);
$gameSwitches.setValue(this._item[1], true);
$gameParty.gainItem(this._item[]);
};
Edit: So from line 184 there's this. So not certain, but I'd be experimenting on which number to use next I guess.
Code:
Scene_SwitchShop.prototype.prepare = function(goods) {
this._goods = [];
for(var i = 0; i < goods.length; i++) {
var good = $dataItems[goods[i][1]]
this._goods[i] = [];
this._goods[i][0] = good.name;
this._goods[i][1] = good.meta.switchShopSwitch;
this._goods[i][2] = goods[i][2] === 0 ? good.price : goods[i][3];
this._goods[i][3] = good.meta.switchShopDescription;
this._goods[i][4] = good.iconIndex;
}
this._item = null;
};
Reason for why I want to edit this:
So I've noticed that the "item" bought isn't added to your inventory. Only the switch is turned on. Is it possible to allow the item to also be added as an option?
I'd like to set items bought via the switch shop as hidden items, so that they're still invisible to the player, but I can do further manipulation behind the scenes. I wanted to use possession of hidden items as a conditional check to "restock" the item in the shop by turning off the switch.