No battle result screen

I'm trying to make it so that when you win a battle, there is no battle result screen. Instead, only the victory ME should be played, and after about 4 seconds the player is transported back to the map. Any help, please :)

i'm working with rmxp btw.
This one is easy as pie.

  1. class Window_BattleResult < Window_Base
  2.    def initialize(exp, gold, treasures)
  3.     @exp = exp
  4.     @gold = gold
  5.     @treasures = treasures
  6.     super(160, 0, 320, @treasures.size * 32 + 64)
  7.     self.contents = Bitmap.new(width - 32, height - 32)
  8.     self.y = 160 - height / 2
  9.     self.opacity = 0
  10.     self.visible = false
  11.     refresh
  12.   end
  13.   def refresh
  14.     self.contents.clear
  15.     end
  16.   end
Expand to see the code.

Paste above main. Click Line Number off to get rid of numbers.
Thanks! Gonna try it right now. I've thought myself how to edit scripts but for some reason i still find it hard to make my own scripts from scratch. Here's a cookie for Star! ;)

Edit: so I tried it out, the base function works. However, the victory bgm keeps playing on the map and you have to press enter to continue. I'd like to change it so that the victory bgm stops playing after you teleport back to the map and that you teleport to the map automatically. I'm gonna try to do that myself, but I'm not sure if it'll work out :p

Edit2: FFFUUUU! tried to make those edits, but i failed. Will you help me out Star?
  1. class Scene_Battle
  2.     def start_phase5
  3.     # Shift to phase 5
  4.     @phase = 5
  5.      # Return to BGM before battle started
  6.     $game_system.bgm_play($game_temp.map_bgm)
  7.     # Initialize EXP, amount of gold, and treasure
  8.     exp = 0
  9.     gold = 0
  10.     treasures = []
  11.     # Loop
  12.     for enemy in $game_troop.enemies
  13.       # If enemy is not hidden
  14.       unless enemy.hidden
  15.         # Add EXP and amount of gold obtained
  16.         exp += enemy.exp
  17.         gold += enemy.gold
  18.         # Determine if treasure appears
  19.         if rand(100) < enemy.treasure_prob
  20.           if enemy.item_id > 0
  21.             treasures.push($data_items[enemy.item_id])
  22.           end
  23.           if enemy.weapon_id > 0
  24.             treasures.push($data_weapons[enemy.weapon_id])
  25.           end
  26.           if enemy.armor_id > 0
  27.             treasures.push($data_armors[enemy.armor_id])
  28.           end
  29.         end
  30.       end
  31.     end
  32.     # Treasure is limited to a maximum of 6 items
  33.     treasures = treasures[0..5]
  34.     # Obtaining EXP
  35.     for i in 0...$game_party.actors.size
  36.       actor = $game_party.actors[i]
  37.       if actor.cant_get_exp? == false
  38.         last_level = actor.level
  39.         actor.exp += exp
  40.         if actor.level > last_level
  41.           @status_window.level_up(i)
  42.         end
  43.       end
  44.     end
  45.     # Obtaining gold
  46.     $game_party.gain_gold(gold)
  47.     # Obtaining treasure
  48.     for item in treasures
  49.       case item
  50.       when RPG::Item
  51.         $game_party.gain_item(item.id, 1)
  52.       when RPG::Weapon
  53.         $game_party.gain_weapon(item.id, 1)
  54.       when RPG::Armor
  55.         $game_party.gain_armor(item.id, 1)
  56.       end
  57.     end
  58.     # Make battle result window
  59.     @result_window = Window_BattleResult.new(exp, gold, treasures)
  60.     # Set wait count
  61.     @phase5_wait_count = 100
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # * Frame Update (after battle phase)
  65.   #--------------------------------------------------------------------------
  66.   def update_phase5
  67.     # If wait count is larger than 0
  68.     if @phase5_wait_count > 0
  69.       # Decrease wait count
  70.       @phase5_wait_count -= 1
  71.       # If wait count reaches 0
  72.       if @phase5_wait_count == 0
  73.         # Show result window
  74.         @result_window.visible = false
  75.         # Clear main phase flag
  76.         $game_temp.battle_main_phase = false
  77.         # Refresh status window
  78.         @status_window.refresh
  79.       end
  80.       return
  81.     end
  82.       battle_end(0)
  83.   end
  84. end
Expand to see the code.


I almost didn't realize you needed more help. In times like these it's okay, I think, to bump your topic. Just replace this code with the code I gave you before. You only need this code for it to work.
Thanks, it works now. I learned something new as well. because when i pasted this code, the victory bgm didn't play. But i made it work by adding $game_system.me_play($game_system.battle_end_me)

Thanks again to invest your time in my problem ;)
gRaViJa wrote:
Thanks, it works now. I learned something new as well. because when i pasted this code, the victory bgm didn't play. But i made it work by adding $game_system.me_play($game_system.battle_end_me)

Thanks again to invest your time in my problem ;)

Oh right, I took that out cause I thought you said you didn't want the victory music to play but I read it wrong. Oh well, glad you got it squared away.

Be well. :cheers:

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=71159