Formation Bonus

stickyka

Veteran
Veteran
Joined
Oct 15, 2017
Messages
39
Reaction score
10
First Language
english
Primarily Uses
RMVXA
Your'e the best, Sixth. Gonna try parsing that other bit below. Thing is, I'm not going to be using more party members than the formation grid can sustain. But here's the "parsed" version

# By default, all of your actors will appear in the Formation Bonus Scene, but only in the actual position window.
# There is no way to select them, but still, they will be there if your active party member's size is lower than the
# whole party size, aka you got more characters than you can take into battle. This is annoying for two reasons:
# 1. Not very decorative, which is the least of our problem now.
# 2. They will count to the actual formation. Just an example:
# We got a 3-man battle party system, so 3 characters can participate in the battle at max.
# During the game, we recruited 3 other characters to the party. Now we got 6 party members total.
# But we can still take only 3 into the battle. So, logically, the other 3 should not appear at all in the Formation Bonus Scene,
# because they are not in the battle, which also means they should not be in the formation at all.
# Yet, by default, they are. They will count toward the needed positions also, which actually breaks the whole system.
# But with my really little edit below, this can be fixed.
# However, by doing these edits, you will not be able to change your active party members from the menu
# without Yanfly's Party System script. What? Ohh, right, you were not able to do that from the moment you
# inserted the Formation Bonus script. Which is another side effect which will need to be fixed for those who are not using
# Yanfly's Party System. But, as I don't really need it, I am not planning to do anything about this one for now.
# The thing that needs to be edited for this is 'def item_max' as that one is actually bound
# by your maximum battle members' number. You would also need to change which number from the items (items are your actors now)
# are counted towards the formation bonus, and which one will actually appear in the position window. This number should be
# equal to your maximum battle members' size. And that should be the basics of it, but it is always easier in theory than
# in practice, so I will just leave it in theory for now.
# If you don't want to bother with this, just use Yanfly's Party System, easy "fix".
# So, after all these words, let's get started!
# Search for the first two lines like this in the script:
members.each do |actor|
# And replace both of them with this:
battle_members.each do |actor|
# This will hide any actor that is currently not in your active battle party from the Formation Bonus Scene.
# And that's all, folks! This was a really quick one, right?

EDIT/UPDATE: Sixth, so I think I almost solved it. It seems the game is allowing animations and Vlue's formation layout in camp menu. But it's calling the default positions according to symphony and not setting the actor locations based on the formation locations in Vlue's script. I'm going to play around with it a bit - try to get it to call Vlue's FORMATION_LOCATIONS rather than Symphony's ACTORS_POSITION. Tried something similar before without much luck, though.

AHA! I just figured out what part you meant about not importing the script as I was doing that! ^ I think it's going to work from here out, thanks!



UPDATE: Got the formation working with symphony. Everything seems fine with those two. But it made my suikoden II script stop working at all. From Estriole - If you happen to take a look and can point me toward the issue, that would be great. If not, it's fine, you've been more than helpful with the script this thread is about and concerning the fixes you posted. It seems the applied states just don't do anything as far as assigning what attacks (using notetags) can hit enemies with N state applied.

CORRECTION: After some testing, it's definitely applying states, but it isn't reading the notetags. Might be over-riding this script that notetags weapons for replacing the attack skill https://github.com/Archeia/YEARepo/blob/master/Gameplay/Weapon_Attack_Replace.rb
but also isn't using the notetags from the other script either, it seems.

EDIT: But it IS using the notetag for <RANGED>

MORE EDIT: So, I took out the extra scripts, so it's just symphony and vlue's. The notetags for weapons doesn't seem to be working when ranged is true. It works for skills, I had to add the notetag to the guard skill for it to be used in back row, but notetagging the weapons with <RANGE> does not allow the weapon to attack from back row.

FINALLY: I think I got it all down. The methods were overriding each other (namely Vlue's was overriding the other two scripts) so I just had to cut out pretty much any methods that defined rows for the purpose of targeting. Now, I have the formation and with the other script, I can assign states to enemies to define what skills can hit them by note tags in the skills, and with the weapon replace script, I can assign what default attack skill the weapon will use with weapon note tags. IE: Pretty well got everything working how I want now!

UPDATE: Found it was better to change the method names for what I'm doing (ie: middle_row becomes middle_rank as middle_row was being used by another script). Now, I just need to figure out how to assign states dependent on what row/position the actors are in.

EDIT to include unscramble of YEA party engine as well

# These 2 scripts use the same button from the menu by default.
# Obviously, anyone who uses both scripts would not want it like this.
# So, let's fix this little issue!
# Let's start with commenting out these lines in the Formation Bonus script:
class Scene_Menu
def command_formation
SceneManager.call(Scene_Formation)
end
end
# This will eliminate the button for this script, so we will need to make a new one to use.
# To do that insert these lines below the commented lines from before:
class Window_MenuCommand < Window_Command
alias formation1_command add_original_commands
def add_original_commands
formation1_command
add_command("Formation1", :formation1)
end
end
# Now the only thing we need to do is to insert these lines below the above lines:
if $imported["YEA-AceMenuEngine"]
#This line is optional only for Yanfly's Menu Engine script
class Scene_Menu < Scene_MenuBase
alias formation1_menu13211
create_command_window
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
formation1_menu13211()
@command_window.set_handler:)formation1,
method:)command_formation1))
end
#--------------------------------------------------------------------------
# * New Formation Command
#--------------------------------------------------------------------------
def command_formation1
SceneManager.call(Scene_Formation)
end
end
end
#This line is optional only for Yanfly's Menu Engine script# With this, there should be a new button for calling the Formation Bonus Scene.
# Note that this actually names your command button as 'Formation1' which is not a very decorative name for it...
# For renaming it to whatever you want, just change the "Formation1" to anything you like at 'Window_MenuCommand'.
# There, now you can call Vlue's Formation Bonus Scene and Yanfly's Party System Scene without any of them conflicting
# with each other. Nice!
# Extra note:
# If you are inserting the new command button with Yanfly's Menu Engine script,
# you do NOT need to add 'Window_MenuCommand' or else you will get a duplicate command button.
# Use either the normal way or Yanly's Menu Engine way, but not both!
 
Last edited:

stickyka

Veteran
Veteran
Joined
Oct 15, 2017
Messages
39
Reaction score
10
First Language
english
Primarily Uses
RMVXA
Hey, Sixth, if you get this, I'm preparing for the future. In case I do publish this, I'm working on credits given. I'd like to give you credit for your help in setting up the scripts to function together. One big reason that I want to go ahead and do the credit part so early is so everything is documented. The current project is also planned to be free an open source (as open source as possible, anyway). So, for anyone that ends up working with my project, I want to be able to point out all changes made in code. So, how would you like to be credited?
 

GreenBanana

Active Chain and Combo Input Skills plugin
Veteran
Joined
Mar 28, 2014
Messages
78
Reaction score
5
First Language
English
Primarily Uses
RMMV
@Roninator2
Sorry, no time to fix the lines right now, but will do it when I get some free time.
Just note that that script is made for a resolution of 800x600, not for the default resolution. You can still make it work for other resolutions, but you will have to manually re-position the visuals in the script, otherwise many things will get cut down visually.
Ohh, and it was made for v1.2 of the Formation script, so chances are, it is outdated. No idea what did Vlue updated in the later versions, but whatever it was, it is not present in my edited version.
Good morning, @Sixth . We were wondering if you ever found time to fix the formatting of your offered patch code. When transcribed with estimated line breaks, the section for the Yanfly and Vlue Formation patch has a section reading as follows:
Code:
#-------------------------------------------------------------------------- 
# * Create Command Window 
#-------------------------------------------------------------------------- 

        def create_command_window
            formation1_menu13211()
            @command_window.set_handler:)formation1,
            method:)command_formation1))
        end
There are two sets of :) characters which are not understood by RPG Maker VX Ace, and which appear as smileys on the forum.

Thank you very much for your time.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
I don't remember much about these edits I made, but that method should look like this:
Code:
  def create_command_window
    formation1_menu13211()
    @command_window.set_handler(:formation1, method(:command_formation1))
  end
 

GreenBanana

Active Chain and Combo Input Skills plugin
Veteran
Joined
Mar 28, 2014
Messages
78
Reaction score
5
First Language
English
Primarily Uses
RMMV
I don't remember much about these edits I made, but that method should look like this:
Code:
  def create_command_window
    formation1_menu13211()
    @command_window.set_handler(:formation1, method(:command_formation1))
  end
Thank you very much for your assistance. Now it seems the only tasks remaining are to reposition the battlers as they appear in the battle scene (simple enough), and then investigate why the inclusion of the Formation Bonus script forces the Add Party Member command to place added members into the reserve (not simple in the slightest). Have a nice day.
 

Chucksaints

Veteran
Veteran
Joined
Dec 8, 2016
Messages
34
Reaction score
1
First Language
Portuguese
Primarily Uses
RMVXA
Hello, great script!!! :)
Any way that we can combine with yanfly party system? I was wandering if it's possible to combine them into one scene OR If after actor index it could be added a new command to yanfly party system scene.

2) Is there any way to change battle formation via actor command in battle? (it can pass turn or not)

thank you :)
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,661
Reaction score
563
First Language
English
Primarily Uses
RMVXA
Formation command for yanfly party
Code:
class Scene_Party
  def command_formation1   
    SceneManager.call(Scene_Formation) 
  end
end
module YEA
  module PARTY
    COMMANDS =[          # The order at which the menu items are shown.
    # [:command,  "Display"],
      [ :change,  "Change",],
      [ :remove,  "Remove",],
      [ :revert,  "Revert",],
      [ :formation1,  "Battle Formation",],
      [ :finish,  "Finish",],
    ] # Do not remove this.
  end
end
class Scene_Party < Scene_MenuBase
  alias formation1_command create_command_window 
  def create_command_window   
    formation1_command   
    @command_window.set_handler(:formation1, method(:command_formation1))
  end
end
class Window_PartyMenuCommand < Window_Command
  def make_command_list
    for command in YEA::PARTY::COMMANDS
      case command[0]
      when :change, :remove, :revert, :formation1
        add_command(command[1], command[0])
      when :finish
        add_command(command[1], command[0], enable_cancel?)
      else; next
      end
    end
  end
end

Battle command (I copied yanfly autobatle)
Code:
module R2
  module BATTLEFORM
    ENABLE_PARTY_BATTLEFORM = true      # Enables battleform in Party Window.
  end # BATTLEFORM
end # R2

#==============================================================================
# ■ Window_PartyCommand
#==============================================================================

class Window_PartyCommand < Window_Command
 
  #--------------------------------------------------------------------------
  # alias method: make_command_list
  #--------------------------------------------------------------------------
  alias window_partycommand_cab2 make_command_list
  def make_command_list
    window_partycommand_cab2
    add_battleform_command if R2::BATTLEFORM::ENABLE_PARTY_BATTLEFORM
  end
 
  #--------------------------------------------------------------------------
  # new method: add_autobattle_command
  #--------------------------------------------------------------------------
  def add_battleform_command
    add_command("Battle Formation", :battleform) 
  end
 
end # Window_PartyCommand

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
 
  #--------------------------------------------------------------------------
  # alias method: create_party_command_window
  #--------------------------------------------------------------------------
  alias create_party_command_window_cab2 create_party_command_window
  def create_party_command_window
    create_party_command_window_cab2
    @party_command_window.set_handler(:battleform, method(:command_battleform))
  end
 
  #--------------------------------------------------------------------------
  # new method: command_aautobattle
  #--------------------------------------------------------------------------
  def command_battleform
    SceneManager.call(Scene_Formation)
  end
 
end

Theo SBS 1.4 sprite patch
Code:
# patch to fix Vlue formation with Theo SBS 1.4
# TSBS must be above Vlue Formations
# This script must be below Vlue Formations
class Window_Formation < Window_Selectable
  def draw_actor_graphic(actor,x,y)
    new_bitmap = Cache.character(actor.character_name)
    next_bitmap = new_bitmap.clone
    xx = actor.character_index % 4 * new_bitmap.width/4
    yy = actor.character_index / 4 * new_bitmap.height/2
    next_bitmap.blt(0,0,next_bitmap,Rect.new(xx,yy,next_bitmap.width/4,next_bitmap.height/2))
    # facing down
    contents.blt(x,y,next_bitmap,Rect.new(0,0,next_bitmap.width/3,next_bitmap.height/4))
    # facing left
#~     contents.blt(x,y,next_bitmap,Rect.new(0,next_bitmap.height/4,next_bitmap.width/3,next_bitmap.height/4))
  end
end
 

GreenBanana

Active Chain and Combo Input Skills plugin
Veteran
Joined
Mar 28, 2014
Messages
78
Reaction score
5
First Language
English
Primarily Uses
RMMV
Formation command for yanfly party
Code:
class Scene_Party
  def command_formation1  
    SceneManager.call(Scene_Formation)
  end
end
module YEA
  module PARTY
    COMMANDS =[          # The order at which the menu items are shown.
    # [:command,  "Display"],
      [ :change,  "Change",],
      [ :remove,  "Remove",],
      [ :revert,  "Revert",],
      [ :formation1,  "Battle Formation",],
      [ :finish,  "Finish",],
    ] # Do not remove this.
  end
end
class Scene_Party < Scene_MenuBase
  alias formation1_command create_command_window
  def create_command_window  
    formation1_command  
    @command_window.set_handler(:formation1, method(:command_formation1))
  end
end
class Window_PartyMenuCommand < Window_Command
  def make_command_list
    for command in YEA::PARTY::COMMANDS
      case command[0]
      when :change, :remove, :revert, :formation1
        add_command(command[1], command[0])
      when :finish
        add_command(command[1], command[0], enable_cancel?)
      else; next
      end
    end
  end
end

Battle command (I copied yanfly autobatle)
Code:
module R2
  module BATTLEFORM
    ENABLE_PARTY_BATTLEFORM = true      # Enables battleform in Party Window.
  end # BATTLEFORM
end # R2

#==============================================================================
# ■ Window_PartyCommand
#==============================================================================

class Window_PartyCommand < Window_Command
 
  #--------------------------------------------------------------------------
  # alias method: make_command_list
  #--------------------------------------------------------------------------
  alias window_partycommand_cab2 make_command_list
  def make_command_list
    window_partycommand_cab2
    add_battleform_command if R2::BATTLEFORM::ENABLE_PARTY_BATTLEFORM
  end
 
  #--------------------------------------------------------------------------
  # new method: add_autobattle_command
  #--------------------------------------------------------------------------
  def add_battleform_command
    add_command("Battle Formation", :battleform)
  end
 
end # Window_PartyCommand

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
 
  #--------------------------------------------------------------------------
  # alias method: create_party_command_window
  #--------------------------------------------------------------------------
  alias create_party_command_window_cab2 create_party_command_window
  def create_party_command_window
    create_party_command_window_cab2
    @party_command_window.set_handler(:battleform, method(:command_battleform))
  end
 
  #--------------------------------------------------------------------------
  # new method: command_aautobattle
  #--------------------------------------------------------------------------
  def command_battleform
    SceneManager.call(Scene_Formation)
  end
 
end

Theo SBS 1.4 sprite patch
Code:
# patch to fix Vlue formation with Theo SBS 1.4
# TSBS must be above Vlue Formations
# This script must be below Vlue Formations
class Window_Formation < Window_Selectable
  def draw_actor_graphic(actor,x,y)
    new_bitmap = Cache.character(actor.character_name)
    next_bitmap = new_bitmap.clone
    xx = actor.character_index % 4 * new_bitmap.width/4
    yy = actor.character_index / 4 * new_bitmap.height/2
    next_bitmap.blt(0,0,next_bitmap,Rect.new(xx,yy,next_bitmap.width/4,next_bitmap.height/2))
    # facing down
    contents.blt(x,y,next_bitmap,Rect.new(0,0,next_bitmap.width/3,next_bitmap.height/4))
    # facing left
#~     contents.blt(x,y,next_bitmap,Rect.new(0,next_bitmap.height/4,next_bitmap.width/3,next_bitmap.height/4))
  end
end
Sorry to be nit-picky, but could I get a confirmation of how we apply these? I'm aware I'm being overly rote, but I just like to polish it off with a confirmation that we just apply these as new plugins underneath their parent plugin, and have a general abstract as to their function.

Thanks ever so much!
 

GreenBanana

Active Chain and Combo Input Skills plugin
Veteran
Joined
Mar 28, 2014
Messages
78
Reaction score
5
First Language
English
Primarily Uses
RMMV
Thank you so much!
 

Christian777

Veteran
Veteran
Joined
Dec 14, 2014
Messages
49
Reaction score
25
First Language
spanish
Primarily Uses
RMVXA
Hi bro, there is some issues when using Luna Engine... when i exit from the formation window, this appears:
 

Attachments

BlackRoseMii

Veteran
Veteran
Joined
Mar 28, 2013
Messages
678
Reaction score
616
First Language
German
Primarily Uses
RMVXA
Hi, I'd like to ask for some help on a (hopefully) simple problem.

The script seems to only support the 1-tile high sprites, but I'm using Mack sprites, which are 2 tiles high. They work fine during battle and in the status window. But they don't appear properly in the formation section. It's just a small bit of the sprite.
Is there any way to make them properly visible? I'm no scripter so all I can do is guess what I have to change.

This is how it looks like currently:
Screenshot - 26_02.png
 

stickyka

Veteran
Veteran
Joined
Oct 15, 2017
Messages
39
Reaction score
10
First Language
english
Primarily Uses
RMVXA
EDIT: Ran a quick test of the script and my guess below doesn't seem to be the case. In fact, it shows 2 tile high sprites. I'd need to take a look at the whole project to figure that out.

Just a guess based on my experience, but maybe the sprites you're using are larger than the allotted lines/area used in the plugin. So, if you check the plugin, you can try increasing the number of lines and width used for the area the sprites go in, theoretically allowing enough room for them to fully display. Mind you, this is just an educated guess. I could be way off, definitely not a pro in this regard. I just know I've had similar issues and that has worked for me in the past. If you want to try that and need some help figuring out how to do it, send me a message, I can take a little time and see if I can fiddle with it.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,231
Members
137,607
Latest member
Maddo
Top