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.

Transparent windows, altered menus. [Resolved]

Hello, everyone. I'm new here, but I have not introduced myself, nor am I particularly familiar with this site's structure. Though I have been using RMXP for years, I've never understood scripting and that is why I am here.
I am not asking for anything major, like a Blue Magic script or anything. In fact, new scripts don't even need to be written to fulfill my request; I believe simple edits to the default scripts can solve my dilemma.

I do not possess the means of providing screenshots, and for that, I deeply apologize. I will, however, do everything I can to make my request clear and easy to comprehend.
It should be known that no additional scripts exist in the game, nor has there been any major editing to the default script. The only edit that was made was the capitalization of "equipment" in the status menu.

This request is comprised of three simple segments:

1. I would very much like for the Fight/Escape menu that appears at the beginning of the battle to be removed. None of the battles will have the option of running, so selecting Fight every turn is simply unnecessary.

2. I would like the battle window that features the party to be transparent like the other windows. This way, I can create larger Battle Backgrounds and Enemy Battlers.

3. I would like the existence of EXP to be made unknown to the player. Leveling occurs automatically (via event), so EXP is unnecessary. All things involving EXP should just be removed from the Victory Spoils window, the Main Menu, and the Status menu.


That concludes my request, though once again, I would very much like to offer my sincerest apologies for any rules or traditions broken in the creation of this topic. I am new, but I will learn.


EDIT: I have changed my mind, and have decided that I would like these to be in the form a separate, add-on script. I'm not comfortable with editting the current scripts.
 
[rgss]# Title: Some kind of battle script
# By StarGGundam2 & Silver Wind
# Writing this makes me feel weird
# In order to change the opacity of the character's status in battle change the
# self.opacity of the Window_BattleStatus class.
 
 
##################################
#####Window BattleStatus################
##################################
class Window_BattleStatus < Window_Base
  def initialize
    super(0, 320, 640, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    @level_up_flags = [false, false, false, false]
    self.opacity = 200
    refresh
  end
end
##################################
#####Window PartyCommand################
##################################
class Window_PartyCommand < Window_Selectable
  def initialize
    super(600, 600, 32, 32)
    self.opacity = 0
  end
end
 
 
##################################
#####Window BattleResult################
##################################
class Window_BattleResult < Window_Base
 
  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
    x = 4
    self.contents.font.color = normal_color
    cx = contents.text_size(@gold.to_s).width
    self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
    x += cx + 4
    self.contents.font.color = system_color
    self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
    y = 32
    for item in @treasures
      draw_item_name(item, 4, y)
      y += 32
    end
  end
end
##################################
#####Scene_Battle################
##################################
class Scene_Battle  
def update_phase2
        start_phase3
      return
    end
  end
  ##################################
#####Window MenuStatus################
##################################
  class Window_MenuStatus < Window_Selectable
      def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors
      draw_actor_graphic(actor, x - 40, y + 80)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 32)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_hp(actor, x + 236, y + 32)
      draw_actor_sp(actor, x + 236, y + 64)
    end
  end
  end
##################################
#####Window Status################
##################################
  class Window_Status < Window_Base
    def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 40, 112)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 96, 64)
    draw_actor_hp(@actor, 96, 112, 172)
    draw_actor_sp(@actor, 96, 144, 172)
    draw_actor_parameter(@actor, 96, 192, 0)
    draw_actor_parameter(@actor, 96, 224, 1)
    draw_actor_parameter(@actor, 96, 256, 2)
    draw_actor_parameter(@actor, 96, 304, 3)
    draw_actor_parameter(@actor, 96, 336, 4)
    draw_actor_parameter(@actor, 96, 368, 5)
    draw_actor_parameter(@actor, 96, 400, 6)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 160, 96, 32, "equipment")
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
  end
 end
 
 
 class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :viewport1                # enemy viewport
  attr_reader   :viewport2                # actor viewport
  attr_reader   :enemy_sprites
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    # ----- silver wind's edit: 800 >> 960 ----- #
    @viewport5 = Viewport.new(0, 0, 640, 480) #960
    # ------------------------------------------ #
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport4 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 101
    @viewport3.z = 200
    @viewport4.z = 5000
    #@viewport5.z = 200
    # Make battleback sprite
    @battleback_sprite = Sprite.new(@viewport1)
    # Make enemy sprites
    @enemy_sprites = []
    for enemy in $game_troop.enemies.reverse
      @enemy_sprites.push(Sprite_Battler.new(@viewport5, enemy, 0)) # new
      @enemy_sprites.push(Sprite_Battler.new(@viewport5, enemy, 160))
    end
    # Make actor sprites
    @actor_sprites = []
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    # Make weather
    @weather = RPG::Weather.new(@viewport1)
    # Make picture sprites
    @picture_sprites = []
    for i in 51..100
      @picture_sprites.push(Sprite_Picture.new(@viewport3,
        $game_screen.pictures))
    end
    # Make timer sprite
    @timer_sprite = Sprite_Timer.new
    # Frame update
    update
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    # If battleback bit map exists, dispose of it
    if @battleback_sprite.bitmap != nil
      @battleback_sprite.bitmap.dispose
    end
    # Dispose of battleback sprite
    @battleback_sprite.dispose
    # Dispose of enemy sprites and actor sprites
    for sprite in @enemy_sprites + @actor_sprites
      sprite.dispose
    end
    # Dispose of weather
    @weather.dispose
    # Dispose of picture sprites
    for sprite in @picture_sprites
      sprite.dispose
    end
    # Dispose of timer sprite
    @timer_sprite.dispose
    # Dispose of viewports
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
    @viewport4.dispose
    @viewport5.dispose
  end
end
 
 
# --------------------------------------------- #
# Fix by Silver Wind                            #
# --------------------------------------------- #
# expanded battle-back area (viewport 1)
class Spriteset_Battle
 
  def update
    # Update actor sprite contents (corresponds with actor switching)
    @actor_sprites[0].battler = $game_party.actors[0]
    @actor_sprites[1].battler = $game_party.actors[1]
    @actor_sprites[2].battler = $game_party.actors[2]
    @actor_sprites[3].battler = $game_party.actors[3]
    # If battleback file name is different from current one
    if @battleback_name != $game_temp.battleback_name
      @battleback_name = $game_temp.battleback_name
      if @battleback_sprite.bitmap != nil
        @battleback_sprite.bitmap.dispose
      end
      @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
      @battleback_sprite.src_rect.set(0, 0, 640, 480)
    end
    # Update battler sprites
    for sprite in @enemy_sprites + @actor_sprites
      sprite.update
    end
    # Update weather graphic
    @weather.type = $game_screen.weather_type
    @weather.max = $game_screen.weather_max
    @weather.update
    # Update picture sprites
    for sprite in @picture_sprites
      sprite.update
    end
    # Update timer sprite
    @timer_sprite.update
    # Set screen color tone and shake position
    @viewport1.tone = $game_screen.tone
    @viewport5.tone = $game_screen.tone # new
    @viewport1.ox = $game_screen.shake
    # Set screen flash color
    @viewport4.color = $game_screen.flash_color
    @viewport5.color = $game_screen.flash_color # new
    # Update viewports
    @viewport1.update
    @viewport2.update
    @viewport4.update
    @viewport5.update
  end
 
end
 
 
class Sprite_Battler < RPG::Sprite
  def initialize(viewport, battler = nil, offset=nil)
    super(viewport)
    @battler = battler
    @battler_visible = false
    @offset = offset# new
  end
 
  def update
    super
    # If battler is nil
    if @battler == nil
      self.bitmap = nil
      loop_animation(nil)
      return
    end
    # If file name or hue are different than current ones
    if @battler.battler_name != @battler_name or
       @battler.battler_hue != @battler_hue
      # Get and set bitmap
      @battler_name = @battler.battler_name
      @battler_hue = @battler.battler_hue
      # ----------- edit ------------
      if @offset.nil?
        self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
        @width = bitmap.width
        @height = bitmap.height
        self.ox = @width / 2
        self.oy = @height
      else
        bitmap2 = RPG::Cache.battler(@battler_name, @battler_hue)
        @width = bitmap2.width
        @height = (bitmap2.height) - @offset
        self.ox = @width / 2
        off = (@offset==0 ? -160 : 160)
        self.oy = @height - @offset
        src_rect = Rect.new(0, off, @width, @height+@offset) # @offset
        self.bitmap = Bitmap.new(@width, @height+@offset)
        self.bitmap.blt(0, 0, bitmap2, src_rect)
      end
<span style="color:#000080; font-style:italic;">=begin
<span style="color:#000080; font-style:italic;">      self.oy = @height + @offset # was +@offset
<span style="color:#000080; font-style:italic;">      src_rect = Rect.new(0, off, @width, @height+@offset) # off was -160
<span style="color:#000080; font-style:italic;">      self.bitmap = Bitmap.new(@width, @height+@offset)
<span style="color:#000080; font-style:italic;">      self.bitmap.blt(0, 0, bitmap2, src_rect)
<span style="color:#000080; font-style:italic;">=end
      # -----------------------------
     
      # Change opacity level to 0 when dead or hidden
      if @battler.dead? or @battler.hidden
        self.opacity = 0
      end
    end
    # If animation ID is different than current one
    if @battler.damage == nil and
       @battler.state_animation_id != @state_animation_id
      @state_animation_id = @battler.state_animation_id
      loop_animation($data_animations[@state_animation_id])
    end
    # If actor which should be displayed
    if @battler.is_a?(Game_Actor) and @battler_visible
      # Bring opacity level down a bit when not in main phase
      if $game_temp.battle_main_phase
        self.opacity += 3 if self.opacity < 255
      else
        self.opacity -= 3 if self.opacity > 207
      end
    end
    # Blink
    if @battler.blink
      blink_on
    else
      blink_off
    end
    # If invisible
    unless @battler_visible
      # Appear
      if not @battler.hidden and not @battler.dead? and
         (@battler.damage == nil or @battler.damage_pop)
        appear
        @battler_visible = true
      end
    end
    # If visible
    if @battler_visible
      # Escape
      if @battler.hidden
        $game_system.se_play($data_system.escape_se)
        escape
        @battler_visible = false
      end
      # White flash
      if @battler.white_flash
        # ------------ edit  ------------- #
        # the large enemy is made from 2 sprites.
        # this edit makes them flash together
        if $game_temp.in_battle
          for sprite in $scene.spriteset.enemy_sprites
            if @battler == sprite.battler
              #p 'found another sprite of this battler'
              sprite.whiten
            end
           
          end
        end
        # ------------------------------------ #
        whiten
        @battler.white_flash = false
      end
      # Animation
      if @battler.animation_id != 0
        # ------------ edit  ------------- #
        animation = $data_animations[@battler.animation_id]
        #animation(animation, @battler.animation_hit)
        @count = animation.frame_max
        @battler.animation_id = 0
        if $game_temp.in_battle
          for sprite in $scene.spriteset.enemy_sprites
            if @battler == sprite.battler
              #p 'found another sprite of this battler'
              #sprite.battler.animation_id = @battler.animation_id
              #sprite.animation() #(animation, @battler.animation_hit)
              #sprite.loop_animation($data_animations[@battler.animation_id])
             
              #animation = $data_animations[@battler.animation_id]
              #sprite.animation(animation, @battler.animation_hit)
              #sprite.update
              #sprite.battler.animation_id = 0
              #animation = $data_animations[anim_id]
              sprite.loop_animation(animation)
              @second_sprite = sprite
            end
           
          end
        end
        # ----------------------------------------- #
        #loop_animation(animation)
        animation(animation, @battler.animation_hit)
      end
      # ------------------ edit  ------------------ #
      if @count and @count >0 : @count -= 1 end
      if @count==0
        unless @second_sprite.nil?  
          @second_sprite.loop_animation(nil)
        end
        loop_animation(nil)
      end
     
      # ------------------------------------------- #
      # Damage
      if @battler.damage_pop
        damage(@battler.damage, @battler.critical)
        @battler.damage = nil
        @battler.critical = false
        @battler.damage_pop = false
      end
      # Collapse
      if @battler.damage == nil and @battler.dead?
        if @battler.is_a?(Game_Enemy)
          $game_system.se_play($data_system.enemy_collapse_se)
        else
          $game_system.se_play($data_system.actor_collapse_se)
        end
        collapse
        @battler_visible = false
      end
    end
    # Set sprite coordinates
    self.x = @battler.screen_x
    self.y = @battler.screen_y
    self.z = @battler.screen_z
  end
 
end
# --------------------------------------------------------------------------- #
class Scene_Battle
  attr_reader :spriteset
  def start_enemy_select
    # Make enemy arrow
    @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport2) #was viewport1
    # Associate help window
    @enemy_arrow.help_window = @help_window
    # Disable actor command window
    @actor_command_window.active = false
    @actor_command_window.visible = false
  end
end
 
[/rgss]
 
YES!! Excellent!
Everything is great, Everything is wonderful, Everything is perfect.

I can't thank you two enough for going out of your way to help me.

Now, uh... Do I click report to request the topic's lock?
 
Okay, well, for some reason, now bits and pieces of smaller battlers are vanishing no matter where I put them on the troop screen. I was hoping the script could be compatible with smaller battlers, but I guess it's not.
 
ok, a quick fix:
replace lines 155-156 in the script above:
@enemy_sprites.push(Sprite_Battler.new(@viewport5, enemy, 0)) # new
@enemy_sprites.push(Sprite_Battler.new(@viewport5, enemy, 160))

with this code:
[rgss]      name, hue = enemy.battler_name, enemy.battler_hue
      sprite = RPG::Cache.battler(name, hue)
      if sprite.height > 320
        # draw full-screen sprites
        @enemy_sprites.push(Sprite_Battler.new(@viewport5, enemy, 0))
        @enemy_sprites.push(Sprite_Battler.new(@viewport5, enemy, 160))
      else
        # draw smaller sprites in the normal way :
        @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
      end
[/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