- Joined
- Feb 8, 2017
- Messages
- 67
- Reaction score
- 10
- First Language
- English
- Primarily Uses
- RMMV
I am working on a game where thru various interactions the player can gain/lose items which will either aid or adversely affect them in other areas. Due to the different plugins that I'm using and the way they interact, I find I have to have both inventory items and values in a Variable. It is vital that the numbers stay synced up, or all hell could break loose.
Therefore, I have a two common events set up. One to synchronize the variables with the Inventory counts and one to synchronize the inventory with the variables, depending on which values get changed in the various minigames or events. It is the latter that I am having trouble with.
I have tried several different methods, all of which give me an Undefined error. (see below)
I can't use gainItem or loseItem because those functions only add or subtract a set number of items. I need to set the number of items to a specific value.
Can someone please help? I've been banging my head on this for a few days now.
Thank you!
Therefore, I have a two common events set up. One to synchronize the variables with the Inventory counts and one to synchronize the inventory with the variables, depending on which values get changed in the various minigames or events. It is the latter that I am having trouble with.
I have tried several different methods, all of which give me an Undefined error. (see below)
$gameParty.item_number($dataItems[6].value).setValue($gameVariables[5].value);
$gameParty.numItems($dataItems[6]) = $gameVariables[5].value;
$gameParty.item_number($dataItems[6].value) = $gameVariables[5].value;
$gameParty.numItems($dataItems[6]) = $gameVariables[5].value;
$gameParty.item_number($dataItems[6].value) = $gameVariables[5].value;
I can't use gainItem or loseItem because those functions only add or subtract a set number of items. I need to set the number of items to a specific value.
Can someone please help? I've been banging my head on this for a few days now.
Thank you!



