Animebryan 139 Posted October 2, 2015 (edited) I was trying to make a common event add an item, weapon or armor to the player's inventory where the item was determined by a variable for it's database ID. By default, when adding in a item, weapon or armor, you have to specify the exact one, you can't determine it's ID by a variable. Is there a script or scriptcall to work around this? Any help would be appreciated. Edited October 2, 2015 by Animebryan Share this post Link to post Share on other sites
Vincent 27 Posted October 3, 2015 (edited) Let's say the variable to hold the item ID is variable #5. Then all you'd have to do is a script call: For an item: $game_party.gain_item($data_items[$game_variables[5]], amount) For a weapon: $game_party.gain_item($data_weapons[$game_variables[5]], amount) For armor: $game_party.gain_item($data_armors[$game_variables[5]], amount) Edited October 3, 2015 by Vincent 1 Share this post Link to post Share on other sites
Animebryan 139 Posted October 5, 2015 Let's say the variable to hold the item ID is variable #5. Then all you'd have to do is a script call: For an item: $game_party.gain_item($data_items[$game_variables[5]], amount) For a weapon: $game_party.gain_item($data_weapons[$game_variables[5]], amount) For armor: $game_party.gain_item($data_armors[$game_variables[5]], amount) Wow, that's really simple. Thanks for the help. Share this post Link to post Share on other sites
Animebryan 139 Posted October 6, 2015 Let's say the variable to hold the item ID is variable #5. Then all you'd have to do is a script call: For an item: $game_party.gain_item($data_items[$game_variables[5]], amount) For a weapon: $game_party.gain_item($data_weapons[$game_variables[5]], amount) For armor: $game_party.gain_item($data_armors[$game_variables[5]], amount) Actually, I need to find a way to set the 'amount' to a variable as well. I have a variable called quantity to determine the amount of the item. Could I just stick another [$game_variables[x]] where it says amount? Share this post Link to post Share on other sites
Vincent 27 Posted October 7, 2015 Yes. You would put $game_variables[6] instead of amount, assuming the amount variable is game variable #6. Share this post Link to post Share on other sites
Animebryan 139 Posted October 7, 2015 Yes. You would put $game_variables[6] instead of amount, assuming the amount variable is game variable #6. Do I have to use brackets on that entire part or should I exclude them? Share this post Link to post Share on other sites
Vincent 27 Posted October 7, 2015 Exclude them. Only have brackets around the number. Share this post Link to post Share on other sites