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

[转载发布] Party Leader Variable Identification System

[复制链接]
累计送礼:
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 09:32:55 | 显示全部楼层 |阅读模式
     Party Leader Variable Identification System
    by Cutie Mark Keldeo​

     ​

    Introduction
     ​


    Behold... my very first submission of a... something to this community!  This was created primarily to fit my own project's needs, but with its potential usefulness, I thought I'd share.  This is a very simple script (or rather an update of a few methods) that stores the database number of the party leader in a variable whenever the party's formation is changed, or a character is added or removed.  This is literally all that the script does.  However, this allows events to recognize whether an actor is the first member of the party instead of simply being in the party.  The simplest way to set this up is via conditional branches based on the selected variable.

    Screenshots


    This is a "backstage" sort of script, so directly giving a screenshot of what it does isn't possible.  As you can see from these screenshots though, the event is giving a different message depending on which character is interacting with it.  In this example there is a conditional branch that displays a message based on the "Party Leader" variable.

    Spoiler



    Spoiler



    Script


    Spoiler # Party Leader Variable Identification System for RPG Maker VX Ace# By: Cutie Mark Keldeo## This script sets a variable to match the database number of the actor# currently leading your party.  This can be used for events that change# based on who is the party leader, as well as for some other scripts.  ## This script is made to be used with the default menu system (for changing the# party's formation), and therefore other systems that build off it. You may# encounter compatibility issues with certain menu scripts. Otherwise, this# script is made to be plug-and-play.## If using this script, please give credit to Cutie Mark Keldeo.  # This script is free to use for both non-commerical and commercial projects# without asking, so long as credit is given!  You may distrubte and / or # modify this script# so long as you give credit.  module Actor_ID_Setup    ID_Variable = 2 #This is the variable that will be changed to the lead actor's ID. end # Do not edit past this point unless you know what you are doing. module DataManager   # New game (sets variable to 0 if there are no actors)    def self.setup_new_game    create_game_objects    $game_party.setup_starting_members    $game_map.setup($data_system.start_map_id)    $game_player.moveto($data_system.start_x, $data_system.start_y)    $game_player.refresh          if $game_party.exists       $game_variables[Actor_ID_Setup::ID_Variable] = $game_party.members[0].id      else        $game_variables[Actor_ID_Setup::ID_Variable] = 0      end    Graphics.frame_count = 0  endend class Game_Party < Game_Unit   # * Add actor  def add_actor(actor_id)    @actors.push(actor_id) unless @actors.include?(actor_id)    $game_variables[Actor_ID_Setup::ID_Variable] =  $game_party.members[0].id    $game_player.refresh    $game_map.need_refresh = true  end  # * Remove actor    def remove_actor(actor_id)     @actors.delete(actor_id)      if $game_party.exists       $game_variables[Actor_ID_Setup::ID_Variable] = $game_party.members[0].id      else        $game_variables[Actor_ID_Setup::ID_Variable] = 0      end    $game_player.refresh    $game_map.need_refresh = true  endend # * change party formation class Window_MenuStatus < Window_Selectable  def process_ok    super    $game_party.menu_actor = $game_party.members[index]      $game_variables[Actor_ID_Setup::ID_Variable] =  $game_party.members[0].id   endend 



    installation / Compatibility

     ​

    This script should be placed above "Main" and below any alterations to how the party formation is handled, including custom menu systems.  It is plug and play with the default menu system.  I can also confirm it is compatible with the Sapphire Action System by Khas, as my project also employs this.  I have not tested this script with any menu systems other than the default; so long as a custom system is based on the default's method of handling the party formation.  Due to the script's simple nature, it should not interfere with any graphical effects.  

    Credit

     ​

    Please mention me, Cutie Mark Keldeo if using this script in your project.  It is free to use for both commercial and non-commercial projects without asking.  Feel free to distribute this script so long as credit is given.  



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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 12:43 , Processed in 0.123354 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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