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

[转载发布] Maxhero's Party Manager

[复制链接]
累计送礼:
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-3 12:19:40 | 显示全部楼层 |阅读模式
    Maxhero's Party Manager


    Intro

    This is my first script reformulated to RPG Maker VX Ace years later.Learn how to configure in "How to use" part.


    Screenshots

    Spoiler





    Spoiler





    Spoiler





    Spoiler





    How to use


    •    Edit @REM_BLOCK to set the Party-Fixed Characters
    •    Edit @AVALIABLE_ACTORS to set the Avaliable characters by default
    •    Edit @TEXTS to setup the Menu texts
    •    To enable actors in game use the command:
    PartyManager.enable_actor(id)

    •    To disable actors in game use the command:
                    Code:       
    1. PartyManager.disable_actor(id)
    复制代码


    •    To lock a character in party use the command:
                    Code:       
    1. PartyManager.lock(id)
    复制代码


    •    To unlock a character in party use the command:
                    Code:       
    1. PartyManager.unlock(id)
    复制代码

          replace "id" by the actor id in database


    •    To start the PartyManager with add mode, create a event calling the Script:
                    Code:       
    1. SceneManager.call(Scene_PartyManager,:add)
    复制代码


    •    To start the PartyManager with remove mode, create a event calling the Script:
                    Code:       
    1. SceneManager.call(Scene_PartyManager,:remove)
    复制代码


    Script

    Spoiler: Maxhero's Party Manager
                    Ruby:       
    1. #===============================================================================
    2. # Maxhero's Party Editor
    3. #-------------------------------------------------------------------------------
    4. =begin Terms of Use:
    5. —If use don't forget to quote my name in credits.  
    6. —You're free to modify and redistribute this script keeping this Header.
    7. Instructios:  
    8. —Edit @REM_BLOCK to set the Party-Fixed Characters  
    9. —To enable actors in game use the command:   
    10. PartyManager.enable_actor(id)  
    11. —To disable actors in game use the command:   
    12. PartyManager.disable_actor(id)  
    13. —To lock a character in party use the command:   
    14. PartyManager.lock(id)  
    15. —To unlock a character in party use the command:   
    16. PartyManager.unlock(id)   
    17. replace "id" by the actor id in database  
    18. —To start the PartyManager with add mode, create a event calling the Script:   
    19. SceneManager.call(Scene_PartyManager,:add)  
    20. —To start the PartyManager with remove mode, create a event calling the Script:   
    21. SceneManager.call(Scene_PartyManager,:remove)
    22. =end
    23. #===============================================================================
    24. module PartyManager
    25.     extend self
    26.     @REM_BLOCK        = [1]
    27.     @AVALIABLE_ACTORS = [2,3,4,5,6,7,8,9]
    28.     @TEXTS            = [    "Which character you want to add?",  
    29.                                             "Which character you want to remove?",  
    30.                                             "You have all the avaliable characters.",  
    31.                                             "There is no character to remove."  ]
    32.     def blocked_actors  
    33.         return @REM_BLOCK
    34.     end
    35.     def avaliable_actors  
    36.         return @AVALIABLE_ACTORS
    37.     end
    38.     def enable_actor(id)  
    39.         @AVALIABLE_ACTORS << id
    40.     end
    41.     def disable_actor(id)  
    42.         @AVALIABLE_ACTORS.delete(id)
    43.     end
    44.     def lock(id)  
    45.         @REM_BLOCK << id
    46.     end
    47.     def unlock(id)  
    48.         @REM_BLOCK.delete(id)
    49.     end
    50.     def have_all_avaliable_chars_text  
    51.         return @TEXTS[2]
    52.     end
    53.     def no_char_to_remove  
    54.         return @TEXTS[3]
    55.     end
    56.     def add_help  
    57.         return @TEXTS[0]
    58.     end
    59.     def remove_help  
    60.         return @TEXTS[1]
    61.     end
    62.     def load_blocked_actors(array)  
    63.         @REM_BLOCK = array
    64.     end
    65.     def load_avaliable_actors(array)  
    66.         @AVALIABLE_ACTORS = array
    67.     end
    68. end
    69. #===============================================================================
    70. # DataManager Mod
    71. #===============================================================================
    72. module DataManager
    73.     class << self  
    74.         alias maxpm_msv make_save_contents  
    75.         alias maxpm_esv extract_save_contents  
    76.         def make_save_contents   
    77.         contents = maxpm_msv   
    78.         contents[:blocked_actors] = PartyManager.blocked_actors   
    79.         contents[:avaliable_actors] = PartyManager.blocked_actors   
    80.         contents  
    81.         end  
    82.         def extract_save_contents(contents)   
    83.         maxpm_esv(contents)   
    84.         PartyManager.load_blocked_actors(contents[:blocked_actors])   
    85.         PartyManager.load_avaliable_actors(contents[:avaliable_actors])  
    86.         end
    87.     end
    88. end
    89. #===============================================================================
    90. # SceneManager Mod
    91. #===============================================================================
    92. module SceneManager
    93.     def self.call(scene_class, args=nil)  
    94.         @stack.push(@scene)  
    95.         @scene = scene_class.new(*args)
    96.     end
    97. end
    98. #===============================================================================
    99. # Character Information Window
    100. #===============================================================================
    101. class Window_Char_Info < Window_Base
    102.     def initialize  
    103.         super(160, 0, Graphics.width-160, Graphics.height)  
    104.         self.contents = Bitmap.new(width - 32, height - 32)  
    105.         refresh  
    106.     end
    107.     def refresh  
    108.         self.contents.clear
    109.     end
    110.     def draw_char_info(actor_id)  
    111.         draw_actor_name($game_actors[actor_id], 0, 0)  
    112.         draw_actor_level($game_actors[actor_id], 0, 40)  
    113.         draw_actor_class($game_actors[actor_id], 0, 20)  
    114.         draw_actor_face($game_actors[actor_id], 0, 60)  
    115.         draw_actor_hp($game_actors[actor_id], 0, 156)  
    116.         draw_actor_mp($game_actors[actor_id], 0, 176)  
    117.         draw_actor_param($game_actors[actor_id], 0, 196, 0)  
    118.         draw_actor_param($game_actors[actor_id], 0, 216, 1)  
    119.         draw_actor_param($game_actors[actor_id], 0, 236, 2)  
    120.         draw_actor_param($game_actors[actor_id], 0, 256, 3)  
    121.         draw_actor_param($game_actors[actor_id], 0, 276, 4)  
    122.         draw_actor_param($game_actors[actor_id], 0, 296, 5)  
    123.         draw_actor_param($game_actors[actor_id], self.width/2,196,6)  
    124.         draw_actor_param($game_actors[actor_id], self.width/2,216,7)  
    125.         draw_equipments(170, 0, $game_actors[actor_id])
    126.     end
    127.     def draw_equipments(x, y, actor)  
    128.         self.contents.font.color = system_color  
    129.         self.contents.draw_text(x, y, 120, 32, Vocab.equip)  
    130.         for i in 0..4   
    131.             draw_item_name(actor.equips[i], x + 16, y + 32 * (i + 1))  
    132.         end
    133.     end
    134. end
    135. #===============================================================================
    136. # Window_PMHelp
    137. #===============================================================================
    138. class Window_PMHelp < Window_Base
    139.     attr_accessor :host
    140.     def initialize(hostage)  
    141.         super(0, 0, Graphics.width, 48)  
    142.         @host = hostage
    143.     end
    144.     def set_text(text)  
    145.         if text != @text   
    146.             @text = text   
    147.             refresh  
    148.         end
    149.     end
    150.     def clear  
    151.         set_text("")
    152.     end
    153.     def set_item(item)  
    154.         set_text(item ? item.description : "")
    155.   end
    156.   def refresh  
    157.         contents.clear  
    158.         draw_text_ex(4, 0, @text)
    159.     end
    160.     def update  
    161.         super  
    162.         if Input.trigger?(:B)  
    163.             @host.return_to_map  
    164.         end
    165.     end
    166. end
    167. #===============================================================================
    168. # Window_PMCommand
    169. #===============================================================================
    170. class Window_PMCommand < Window_Command
    171. attr_accessor :current_actor,:behavior,:backsignal,:host
    172.     def initialize(hostage)  
    173.         super(0, 32)  
    174.         @host       = hostage  
    175.         @behavior   = @host.behavior  
    176.         @backsignal = false  
    177.         party = []  
    178.         $game_party.members.each{|item| party << item.id}  
    179.         case @behavior  
    180.         when :add   
    181.             @actor_list = (PartyManager.avaliable_actors - party)  
    182.         when :remove   
    183.             @actor_list = (party - PartyManager.blocked_actors)  
    184.         end  
    185.         update_placement  
    186.         self.openness = 0  
    187.         open
    188.     end
    189.     def window_width  
    190.         return 160
    191.     end
    192.     def update_placement  
    193.         self.height = (self.y+self.height) > Graphics.height ? (line_height*14)+10 : line_height*(@actor_list.size+1)  
    194.         self.x = (Graphics.width - width) / 2  
    195.         self.y = (Graphics.height * 1.6 - height) / 2
    196.     end
    197.     def update  
    198.         super  
    199.         @current_actor = @actor_list[@index]  
    200.         if Input.trigger?(:B)  
    201.             @host.return_to_map  
    202.         end
    203.     end
    204.     def common_handler  
    205.         @behavior == :add ? $game_party.add_actor(@current_actor) : $game_party.remove_actor(@current_actor)
    206.     end
    207.     def make_command_list  
    208.         #set_handler(symbol, method)  
    209.         case @behavior  
    210.         when :add   
    211.             for i in @actor_list      
    212.                 actor = $game_actors[i]      
    213.                 add_command(actor.name, actor.name.to_sym) unless actor.nil?      
    214.                 set_handler(actor.name.to_sym, Proc.new{@host.decision})   
    215.             end  
    216.         when :remove   
    217.             for i in @actor_list      
    218.                 actor = $game_actors[i]      
    219.                 add_command(actor.name, actor.name.to_sym)      
    220.                 set_handler(actor.name.to_sym, Proc.new{@host.decision})   
    221.             end  
    222.         end
    223.     end
    224. end
    225. #===============================================================================
    226. # Scene_PartyManager
    227. #===============================================================================
    228. class Scene_PartyManager < Scene_MenuBase
    229.     attr_accessor :behavior
    230.     def initialize(behavior)  
    231.         @behavior = behavior
    232.     end
    233.         def start  
    234.         super  
    235.         @L = verification  
    236.         unless @L   
    237.             case @behavior   
    238.             when :add;    create_add   
    239.             when :remove; create_remove   
    240.             end  
    241.         else   
    242.             create_warn  
    243.         end
    244.     end
    245.     def verification  
    246.         party = $game_party.members.collect{|item| item.id}  
    247.         x = (party - PartyManager.blocked_actors).empty?  
    248.         y = (PartyManager.avaliable_actors - party).empty?  
    249.         return true if (@behavior == :remove && x)  
    250.         return true if (@behavior == :add    && y)  
    251.         return false
    252.     end
    253.     def create_add  
    254.         @help_win = Window_Help.new  
    255.         @com_win  = Window_PMCommand.new(self)  
    256.         @com_win.make_command_list  
    257.         @help_win.set_text(PartyManager.add_help)  
    258.         create_info_window
    259.     end
    260.     def create_remove  
    261.         @help_win = Window_Help.new  
    262.         @com_win  = Window_PMCommand.new(self)  
    263.         @com_win.make_command_list  
    264.         @help_win.set_text(PartyManager.remove_help)  
    265.         create_info_window
    266.     end
    267.     def decision  
    268.         @com_win.common_handler  
    269.         SceneManager.goto(Scene_Map)
    270.     end
    271.     def create_info_window  
    272.         @info_win          = Window_Char_Info.new  
    273.         @info_win.height   = Graphics.height-@help_win.height  
    274.         @info_win.y        = @help_win.height  
    275.         @com_win.x         = 0  
    276.         @com_win.y         = @help_win.height
    277.     end
    278.     def create_warn  
    279.         @help_win   = Window_PMHelp.new(self)  
    280.         @help_win.y = (Graphics.height/2)-(@help_win.height/2)  
    281.         @help_win.opacity = 0  
    282.         case @behavior  
    283.             when :add;    @help_win.set_text(PartyManager.have_all_avaliable_chars_text)  
    284.             when :remove; @help_win.set_text(PartyManager.no_char_to_remove)  
    285.         end
    286.     end
    287.     def update_warn  
    288.         @help_win.refresh  
    289.         @help_win.update
    290.     end
    291.     def return_to_map;SceneManager.goto(Scene_Map);end
    292.     def update_main  
    293.         @com_win.refresh  
    294.         Input.update  
    295.         @com_win.update  
    296.         Input.update  
    297.         @info_win.refresh  
    298.         @info_win.draw_char_info(@com_win.current_actor)
    299.     end
    300.     def update  
    301.         super  
    302.         @L ? update_warn : update_main
    303.     end
    304.     def terminate  
    305.         super  
    306.         unless @L   
    307.             @com_win.dispose   
    308.             @info_win.dispose  
    309.         end  
    310.         @help_win.dispose  
    311.         dispose_background
    312.     end
    313. end
    复制代码

    If you will use this script, please, quote "maxhero" in your project credits
    Thanks to Kyo Panda for helping me in earlier versions of this script.
    Thanks to Roninator2 for formatting the script.



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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 06:21 , Processed in 0.107584 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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