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.

Variable Adding Monsters

khmp

Sponsor

If these monsters can be represented by an event its really easy. Just create an event. Do the following commands:

Battle Processing: Troop select the troop you want to fight.
  Win Section
    Control Variables
      Add constant 1 to the variable you want.
  Lose Section
End

Good luck with it kratos609! :thumb:
 
Open your Script Editor
Right-Click on Main (last script), and select "Insert"
Enter a Name:  (Count Battles Won)
Paste the following code
Edit the variable # ('9') to the variable you want to use.

Code:
class Scene_Battle
  
  alias brew_battle_end battle_end
  
  def battle_end(result)
    # Increment Battle Win Count
    if result == 0  # Win
      #
      # Change '9' to the game variable you want to use
      #
      $game_variables[9] += 1
    end
    brew_battle_end(result)
  end
end

Be Well
 

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