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.

[Resolved]Add 99 of every item for debug purposes

Thanks mostly to MicKo, I've finally got a bit of an understanding of how scripting menus works, and I've been trying to make my own little edit to the item menu to see what I'm capable of at this point. Evidently I'm not yet capable of what should be a pretty simple little command, however, as to test the script properly I need to have a large number of different items. Since adding them via the basic event commands one by one is such a damn chore (and this is something I need on occasion for my main project anyway), I figured I'd ask youse guys: How do you add, from a script event command, 99 of every item in the database in one go? It's evidently not as easy as copying the little bit from (I think) Game_Party that gives you 99 of all the items in debug mode, that's for sure.

Thanks all.
 

Ares

Member

Add this in a new script slot above main:
[rgss]class Interpreter
 
  def debug_items(amount=99)
    for item in $data_items
      $game_party.gain_item(item.id,amount)
    end
    for weapon in $data_weapons
      $game_party.gain_weapon(weapon.id, amount)
    end
    for armor in $data_armors
      $game_party.gain_armor(armor.id, amount)
    end
  end
 
end
[/rgss]
What this script does is that it iterates through every database entry in items, weapons and armors and puts 99 of them in the inventory.

You can now use a call script command to fill the inventory with amount of every item/weapon/armor, like this:
[rgss]debug_items #=> will give the player 99 of each item
debug_items(200) #=> will give the player 200 of each item
 
[/rgss]
 

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