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.

Battle End Window (XP) Problem

So I happen to be completely new to scripting. I understand the basics such as assigning variables and such, but nothing more.
In my latest attempt at altering certain parts of the Default Battle System, I'm attempting to alter it so that at the end of a battle, it merely says a congratulatory message such as 'Victory'.
My game doesn't call for experience or gold, as players can progress in stats by other means, but even if you don't assign any experience or gold to a monster, it still displays '0 EXP gained, 0 Gold gained' or something similar, which is a fairly pointless message.

Can anyone help me with this, please?
 
So you want to remove Exp and gold in the battle result window?, try this:


Code:
#==============================================================================
# ** Window_BattleResult
#------------------------------------------------------------------------------
#  This window displays amount of gold and EXP acquired at the end of a battle.
#==============================================================================

class Window_BattleResult < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     exp       : EXP
  #     gold      : amount of gold
  #     treasures : treasures
  #--------------------------------------------------------------------------
  def initialize(exp, gold, treasures)
    @exp = exp
    @gold = gold
    @treasures = treasures
    super(160, 0, 320, @treasures.size * 32 + 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.y = 160 - height / 2
    self.back_opacity = 160
    self.visible = false
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.draw_text(110, -10, 82, 52, "Victory")
    y = 32
    for item in @treasures
      draw_item_name(item, 4, y)
      y += 32
    end
  end
end

Just place the script above main or replace the original Window_BattleResult script with this one.
If you want to change the Victory message, go to line 30 and replace "Victory" with "your own victory message".

Over and out - Gando  :thumb:
 
Oh wow! Thanks for the quick reply Gando! I'll test it now to see if it works, and edit my post afterwards. :)

EDIT: Well, it worked, kinda. For some reason I can't see the victory message, though.

EDIT: Never mind, I tried out replacing the Battle Result instead of making my own above main, and it works now. Thanks for the help!
 

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