设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
搜索附件  
同能RPG制作大师 › 附件中心 › 同能RM技术讨论区 › RPG Maker VA 讨论区 › Party Leader Variable Identification System: Party Leader Variable Identification System-1.png

Party Leader Variable Identification System: Party Leader Variable Identification System-1.png

 

Party Leader Variable Identification System:
 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/
Party Leader Variable Identification System: Party Leader Variable Identification System-1.png
         同一主题附件:
    Party Leader Variable Identification System-1.png
    Party Leader Variable Identification System-2.png
简体中文
繁體中文
English(英语)
日本語(日语)
Deutsch(德语)
Русский язык(俄语)
بالعربية(阿拉伯语)
Türkçe(土耳其语)
Português(葡萄牙语)
ภาษาไทย(泰国语)
한어(朝鲜语/韩语)
Français(法语)
关闭

幸运抽奖

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

立即查看

Loading...

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

GMT+8, 2026-10-5 06:41 , Processed in 0.074022 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部