Order fonction in a fight

I do not know if I put this subject in the good section but, I look for a script which allows to add a order fonction in fights.

If somebody can help me, here is the script which I use to have a team of more than 4 heroes :

Spoiler
#=================================## Traduction par masterjojo.# Modifié par Sihn#=================================##==============================================================================# ¦ Game_Party#==============================================================================class Game_Party#--------------------------------------------------------------------------# ? define instance variable#--------------------------------------------------------------------------attr_accessor :actors#--------------------------------------------------------------------------# Vous pouvez changer le nombre rouge par celui de votre# choix: c'est le nombre max de personne pouvant integrer# votre équipe (par défaut: 20).#--------------------------------------------------------------------------def add_actor(actor_id)actor = $game_actors[actor_id]if @actors.size < 20 and not @actors.include?(actor)@actors.push(actor)$game_player.refreshendendend#==============================================================================# ¦ Window_Base#==============================================================================class Window_Base < Window#--------------------------------------------------------------------------# ? draw character's battle sprite#--------------------------------------------------------------------------def draw_actor_battlegraphic(actor, x, y, opacity = 255)bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)src_rect = Rect.new(0, 0, 111, 111)self.contents.blt(x, y, bitmap, src_rect, opacity)end#--------------------------------------------------------------------------# ? draw character's HP meter#--------------------------------------------------------------------------def draw_actor_hp_meter(actor, x, y, width = 70, type = 0)if type == 1 and actor.hp == 0returnendself.contents.font.color = system_colorself.contents.fill_rect(x-1, y+27, width+2,5, Color.new(0, 0, 0, 255))w = width * actor.hp / actor.maxhpself.contents.fill_rect(x, y+28, w,1, Color.new(174, 68, 89, 255))self.contents.fill_rect(x, y+29, w,1, Color.new(156, 61, 80, 255))self.contents.fill_rect(x, y+30, w,1, Color.new(138, 53, 70, 255))end#--------------------------------------------------------------------------# ? draw character's SP meter#--------------------------------------------------------------------------def draw_actor_sp_meter(actor, x, y, width = 70, type = 0)if type == 1 and actor.sp == 0returnendself.contents.font.color = system_colorself.contents.fill_rect(x-1, y+27, width+2,5, Color.new(0, 0, 0, 255))w = width * actor.sp / actor.maxspself.contents.fill_rect(x, y+28, w,1, Color.new(62, 72, 164, 255))self.contents.fill_rect(x, y+29, w,1, Color.new(55, 65, 149, 255))self.contents.fill_rect(x, y+30, w,1, Color.new(49, 57, 130, 255))end#--------------------------------------------------------------------------# ? define method to draw squares#--------------------------------------------------------------------------def draw_square(x, y, width, color)self.contents.fill_rect(x, y, width, 1, color)self.contents.fill_rect(x, y, 1, width, color)self.contents.fill_rect(x + width, y, 1, width + 1, color)self.contents.fill_rect(x, y + width, width + 1, 1, color)endend#==============================================================================# ¦ Window_Gold#------------------------------------------------------------------------------# le texte a été remplacé par une icone#==============================================================================class Window_Gold < Window_Base#--------------------------------------------------------------------------# ? initialize#--------------------------------------------------------------------------def initializesuper(0, 0, 160, 64)self.contents = Bitmap.new(width - 32, height - 32)self.contents.font.name = $fontfaceself.contents.font.size = $fontsizerefreshend#--------------------------------------------------------------------------# ? refresh#--------------------------------------------------------------------------def refreshself.contents.clearcx = 24self.contents.font.color = normal_colorself.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)self.contents.font.color = system_colorbitmap = RPG::Cache.icon("032-Item01")rect = Rect.new(0, 0, 24, 24)self.contents.blt(124-cx, 0, bitmap, rect)endend#==============================================================================# ¦ Window_PlayTime#------------------------------------------------------------------------------# cette fenêtre a été compacté pour montrer toutes les commandes dans le menu#==============================================================================class Window_PlayTime < Window_Base#--------------------------------------------------------------------------# ? initialize#--------------------------------------------------------------------------def initializesuper(0, 0, 160, 64)self.contents = Bitmap.new(width - 32, height - 32)self.contents.font.name = $fontfaceself.contents.font.size = $fontsizerefreshend#--------------------------------------------------------------------------# ? refresh#--------------------------------------------------------------------------def refreshself.contents.clear@total_sec = Graphics.frame_count / Graphics.frame_ratehour = @total_sec / 60 / 60min = @total_sec / 60 % 60sec = @total_sec % 60text = sprintf("%02d:%02d:%02d", hour, min, sec)self.contents.font.color = normal_colorself.contents.draw_text(4, 0, 120, 32, text, 2)end#--------------------------------------------------------------------------# ? redefine update method#--------------------------------------------------------------------------def updatesuperif Graphics.frame_count / Graphics.frame_rate != @total_secrefreshendendend#==============================================================================# ¦ Window_MenuStatus#==============================================================================class Window_MenuStatus < Window_Selectable#--------------------------------------------------------------------------# ? initialize#--------------------------------------------------------------------------def initializesuper(0, 0, 480, 480)@column_max = 4@item_max = $game_party.actors.sizeself.contents = Bitmap.new(width - 32, row_max * 112)self.contents.font.name = $fontfaceself.contents.font.size = $fontsize/1.2refreshself.active = falseself.index = -1end#--------------------------------------------------------------------------# ? refresh#--------------------------------------------------------------------------def refreshself.contents.clearfor i in 0...$game_party.actors.sizex = i % 4 * 112y = i / 4 * 112actor = $game_party.actors#dessine un carré pour séparer les characters, changer couleur transparente par ce que vous voulez#couleur désirée... (methode pour faire un carré ci-dessous)draw_square(x, y, 111, disabled_color)draw_actor_battlegraphic(actor, x, y, 150)#Repdraw_actor_graphic(actor, x + 90, y + 50)draw_actor_name(actor, x + 5, y)self.contents.draw_text(x + 5, y + 20, 112, 32, "HP : #{actor.hp}")self.contents.draw_text(x + 5, y + 40, 112, 32, "MP : #{actor.sp}")draw_actor_level(actor, x + 5, y + 60)draw_actor_state(actor, x + 5, y + 80)draw_actor_hp_meter(actor, x + 5, y + 17)draw_actor_sp_meter(actor, x + 5, y + 37)endend#--------------------------------------------------------------------------# ? define the page's top row#--------------------------------------------------------------------------def top_rowreturn self.oy / 112end#--------------------------------------------------------------------------# ? define the page maximum rows#--------------------------------------------------------------------------def page_row_maxreturn (self.height - 32) / 112end#--------------------------------------------------------------------------# ? defines a method to change the page's top row#--------------------------------------------------------------------------def top_row=(row)if row < 0row = 0endif row > row_max - 1row = row_max - 1endself.oy = row * 112end#--------------------------------------------------------------------------# ? update the cursor movement#--------------------------------------------------------------------------def update_cursor_rectif @index < 0self.cursor_rect.emptyreturnendrow = @index / @column_maxif row < self.top_rowself.top_row = rowendif row > self.top_row + (self.page_row_max - 1)self.top_row = row - (self.page_row_max - 1)endself.cursor_rect.set(@index % 4 * 112, @index / 4 * 112 - self.oy, 112, 112)endend#==============================================================================# ¦ Window_Target#==============================================================================class Window_Target < Window_Selectable#--------------------------------------------------------------------------# ? initialize#--------------------------------------------------------------------------def initializesuper(0, 0, 336, 480)@column_max = 2@item_max = $game_party.actors.sizeself.contents = Bitmap.new(width - 32, row_max * 112)self.contents.font.name = $fontfaceself.contents.font.size = $fontsize/1.2self.z += 10refreshend#--------------------------------------------------------------------------# ? refresh#--------------------------------------------------------------------------def refreshself.contents.clearfor i in 0...$game_party.actors.sizex = i % 2 * 112 + 36y = i / 2 * 112actor = $game_party.actors#dessine un carré pour séparer les characters, changer couleur transparente par ce que vous voulez#coleur désirée... (methode pour faire un carré ci-dessous)draw_square(x, y, 111, disabled_color)draw_actor_battlegraphic(actor, x, y, 150)draw_actor_graphic(actor, x + 90, y + 50)draw_actor_name(actor, x + 5, y)self.contents.draw_text(x + 5, y + 20, 112, 32, "HP : #{actor.hp}")self.contents.draw_text(x + 5, y + 40, 112, 32, "MP : #{actor.sp}")draw_actor_level(actor, x + 5, y + 60)draw_actor_state(actor, x + 5, y + 80)draw_actor_hp_meter(actor, x + 5, y + 17)draw_actor_sp_meter(actor, x + 5, y + 37)endend#--------------------------------------------------------------------------# ? define the page's top row#--------------------------------------------------------------------------def top_rowreturn self.oy / 112end#--------------------------------------------------------------------------# ? define the page maximum rows#--------------------------------------------------------------------------def page_row_maxreturn (self.height - 32) / 112end#--------------------------------------------------------------------------# ? defines a method to change the page's top row#--------------------------------------------------------------------------def top_row=(row)if row < 0row = 0endif row > row_max - 1row = row_max - 1endself.oy = row * 112end#--------------------------------------------------------------------------# ? update the cursor movement#--------------------------------------------------------------------------def update_cursor_rectrow = @index / @column_maxif row < self.top_rowself.top_row = rowendif row > self.top_row + (self.page_row_max - 1)self.top_row = row - (self.page_row_max - 1)endif @index <= -2self.cursor_rect.emptyelsif @index == -1self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)elseself.cursor_rect.set(@index % 2 * 112 + 36, @index / 2 * 112 - self.oy, 112, 112)endendend#==============================================================================# ¦ Scene_Menu#==============================================================================class Scene_Menu#--------------------------------------------------------------------------# ? initialize#--------------------------------------------------------------------------def initialize(menu_index = 0)@menu_index = menu_index@actor_change = falseend#--------------------------------------------------------------------------# ? main#--------------------------------------------------------------------------def mains1 = $data_system.words.items2 = $data_system.words.skills3 = $data_system.words.equips4 = "Statuts"s5 = "Sauvegarder"s6 = "Ordre"s7 = "Quitter"@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])@command_window.index = @menu_indexif $game_party.actors.size == 0@command_window.disable_item(0)@command_window.disable_item(1)@command_window.disable_item(2)@command_window.disable_item(3)@command_window.disable_item(5)endif $game_system.save_disabled@command_window.disable_item(4)end@playtime_window = Window_PlayTime.new@playtime_window.x = 0@playtime_window.y = 256 #224@steps_window = Window_Steps.new@steps_window.x = 0@steps_window.y = 320@gold_window = Window_Gold.new@gold_window.x = 0@gold_window.y = 416@status_window = Window_MenuStatus.new@status_window.x = 160@status_window.y = 0Graphics.transitionloop doGraphics.updateInput.updateupdateif $scene != selfbreakendendGraphics.freeze@command_window.dispose@playtime_window.dispose@steps_window.dispose@gold_window.dispose@status_window.disposeend#--------------------------------------------------------------------------# ? update the windows#--------------------------------------------------------------------------def update@command_window.update@playtime_window.update@steps_window.update@gold_window.update@status_window.updateif @command_window.activeupdate_commandreturnendif @status_window.activeupdate_statusreturnendend#--------------------------------------------------------------------------# ? update the command window#--------------------------------------------------------------------------def update_commandif Input.trigger?(Input::$game_system.se_play($data_system.cancel_se)$scene = Scene_Map.newreturnendif Input.trigger?(Input::C)if $game_party.actors.size == 0 and @command_window.index < 4$game_system.se_play($data_system.buzzer_se)returnendcase @command_window.indexwhen 0 # Item$game_system.se_play($data_system.decision_se)$scene = Scene_Item.newwhen 1 # Skill$game_system.se_play($data_system.decision_se)@command_window.active = false@status_window.active = true@status_window.index = 0when 2 # Equip$game_system.se_play($data_system.decision_se)@command_window.active = false@status_window.active = true@status_window.index = 0when 3 # Status$game_system.se_play($data_system.decision_se)@command_window.active = false@status_window.active = true@status_window.index = 0when 4 # Saveif $game_system.save_disabled$game_system.se_play($data_system.buzzer_se)returnend$game_system.se_play($data_system.decision_se)$scene = Scene_Save.newwhen 5 # party actors switch$game_system.se_play($data_system.decision_se)@command_window.active = false@status_window.active = true@status_window.index = 0when 6 # End$game_system.se_play($data_system.decision_se)$scene = Scene_End.newendreturnendend#--------------------------------------------------------------------------# ? update the status window#--------------------------------------------------------------------------def update_statusif Input.trigger?(Input::$game_system.se_play($data_system.cancel_se)@command_window.active = true@status_window.active = false@status_window.index = -1@actor_change = falsereturnendif Input.trigger?(Input::C)$game_system.se_play($data_system.decision_se)case @command_window.indexwhen 1 # Skillif $game_party.actors[@status_window.index].restriction >= 2$game_system.se_play($data_system.buzzer_se)returnend$game_system.se_play($data_system.decision_se)$scene = Scene_Skill.new(@status_window.index)when 2 # Equip$game_system.se_play($data_system.decision_se)$scene = Scene_Equip.new(@status_window.index)when 3 # Status$game_system.se_play($data_system.decision_se)$scene = Scene_Status.new(@status_window.index)when 5 # party actors switchif @actor_change == true$game_system.se_play($data_system.decision_se)$game_party.actors[@old_index] = $game_party.actors[@status_window.index]$game_party.actors[@status_window.index] = @new_actor$game_player.refresh@actor_change = false@status_window.refreshreturnend@old_index = @status_window.index@new_actor = $game_party.actors[@status_window.index]@actor_change = trueendreturnendendend#==============================================================================# ¦ Scene_Battle (Part 1)#==============================================================================class Scene_Battle#--------------------------------------------------------------------------# ? main#--------------------------------------------------------------------------def main$game_temp.in_battle = true$game_temp.battle_turn = 0$game_temp.battle_event_flags.clear$game_temp.battle_abort = false$game_temp.battle_main_phase = false$game_temp.battleback_name = $game_map.battleback_name$game_temp.forcing_battler = nil$game_system.battle_interpreter.setup(nil, 0)@troop_id = $game_temp.battle_troop_id$game_troop.setup(@troop_id)#memorize actors in party and cut the party down to 4 actors@party_mem = $game_party.actors$game_party.actors = $game_party.actors[0..3]s1 = $data_system.words.attacks2 = $data_system.words.skills3 = $data_system.words.guards4 = $data_system.words.item@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])@actor_command_window.y = 160@actor_command_window.back_opacity = 160@actor_command_window.active = false@actor_command_window.visible = false@party_command_window = Window_PartyCommand.new@help_window = Window_Help.new@help_window.back_opacity = 160@help_window.visible = false@status_window = Window_BattleStatus.new@message_window = Window_Message.new@spriteset = Spriteset_Battle.new@wait_count = 0if $data_system.battle_transition == ""Graphics.transition(20)elseGraphics.transition(40, "Graphics/Transitions/" +$data_system.battle_transition)endstart_phase1loop doGraphics.updateInput.updateupdateif $scene != selfbreakendend$game_map.refreshGraphics.freeze@actor_command_window.dispose@party_command_window.dispose@help_window.dispose@status_window.dispose@message_window.disposeif @skill_window != nil@skill_window.disposeendif @item_window != nil@item_window.disposeendif @result_window != nil@[email hidden] $scene.is_a?(Scene_Title)Graphics.transitionGraphics.freezeendif $BTEST and not $scene.is_a?(Scene_Gameover)$scene = nilendend#--------------------------------------------------------------------------# ? battle end#--------------------------------------------------------------------------def battle_end(result)$game_temp.in_battle = false$game_party.clear_actionsfor actor in $game_party.actorsactor.remove_states_battleend$game_troop.enemies.clearif $game_temp.battle_proc != nil$game_temp.battle_proc.call(result)$game_temp.battle_proc = nilend$game_party.actors = @party_mem$scene = Scene_Map.newendend
If the script doesn't work replace "Main" by this :

Spoiler
#==============================================================================# ** Main#------------------------------------------------------------------------------# After defining each class, actual processing begins here.#==============================================================================begin # Change the $fontface variable to change the font style$defaultfonttype = $fontface = $fontname = Font.default_name = "Kristen ITC"# Font size used$defaultfontsize = $fontsize = Font.default_size = 26# Font type$defaultfonttype = $fontface = $fontname = Font.default_name = "Kristen ITC"# Font size$defaultfontsize = $fontsize = Font.default_size = 26 # Prepare for transition Graphics.freeze # Make scene object (title screen) $scene = Scene_Title.new # Call main method as long as $scene is effective while $scene != nil $scene.main end # Fade out Graphics.transition(20)rescue Errno::ENOENT # Supplement Errno::ENOENT exception # If unable to open file, display message and end filename = $!.message.sub("No such file or directory - ", "") print("Unable to find file #{filename}.")end
thanks for you help
I've moved this thread to RGSS Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.


So you want a 'party formation' script for up to 20 characters, is that right?

Original thread: https://forums.rpgmakerweb.com/threads/order-fonction-in-a-fight.18776/