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.

Changing the battler and command window

Can someone please tell me how to change the battler sprite.

I am having trouble identifying the function to change the battler graphic or to hide it.

Also, I tweaked and rearranged all the windows in my battle scene to fit half the screen. However, I can't figure out how to rearrange the actor's command window, (the one with attack, items, skills, ect, ect.). I want to put the commands in two columns, two rows. How do I configure it?

And the Monster's Help Window, how do I shift its position? It seems to be linked with the other help windows, (Skills and items windows). I just want the Monster's window to be at a different position.

I hope I am coherent enough.
Thanks.
 
1) A bit lost on what you are trying to do with the battler sprites. Let me try to explain this...

Your scene holds your Spriteset_Battle.
Your Spriteset_Battle holds your battler sprites.
Your battler sprites are objects of the class Sprite_Battler.
The instance in Sprite_Battler, @battler holds the battler data, which is a Game_Battler object (either Game_Actor or Game_Enemy).
In Game_Actor/Game_Enemy is a method called character_name. This returns the filename (found in Graphics/Battler) that the Sprite_Battler will assign its bitmap to and thus being displayed in Spriteset_Battle. There are other names like screen_x that Sprite_Battler reads as well.

Now effecting those sprites can be done by modifing Game_Actor/Game_Enemy or Sprite_Battler directly, depending on what you are aiming for.

2) @actor_command_window

This is created in Scene_Battle def main, just find @actor_command_window. As of now it uses a Window_Command object class to create this. To alter this you will need to create your own object class and change @actor_command_window = Window_Command.new to @actor_command_window = your_object_class.new

I suggest looking at a Window_Command and Window_Item on making your own object class for this. If you need any help, just ask and I can walk you through it.

Now every place in Scene_Battle (1-4) you will need to check whenever it has @actor_command_window to adjust placement and such.

3) Help Window
The help window is for everything. It is shared by everything. Exactly what position do you want it to be moved to and when? This will need to be done in Scene_Battle when you find @help_window dealing with monster targeting and actions.
 
Well, about the battler, I just want to know how to enable or hide the battler sprite when the battle is in certain phase. Because when I enter the skills window, it doesn't hide itself, thus overlapping my window. Besides, I want to hide the battler when he is using a skill. Preferably, the battler just slides down the screen and disappears and after the battle animation is done, reappear.

This is what I am trying to achieve:
http://img56.imageshack.us/my.php?image=cbs2eg9.png

This is what I have done so far:
http://img443.imageshack.us/my.php?image=screen1pt9.png

This is my problem with the battler not disappearing:
http://img443.imageshack.us/my.php?image=screen2xn7.png

The monster help window:
http://img443.imageshack.us/my.php?image=screen3ru2.png

I want a permanent status window for the monster like in my picture. But I don't know which function to use to draw the monster's names and HP bars according to its life.

How do I alter an instance variable in another class btw?

Let's say, in:
class GameNotGlobal, there's a variable called @Real. The value is false.
How do I change this value from within another class?
I think this can be achieved by making it a sub-class e.g (class LocalGame < GameNotGlobal, and then reassigning the @Real = true)
Can it really work that way or is there another way to change a variable from within other classes.
Must I make GameNotGlobal a global variable in order to alter its value frmo within other classes?

Again, thanks a lot.
 
Hiding battler when selecting a skill:

Add this code:
Code:
class Scene_Battle
  alias_method :seph_hidebtlrsu_scnbtl_sss, :start_skill_select
  alias_method :seph_hidebtlrsu_scnbtl_ess, :end_skill_select
  alias_method :seph_hidebtlrsu_scnbtl_msar, :make_skill_action_result
  def start_skill_select
    seph_hidebtlrsu_scnbtl_sss
    @active_battler.hidden = true
  end
  def end_skill_select
    seph_hidebtlrsu_scnbtl_ess
    @active_battler.hidden = false
  end
  def make_skill_action_result
    seph_hidebtlrsu_scnbtl_msar
    @active_battler.hidden = true
  end
  def update_phase4_step5
    @active_battler.hidden = false
    seph_hidebtlrsu_scnbtl_up4s5
  end
end
That should do the trick.

Let me know if that works and we'll work on the next thing,
 
Thanks, Seph.

The battler did disappear, however, when I select a skill, and it goes into the targeting phase, my battler is not there. I want my battler to be there during the targeting phase but disappear once the skill is used. And when I select my battler, it reappears for a short while before crashing.

---------------------------
JLand
---------------------------
Script 'Hide Battler' line 19: NameError occurred.

undefined local variable or method `seph_hidebtlrsu_scnbtl_up4s5' for #<Scene_Battle:0x18678d0>
---------------------------
OK 
---------------------------

Which script should I edit to do the same for the items window?
 
I forgot to alias the method. XD

Code:
#==============================================================================
# ** Hide Battlers (On skill & item selection and use)
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 0.1
# 2008-12-10
#==============================================================================

class Scene_Battle
  alias_method :seph_hidebtlrsu_scnbtl_sss, :start_skill_select
  alias_method :seph_hidebtlrsu_scnbtl_ess, :end_skill_select
  alias_method :seph_hidebtlrsu_scnbtl_sis, :start_item_select
  alias_method :seph_hidebtlrsu_scnbtl_eis, :end_item_select
  alias_method :seph_hidebtlrsu_scnbtl_sas, :start_actor_select
  alias_method :seph_hidebtlrsu_scnbtl_ees, :end_actor_select
  alias_method :seph_hidebtlrsu_scnbtl_ses, :start_enemy_select
  alias_method :seph_hidebtlrsu_scnbtl_ees, :end_enemy_select
  alias_method :seph_hidebtlrsu_scnbtl_msar, :make_skill_action_result
  alias_method :seph_hidebtlrsu_scnbtl_miar, :make_item_action_result
  alias_method :seph_hidebtlrsu_scnbtl_up4s5, :update_phase4_step5
  def start_skill_select
    seph_hidebtlrsu_scnbtl_sss
    @active_battler.hidden = true
  end
  def end_skill_select
    seph_hidebtlrsu_scnbtl_ess
    @active_battler.hidden = false
  end
  def start_item_select
    seph_hidebtlrsu_scnbtl_sis
    @active_battler.hidden = true
  end
  def end_item_select
    seph_hidebtlrsu_scnbtl_eis
    @active_battler.hidden = false
  end
  def start_actor_select
    seph_hidebtlrsu_scnbtl_sas
    @active_battler.hidden = false
  end
  def end_actor_select
    seph_hidebtlrsu_scnbtl_eas
    @active_battler.hidden = true
  end
  def start_enemy_select
    seph_hidebtlrsu_scnbtl_ses
    @active_battler.hidden = false
  end
  def end_enemy_select
    seph_hidebtlrsu_scnbtl_ees
    @active_battler.hidden = true
  end
  def make_skill_action_result
    seph_hidebtlrsu_scnbtl_msar
    @active_battler.hidden = true
  end
  def make_item_action_result
    seph_hidebtlrsu_scnbtl_miar
    @active_battler.hidden = true
  end
  def update_phase4_step5
    @active_battler.hidden = false
    seph_hidebtlrsu_scnbtl_up4s5
  end
end

Try that. I added it for item selection and use.
 
Well, the battler is there for the targeting but after the targeting phase, this message pops up.

---------------------------
JLand
---------------------------
Script 'Hide Battler' line 42: NameError occurred.

undefined local variable or method `seph_hidebtlrsu_scnbtl_eas' for #<Scene_Battle:0x16efb98>
---------------------------
OK 
---------------------------
 

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