设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 108|回复: 0

[转载发布] FG7 - Simple Formation Menu

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-2 18:55:20 | 显示全部楼层 |阅读模式
    Simple Formation Menu
    By: FamilyGamer7​


    Introduction
                            A simple way to make the formation it's own scene and with unique formatting.               
    Click to expand...


    Features
                            This script gives the formation command its own scene and re-organizes into a unique approach that is different from the standard formation implementation. This new formation will only support up to 6 actors per its design.               
    Click to expand...


    Screenshot(s)



    Click to expand...


    Script
    Spoiler: FG7 - Simple Formation Menu
                    Ruby:       
    1. #==============================================================================
    2. # Title: Simple Formation Menu
    3. # Author: FamilyGamer7 (FG7)
    4. # Version: 1.0
    5. # Engine: RPG Maker VX Ace
    6. #==============================================================================
    7. # ** Change Log |
    8. # ---------------
    9. # 1.0 => Created Script
    10. #==============================================================================
    11. # ** Description |
    12. # ----------------
    13. # A simple way to make the formation it's own scene and with unique formatting.
    14. #==============================================================================
    15. # ** Terms of Use |
    16. # -----------------
    17. # * Free to use in non-commercial projects and commercial projects
    18. # * Feel free to modify and improve the script. Credit is still required.
    19. # * Credit FamilyGamer7
    20. #==============================================================================
    21. # ** Usage |
    22. # ---------
    23. # Plug & Play (With some customization in module section)
    24. #
    25. # -----------------------------------------------------------------------------
    26. #
    27. # For the module section, you can use a value like "30" or "-30" which is to
    28. # add/subtract to the existing "x" coordinate placement of the scene. The same
    29. # applies for the "y" coordinate placement. See examples below.
    30. #
    31. # - Ex: Scene_X_Horizontal = 30 - moves everything to the right
    32. # - Ex: Scene_X_Horizontal = -30 - moves everything to the left
    33. #
    34. # - Ex: Scene_Y_Vertical = 30 - moves everything to the bottom
    35. # - Ex: Scene_Y_Vertical = -30 - moves everything to the top
    36. #==============================================================================
    37. # ** Important Note |
    38. # ------------------
    39. # This script only supports up to 6 actors at a time to function properly.
    40. #==============================================================================
    41. #==============================================================================
    42. # ** Module: FG7::Simple_Formation_Menu
    43. #------------------------------------------------------------------------------
    44. #  This modules creates a static variable to be used within the script.
    45. #==============================================================================
    46. module FG7
    47.   module Simple_Formation_Menu
    48. #==============================================================================
    49. # -------------------- ALLOWED TO EDIT BELOW THIS LINE ---------------------- #
    50. #==============================================================================
    51.     # Sets the value to change the "x" coordinates of the formation scene.
    52.     # (This is needed if screen is resized higher - For flexibility)
    53.     Scene_X_Horizontal = 0
    54.    
    55.     # Sets the value to change the "y" coordinates of the formation scene.
    56.     # (This is needed if screen is resized higher - For flexibility)
    57.     Scene_Y_Vertical = 0
    58. #==============================================================================
    59. # ---------- DO NOT EDIT BELOW THIS LINE (FOR ADVANCED USERS) --------------- #
    60. #==============================================================================
    61.   end
    62. end
    63. #==============================================================================
    64. # ** Window_Base
    65. #------------------------------------------------------------------------------
    66. #  This is a super class of all windows within the game.
    67. #==============================================================================
    68. class Window_Base < Window
    69.   #--------------------------------------------------------------------------
    70.   # * New Method: Draw Simple Status [Formation]
    71.   #--------------------------------------------------------------------------
    72.   def draw_actor_formation_status(actor, x, y)
    73.     draw_actor_name(actor, x, y - 5)
    74.     draw_actor_level(actor, x, y - 14 + line_height * 2.2)
    75.     draw_actor_icons(actor, x + 122, y + line_height * 1 - 37)
    76.     draw_actor_hp(actor, x, y - 9 + line_height * 1)
    77.   end
    78. end
    79. #==============================================================================
    80. # ** Window_MenuStatus
    81. #------------------------------------------------------------------------------
    82. #  This window displays party member status on the menu screen.
    83. #==============================================================================
    84. class Window_MenuStatus < Window_Selectable
    85.   #--------------------------------------------------------------------------
    86.   # * Added Method: Object Initialization
    87.   #--------------------------------------------------------------------------
    88.   alias :fg7_simple_formation_menu_initialize :initialize
    89.   def initialize(x, y)
    90.     fg7_simple_formation_menu_initialize(x, y)
    91.     # Set window opacity to "0" if on Formation scene
    92.     self.opacity = 0 if SceneManager.scene_is?(Scene_Formation)
    93.   end
    94.   #--------------------------------------------------------------------------
    95.   # * Added/Override Method: Get Rectangle for Drawing Items
    96.   #--------------------------------------------------------------------------
    97.   def item_rect(index)
    98.     # Checks if on the Formation scene - draw new rect placement
    99.     if SceneManager.scene_is?(Scene_Formation)
    100.       rect = Rect.new
    101.       rect.width = 135
    102.       rect.height = 67
    103.       rect.x = index % col_max * (item_width + spacing)
    104.       rect.y = 106 + index / col_max * item_height
    105.       rect
    106.     # Since not on Formation scene - draw original rect placement.
    107.     else
    108.       rect = Rect.new
    109.       rect.width = item_width
    110.       rect.height = item_height
    111.       rect.x = index % col_max * (item_width + spacing)
    112.       rect.y = index / col_max * item_height
    113.       rect
    114.     end
    115.   end
    116.   #--------------------------------------------------------------------------
    117.   # * Alias Method: Get Column Max
    118.   #--------------------------------------------------------------------------
    119.   alias :fg7_simple_formation_menu_col_max :col_max
    120.   def col_max
    121.     return 3 if SceneManager.scene_is?(Scene_Formation)
    122.     fg7_simple_formation_menu_col_max
    123.   end
    124.   #--------------------------------------------------------------------------
    125.   # * Alias Method: Get Window Width
    126.   #--------------------------------------------------------------------------
    127.   alias :fg7_simple_formation_menu_window_width :window_width
    128.   def window_width
    129.     return 620 if SceneManager.scene_is?(Scene_Formation)
    130.     fg7_simple_formation_menu_window_width
    131.   end
    132.   #--------------------------------------------------------------------------
    133.   # * Alias Method: Get Window Height
    134.   #--------------------------------------------------------------------------
    135.   alias :fg7_simple_formation_menu_window_height :window_height
    136.   def window_height
    137.     return Graphics.height + 300 if SceneManager.scene_is?(Scene_Formation)
    138.     fg7_simple_formation_menu_window_height
    139.   end
    140.   #--------------------------------------------------------------------------
    141.   # * Alias Method: Get Number of Items
    142.   #--------------------------------------------------------------------------
    143.   alias :fg7_simple_formation_menu_item_max :item_max
    144.   def item_max
    145.     return 6 if SceneManager.scene_is?(Scene_Formation)
    146.     fg7_simple_formation_menu_item_max
    147.   end
    148.   #--------------------------------------------------------------------------
    149.   # * Alias Method: Get Item Height
    150.   #--------------------------------------------------------------------------
    151.   alias :fg7_simple_formation_menu_item_height :item_height
    152.   def item_height
    153.     return 188 if SceneManager.scene_is?(Scene_Formation)
    154.     fg7_simple_formation_menu_item_height
    155.   end
    156.   #--------------------------------------------------------------------------
    157.   # * Alias Method: Get Item Width
    158.   #--------------------------------------------------------------------------
    159.   alias :fg7_simple_formation_menu_item_width :item_width
    160.   def item_width
    161.     return 140 if SceneManager.scene_is?(Scene_Formation)
    162.     fg7_simple_formation_menu_item_width
    163.   end
    164.   #--------------------------------------------------------------------------
    165.   # * Override Method: Draw Item
    166.   #--------------------------------------------------------------------------
    167.   def draw_item(index)
    168.     # Checks if on the Formation scene - draw new placement
    169.     if SceneManager.scene_is?(Scene_Formation)
    170.       actor = $game_party.members[index]
    171.       enabled = $game_party.battle_members.include?(actor)
    172.       rect = item_rect(index)
    173.       draw_item_background(index)
    174.       draw_actor_face(actor, rect.x + 7, rect.y - 110 + line_height / 2)
    175.       draw_actor_formation_status(actor, rect.x + 5, rect.y - 7 + line_height / 2)
    176.     # Since not on Formation scene - draw original placement.
    177.     else
    178.       actor = $game_party.members[index]
    179.       enabled = $game_party.battle_members.include?(actor)
    180.       rect = item_rect(index)
    181.       draw_item_background(index)
    182.       draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
    183.       draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
    184.     end
    185.   end
    186. end
    187. #==============================================================================
    188. # ** Scene_Menu
    189. #------------------------------------------------------------------------------
    190. #  This class performs the menu screen processing.
    191. #==============================================================================
    192. class Scene_Menu < Scene_MenuBase
    193.   #--------------------------------------------------------------------------
    194.   # * Override Method: [Formation] Command
    195.   #--------------------------------------------------------------------------
    196.   def command_formation
    197.     # Calls the new Formation scene
    198.     SceneManager.call(Scene_Formation)
    199.   end
    200. end
    201. #==============================================================================
    202. # ** Scene_Formation
    203. #------------------------------------------------------------------------------
    204. #  This class performs the item screen processing.
    205. #==============================================================================
    206. class Scene_Formation < Scene_MenuBase
    207.   #--------------------------------------------------------------------------
    208.   # * New Method: Start Processing
    209.   #--------------------------------------------------------------------------
    210.   def start
    211.     super
    212.     create_menustatus_bg_partymember1
    213.     create_menustatus_bg_partymember2
    214.     create_menustatus_bg_partymember3
    215.     create_menustatus_bg_partymember4
    216.     create_menustatus_bg_partymember5
    217.     create_menustatus_bg_partymember6
    218.     create_status_window
    219.   end
    220.   #--------------------------------------------------------------------------
    221.   # * Added/Edited Method: Create Status Window
    222.   #--------------------------------------------------------------------------
    223.   def create_status_window
    224.     x = 21 + FG7::Simple_Formation_Menu::Scene_X_Horizontal
    225.     y = 9 + FG7::Simple_Formation_Menu::Scene_Y_Vertical
    226.     @status_window = Window_MenuStatus.new(x, y)
    227.     @status_window.select_last
    228.     @status_window.activate
    229.     @status_window.set_handler(:ok,     method(:on_formation_ok))
    230.     @status_window.set_handler(:cancel, method(:on_formation_cancel))
    231.   end
    232.   #--------------------------------------------------------------------------
    233.   # * New Method: Create MenuStatus Party Member 1 Background Window (Formation)
    234.   #--------------------------------------------------------------------------
    235.   def create_menustatus_bg_partymember1
    236.     x = 24 + FG7::Simple_Formation_Menu::Scene_X_Horizontal
    237.     y = 118 + FG7::Simple_Formation_Menu::Scene_Y_Vertical
    238.     @menustatus_bg_window_partymember1 = Window_Base.new(x, y, 153, 85)
    239.   end
    240.   #--------------------------------------------------------------------------
    241.   # * New Method: Create MenuStatus Party Member 2 Background Window (Formation)
    242.   #--------------------------------------------------------------------------
    243.   def create_menustatus_bg_partymember2
    244.     x = 196 + FG7::Simple_Formation_Menu::Scene_X_Horizontal
    245.     y = 118 + FG7::Simple_Formation_Menu::Scene_Y_Vertical
    246.     @menustatus_bg_window_partymember2 = Window_Base.new(x, y, 153, 85)
    247.   end
    248.   #--------------------------------------------------------------------------
    249.   # * New Method: Create MenuStatus Party Member 3 Background Window (Formation)
    250.   #--------------------------------------------------------------------------
    251.   def create_menustatus_bg_partymember3
    252.     x = 368 + FG7::Simple_Formation_Menu::Scene_X_Horizontal
    253.     y = 118 + FG7::Simple_Formation_Menu::Scene_Y_Vertical
    254.     @menustatus_bg_window_partymember3 = Window_Base.new(x, y, 153, 85)
    255.   end
    256.   #--------------------------------------------------------------------------
    257.   # * New Method: Create MenuStatus Party Member 4 Background Window (Formation)
    258.   #--------------------------------------------------------------------------
    259.   def create_menustatus_bg_partymember4
    260.     x = 24 + FG7::Simple_Formation_Menu::Scene_X_Horizontal
    261.     y = 306 + FG7::Simple_Formation_Menu::Scene_Y_Vertical
    262.     @menustatus_bg_window_partymember4 = Window_Base.new(x, y, 153, 85)
    263.   end
    264.   #--------------------------------------------------------------------------
    265.   # * New Method: Create MenuStatus Party Member 5 Background Window (Formation)
    266.   #--------------------------------------------------------------------------
    267.   def create_menustatus_bg_partymember5
    268.     x = 196 + FG7::Simple_Formation_Menu::Scene_X_Horizontal
    269.     y = 306 + FG7::Simple_Formation_Menu::Scene_Y_Vertical
    270.     @menustatus_bg_window_partymember5 = Window_Base.new(x, y, 153, 85)
    271.   end
    272.   #--------------------------------------------------------------------------
    273.   # * New Method: Create MenuStatus Party Member 6 Background Window (Formation)
    274.   #--------------------------------------------------------------------------
    275.   def create_menustatus_bg_partymember6
    276.     x = 368 + FG7::Simple_Formation_Menu::Scene_X_Horizontal
    277.     y = 306 + FG7::Simple_Formation_Menu::Scene_Y_Vertical
    278.     @menustatus_bg_window_partymember6 = Window_Base.new(x, y, 153, 85)
    279.   end
    280.   #--------------------------------------------------------------------------
    281.   # * Added Method: Formation [OK]
    282.   #--------------------------------------------------------------------------
    283.   def on_formation_ok
    284.     if @status_window.pending_index >= 0
    285.       $game_party.swap_order(@status_window.index,
    286.                             @status_window.pending_index)
    287.       @status_window.pending_index = -1
    288.       @status_window.redraw_item(@status_window.index)
    289.       @status_window.refresh
    290.     else
    291.       @status_window.pending_index = @status_window.index
    292.     end
    293.     @status_window.activate
    294.   end
    295.   #--------------------------------------------------------------------------
    296.   # * Added Method: Formation [Cancel]
    297.   #--------------------------------------------------------------------------
    298.   def on_formation_cancel
    299.     if @status_window.pending_index >= 0
    300.       @status_window.pending_index = -1
    301.       @status_window.activate
    302.     else
    303.       SceneManager.return
    304.     end
    305.   end
    306. end
    复制代码


    How to Use
                            Add this script in the script editor under in the "Materials" section and above "Main Process".
    The instructions and setup for the script are held within the script header itself. No need to repeat here.               
    Click to expand...


    Terms of Use
                            - Free to use in non-commercial projects and commercial projects
    - Feel free to modify and improve the script. Credit is still required.
    - Credit FamilyGamer7               
    Click to expand...




    本贴来自国际rpgmaker官方论坛作者:FG7处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/fg7-simple-formation-menu.144735/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 09:31 , Processed in 0.140391 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表