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.
 

Star

Sponsor

Dachimotsu":77e7pv2k said:
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.

Nobody should edit the default scripts anyway, you don't even need too.

Code:
# Title: Some kind of battle script

# By StarGGundam2 

# 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 = 60

    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[i]

      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

In order to change the opacity of the characters, read my fourth line of the script. I never really understood scripting either, but once you start poking around, you get the hang of it.
 
Excellent! Yes! Thank you very, very much. Everything about it works perfectly.
I know you must've went out of your way to make this, but I'm so glad you did.

If you need my help with something, feel free to ask, though the only help I could give you would be in things like Windowskins, Title Screens, Battlers, or regular pictures. I can't do spritework very well.
 
class Scene_Battle  
def update_phase2
start_phase3
return
end
end

^ I got a feeling it won't work
maybe:
class Scene_Battle
def start_phase2
start_phase3
return
end
end


Edit: Never mind, 'if it works don't fix it' :)
 
Actually, I just noticed that the script doesn't quite make the battle window transparent.
Let me try Silver Wind's suggestion.

EDIT: Tried it. Nothing changed. Seems that both ways work fine.
But the window's still not transparent.
 
StarGundam didn't make it transperant, but he told you how to do it yourself..
It's useful to learn some scripting.
I think he meant Window_BattleStatus though, not Window_MenuStatus.

Use this code to show bigger battlebacks, and make the party window transparent :
Note you won't see the difference until you switch to bigger battlebacks!
[rgss]# make the party window tasparent
 
class Window_BattleStatus < Window_Base
  def refresh
    self.contents.clear
    self.opacity =  210
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
end
 
# expanded battle-back area (viewport 1)
class Spriteset_Battle
  def initialize
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @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
    # 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(@viewport1, enemy))
    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
 
  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
    @viewport1.ox = $game_screen.shake
    # Set screen flash color
    @viewport4.color = $game_screen.flash_color
    # Update viewports
    @viewport1.update
    @viewport2.update
    @viewport4.update
  end
 
end
[/rgss]
Read line 6:
self.opacity = 210
It controls how transparent the window is. play with it until you find the right number, it should be between 0 and 255.
Oh and your battle backs should be 640x480, if they're the default size, your window won't look transparent.
 

Star

Sponsor

Dachimotsu":qt560mj6 said:
Actually, I just noticed that the script doesn't quite make the battle window transparent.
Let me try Silver Wind's suggestion.

EDIT: Tried it. Nothing changed. Seems that both ways work fine.
But the window's still not transparent.
It is transparent, it's just got a black background behind it. You'll probably need a bigger battleback, Use silverwind's idea for that.
@Silverwind, but I did say Window_BattleStatus o.o
 
I had already switched to using 640x480 battlebacks to see if it worked, and it didn't. But now it does, so thanks a bunch! (is there a faster way to delete all those numbers when copying and pasting the code?)

But now I've stumbled upon a problem I did not know about before. RMXP won't let me move battlers further down, so that they appear semi-behind the party window. Can that be fixed, or is there no way to change the functions of the program itself?

I'm sorry. I know I probably should've mentioned this at first, but I didn't know the program didn't allow battlers to go past the edges.
 
Dachimotsu, click line number on/off before you copy the code.
I didn't get what you wanna do with the battlers.

StarGGundam2: Sorry ^^;
Now I see you did both.. why is there a window_MenuStatus in your script though? :eek::
The party window is transparent, but the battleback will not show behind it without my code- All I did is make the height of the viewport 480, so it'll overlap the party window.(a tiny edit on lines 28 and 75)
you can't go beyond the limit of the viewport (640x320). The bottom part of the battleback isn't drawn to the screen, leaving the area below the party window black.
 
silver wind":1lu5aod2 said:
I didn't get what you wanna do with the battlers.

I want to make it so that larger battlers can appear behind the window where the party's stats are shown.
This is very crudely drawn picture, but I think it gets the message across.
crap.png
 

Star

Sponsor

Dachimotsu":3cnq350b said:
silver wind":3cnq350b said:
I didn't get what you wanna do with the battlers.

I want to make it so that larger battlers can appear behind the window where the party's stats are shown.
This is very crudely drawn picture, but I think it gets the message across.
crap.png
That's completely impossible as far as I know to do with RMXP. Because you can't get the battlers below the bottom line in the Database, unless you some how figured out how to do so.

@silver wind: There's a Window_MenuStatus in my script cause he requested for EXP to be removed from Scene_Menu, and that's what that part does for him. Think of it as the Window that operates the Main Menu.
 
It has to be possible. It seems like such a simple thing to do. (Well, simple for a scriptor, which I am not)
Isn't it at all possible to edit the database's functions? I seem to recall using a script long ago that let my enemies' HP values go higher than the limit. There's gotta be something.
I just tried using a too-big battler in the troop window, but the only line it won't go past is the bottom one. It goes through the top, left, and right ones just fine.
There's just gotta be a way around this.
 

Star

Sponsor

Dachimotsu":3jmni6rz said:
It has to be possible. It seems like such a simple thing to do. (Well, simple for a scriptor, which I am not)
Isn't it at all possible to edit the database's functions? I seem to recall using a script long ago that let my enemies' HP values go higher than the limit. There's gotta be something.
I just tried using a too-big battler in the troop window, but the only line it won't go past is the bottom one. It goes through the top, left, and right ones just fine.
There's just gotta be a way around this.
Code:
class Spriteset_Battle

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader   :viewport1                # enemy viewport

  attr_reader   :viewport2                # actor viewport

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    # Make viewports

    @viewport1 = Viewport.new(0, 0, 640, 480)

[color=#FF40BF]    @viewport5 = Viewport.new(0, 100, 640, 800)[/color]

    @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

    # 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))

    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[i]))

    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

Well... I thought about it and you're right. I guess I thought there'd be no way around it. Change the Pink Colored text's "100" in my script to the Y Position you want your enemy battlers to be at. Oh paste this below Silverwind's bit also. There should be no incompatibility
 
Well, on my computer, they appear red, but I still don't know how to use this script. I mean, what's the step-by-step process and how do I do this for multiple battlers or troops?

EDIT: Also, I discovered that with the script, battlers that are placed too high get cut off, so little feet just end up dangling in the center of the screen.
 

Star

Sponsor

Well.. All it does is move down the battler's to a specific position of y. Whatever position you put them in the database is where they'll be. But this @viewport5 = Viewport.new(0, 100, 640, 800) is the new port that positions the WINDOW Enemy Battlers in your game. The Battlers will just go wherever you decided you wanted them to go in the database (Did I say that already :down: )

anyway @viewport5 = viewport.new(x,y,width,height) Is all that means.

Increase of Y will move the Enemy Battler Window Down
Decrease of Y will move the Enemy Battler Window Up

You shouldn't really need to mess with the rest.

It should work with Multiple Battlers and troops, I tested it. Not sure about Height though, really tall ones are liable to get cutoff, but this seems to be the only work around to get battlers farther down the screen.

Edit: Well. This workaround will only work with Battlers about 320 pixels tall. Else it's not gonna work. Maybe a more experienced scripter can help
 
I've tested this with a large battler(480 height), but i get the head, not the feet cut off.
I fixed that by editing Sprite_battler's @height and making the viewport5 960 height.
Here's the full script, StarGGundam2's script and my edits:

[rgss]# Title: Some kind of battle script
# By StarGGundam2
# 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 = 60
    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
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    # ----- silver wind's edit: 800 >> 960 ----- #
    @viewport5 = Viewport.new(0, 100, 640, 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
    # 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, 100)) # new
    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
    @viewport1.ox = $game_screen.shake
    # Set screen flash color
    @viewport4.color = $game_screen.flash_color
    # Update viewports
    @viewport1.update
    @viewport2.update
    @viewport4.update
  end
 
end
 
 
class Sprite_Battler < RPG::Sprite
  def initialize(viewport, battler = nil, offset=0)
    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
      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
      #self.bitmap = RPG::Cache.picture(@battler_name)
      @width = bitmap.width
      @height = bitmap.height
      self.ox = @width / 2
      # ----------- edit ------------
      self.oy = @height - @offset
      # was: self.oy = @height
      # -----------------------------
      # 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
        whiten
        @battler.white_flash = false
      end
      # Animation
      if @battler.animation_id != 0
        animation = $data_animations[@battler.animation_id]
        animation(animation, @battler.animation_hit)
        @battler.animation_id = 0
      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
# --------------------------------------------- #
[/rgss]
Do like StarGGundam2 said for the enemy's y value. if you make it 120, be sure to also put 120 on line 153:
Sprite_Battler.new(@viewport5, enemy, 120)
 
Well, I tested your new script with a 480-tall battler, and I played around with that number (I made it 0, 100, 120, etc.), but parts of the battler still get cut off.

EDIT: Also, for some reason, the target cursor doesn't show now.

Now, I'm no good at scripting, so I could just be spouting nonsense... But what if you made a script that lowered the position of all battlers by 160 (the height of the party window), and then somehow "refreshed" the images so parts wouldn't be cut off?
 
Not my best coding example, but it works now (including the arrow):
I had to cut the enemy in half and show the bottom and the top as 2 sprites. apparently viewports are capped at 320 height, or it may be caused by some hidden class. Couldn't get it to work any other way.
[rgss]# Title: Some kind of battle script
# By StarGGundam2
# 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
    @viewport1.ox = $game_screen.shake
    # Set screen flash color
    @viewport4.color = $game_screen.flash_color
    # Update viewports
    @viewport1.update
    @viewport2.update
    @viewport4.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
      # -----------------------------
     
      # 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
              #found another sprite of this battler
              sprite.whiten
            end
           
          end
        end
        # ------------------------------------ #
        whiten
        @battler.white_flash = false
      end
      # Animation
      if @battler.animation_id != 0
        # ------------ edit : make both sprites animate ------------- #
        animation = $data_animations[@battler.animation_id]
        #animation(animation, @battler.animation_hit)
        @battler.animation_id = 0
        if $game_temp.in_battle
          for sprite in $scene.spriteset.enemy_sprites
            if @battler == sprite.battler
              #found another sprite of this battler
              @count = animation.frame_max
              sprite.loop_animation(animation)
              @second_sprite = sprite
            end
           
          end
        end
        # ----------------------------------------- #
        loop_animation(animation)
      end
      # ------- edit : make both sprites stop animating--------- #
      if @count and @count >0 : @count -= 1 end
      if @count==0
        @second_sprite.loop_animation(nil)
        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
    # ---------------  edit: was viewport1 ------------------
    @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport2)
   # -------------------------------------------------------
    # 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]
Animations will be double- it won't look good with some animations.
If you want to just use the default script (the animation will show on half of the sprite), erase lines 362-388 and paste this instead:
[rgss]      if @battler.animation_id != 0
        animation = $data_animations[@battler.animation_id]
        animation(animation, @battler.animation_hit)
        @battler.animation_id = 0
      end
[/rgss]
 
It works wonderfully!
However, I have now stumbled upon yet another glitch.
Animations that change the screen's hue leave it that way. The default Fire 3 animation turned the screen red.
If this can be fixed, then all my problems will be over.
 

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