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.

[XP] $game_temp.shop_goods parameters?

Does anyone know the parameters for shop goods?

I think it's just an array filled with weapons, armor, and/or items, but I want to make sure.

If you could respond that would be very helpful for a simple script I'm working on.
 
Shop goods is basically an array of arrays of numbers, its really simple... if you have nothing, your shop goods will look like this...

Code:
[]

If you have any items at all, then the array will turn out like this...

Code:
[[x,y], [x,y], [x,y]]

x : signifies 0.) Item, 1.) Armor, 2.) Weapon
y : signifies item by ID number in database

Lets say you have the first 3 items, the first 3 armors and the first 3 weapons in your database then your $game_temp.shop_goods will be...

Code:
[[0,1], [0,2], [0,3], [1,1], [1,2], [1,3], [2,1], [2,2], [2,3]]

Looking into Window_ShopBuy/Window_ShopSell further handles this data to determine which items you're buying or selling, looking into their refresh method should be all you need to do to understand the rest but if you have any further questions, shoot!

Hope I have helped you some, good luck with it :thumb:
 

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