Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Switching inventory

Hello, I was looking for a way to exchange all the iteams between 2 characters.  For exemple, each time the main character would enter some alternate world, he would become someone completly different.  I would use 2 different characters to be the 2 main one.  But, I want them to also switch inventory and gold.  The first one wouldn't have the same items as the other one and each time you change world, the items and gold would switch.

If you know some way to do it, please tell me :)
 
If I get what you're saying, you basically want to simulate two different inventories for two different characters based on what character the player is currently playing as.

There is a way to do this but it is quite tedious. Every time the party is going to "switch", you would have to place every count of every item in a different variable, as well as gold. In a SEPERATE set of variables you would have the "other" party member's inventory count. Since RMXP (annoyingly) only allows increase and decrease of inventory instead of setting to a value, you will have to decrease each count by a large number, say 9999 to decrease it to 0. You would then take the inventory variable set of the new party member and add each of those values to the corresponding item count.

Obviously this leads to highly redundant code so you would want to use common events as much as possible. If this becomes too tedious for you, you may want to consider making it as a script request in the RGSS section. I'm not much of a RGSS scripter but I would suspect this code could be greatly reduced in terms of redundancy if a data structure like an array was utilized.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top