赞 | 0 |
VIP | 4 |
好人卡 | 0 |
积分 | 2 |
经验 | 31715 |
最后登录 | 2021-9-11 |
在线时间 | 829 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 180
- 在线时间
- 829 小时
- 注册时间
- 2010-6-26
- 帖子
- 671
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 企鹅达达 于 2010-11-14 20:43 编辑
两个扩展性很好的脚本。非常简单好用。
1. 队伍中的主角选择画面,选择结果(主角id及队伍序号)带入变量(默认19、20号变量,66、68行更改)。使用方法 $scene = Scene_ActorChoice.new- #==============================================================================
- # ■ Scene_ActorChoice
- #------------------------------------------------------------------------------
- # アクターの選択後、選択したアクターのID、選択時のインデックスを變數に代入します。
- #
- #「使用方法」
- # イベントコマンドのスクリプトで、$scene = Scene_ActorChoice.new記入
- # 使用時のウィンドウは Window_MenuStatus を使用しました。
- # 變數にアクターIDや選択時のインデックスを代入した後には条件分岐で使用してください。
- # 注意:選択時のインデックスは実際選択したのが何番目とかには関係なく-1をしてください。
- # 例)選択時三番目のキャラを選択した時のインデックスは2になります。
- #
- #「カスタマイズ」
- # 66, 68行
- # $game_variables[n]の nに 代入する變數IDを記入してください。
- #
- # ※このスクリプトのベースは Scene_Menu です。
- #
- #==============================================================================
- class Scene_ActorChoice < Scene_Base
- #--------------------------------------------------------------------------
- # ● OBJECTの初期化
- # menu_index : カーソルの初期位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @status_window_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 開示處理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- @status_windows = Window_MenuStatus.new(0, 0)
- @status_windows.active = true
- @status_windows.index = @status_window_index
- end
- #--------------------------------------------------------------------------
- # ● 終了處理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @status_windows.dispose
- end
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @status_windows.update
- update_actor_selection_achoice
- end
- #--------------------------------------------------------------------------
- # ● アクター選択の更新
- #--------------------------------------------------------------------------
- def update_actor_selection_achoice
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- $game_party.last_actor_index = @status_windows.index
- # 19番の變數に選択したキャラの選択時のインテックス(-1)を代入する。
- $game_variables[19] = @status_windows.index
- # 20番の變數に選択したキャラのアクターIDを代入する。
- $game_variables[20] = $game_party.members[@status_windows.index].id
- Sound.play_decision
- $scene = Scene_Map.new
- end
- end
- end
- ########################################################
- # 制作 : dest21c (韓国) [email protected] #
- ########################################################
复制代码 2. 技能和物品对象获取,可以将作用的主角对象、作用的敌人队伍序号带入变量,用开关判定作用对象为主角还是敌人、技能对象是否成功击中(使用)。脚本中设定两个变量和开关。默认变量11、12,开关13、14- #==============================================================================
- # Record Target Variable
- # Version: 1.0
- # Author: modern algebra (rmrk.net)
- # Date: August 24, 2009
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # Description:
- #
- # This script allows you to save the ID of an actor or enemy targetted by a
- # skill or item to a designated variable. It is perfect for use in
- # Common Events that are called by using items or weapons, as you can add
- # additional effects that effect the target through the common event.
- #
- # Note that it only works for targetted items and skills - if the scope has
- # multiple targets, than it will not update the values.
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # Instructions:
- #
- # Place this script above Main and below Materials.
- #
- # To choose which variables to use for this script, go down to lines 41 & 43
- # and alter the values of SELECTED_ACTOR_VARIABLE & SELECTED_ENEMY_VARIABLE.
- # Note that when selecting an actor, it saves the ID of the actor, but when
- # selecting an enemy, it returns the INDEX of the enemy in the troop. This
- # follows the lead of event commands in how actors are selected. There are
- # also two switches you can set at lines 46 & 49; TARGET_CLASS_SWITCH_ID
- # records whether the user of the skill is an actor or an enemy, while
- # NOHIT_SWITCH_ID records whether the target was hit by the item or skill.
- #
- # Using the script is fairly easy. Simply have the item or skill call a
- # common event, and in that comment you can use the values of the variables
- # and switches to determine the effect.
- #==============================================================================
- #==============================================================================
- # ** Global Constants
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # new constants - RTV_SELECTED_ACTOR_VARIABLE, RTV_SELECTED_ENEMY_VARIABLE
- #==============================================================================
- # The ID of the variable to which the selected actor ID will be saved.
- RTV_SELECTED_ACTOR_VARIABLE = 11
- # The ID of the variable to which the selected enemy INDEX will be saved.
- RTV_SELECTED_ENEMY_VARIABLE = 12
- # The ID of a switch which tells if the target of a skill is an actor or an enemy
- # ON => Enemy is target; OFF => Actor is target(此处有误,MS是倒过来)
- RTV_TARGET_CLASS_SWITCH_ID = 13
- # The ID of a switch which records whether or not the skill or item hit its
- # target. ON => Target missed; OFF => Target hit
- RTV_NOHIT_SWITCH_ID = 14
- #==============================================================================
- # ** Game_Battler
- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- # Summary of Changes:
- # aliased method - item_effect, skill_effect
- #==============================================================================
- class Game_Battler
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Item Effect
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- alias modnalgb_st_efctitm_actrvar_0bg3 item_effect
- def item_effect (user, item, *args)
- # Run Original Method
- modnalgb_st_efctitm_actrvar_0bg3 (user, item, *args)
- rtv_set_target_to_variable (item)
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Skill Effect
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- alias algabramod_skleffect_rtv_3jc2 skill_effect
- def skill_effect (user, skill, *args)
- # Run Original Method
- algabramod_skleffect_rtv_3jc2 (user, skill, *args)
- rtv_set_target_to_variable (skill)
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Set Target to Variable
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def rtv_set_target_to_variable (item)
- if item.for_one?
- if self.actor?
- $game_variables[RTV_SELECTED_ACTOR_VARIABLE] = self.id
- $game_switches[RTV_TARGET_CLASS_SWITCH_ID] = true
- else
- $game_variables[RTV_SELECTED_ENEMY_VARIABLE] = self.index
- $game_switches[RTV_TARGET_CLASS_SWITCH_ID] = false
- end
- $game_switches[RTV_NOHIT_SWITCH_ID] = @missed || @evaded
- end
- end
- end
复制代码
Project1.rar
(240.75 KB, 下载次数: 401)
|
|