标题: 蓄力连击脚本求助 [打印本页] 作者: fjwr123 时间: 2023-12-23 23:53 标题: 蓄力连击脚本求助 脚本是在论坛里找的一位大佬的,脚本如下:
#【蓄力技能,强制行动技能】
#作者:默城九
#使用方法:
#[火球.3]:强制连续三回合连续使用此技能
#[火球@蓄力]:此技能需要一回合蓄力,下回合自动强制使用此技能
$蓄力状态ID = 13
class Game_Battler
alias skill_effect_1 skill_effect
def skill_effect(user, skill)
user.remove_state($蓄力状态ID)
if skill.qz > 0 and user.skill_hh == 0
user.skillhh(skill.qz)
user.skillid(skill.id)
end
if user.skill_hh > 0
i = user.skill_hh - 1
user.skillhh(i)
end
skill_effect_1(user, skill)
end
def skill_id
@skill_id = 0 if @skill_id == nil
return @skill_id
end
def skillid(i)
@skill_id = i
end
def skill_hh
@skill_hh = 0 if @skill_hh == nil
return @skill_hh
end
def skillhh(i)
@skill_hh = i
end
end
module RPG
class Skill
def name
name = @name.split(/./)[0]
name = name.split(/@/)[0]
return name != nil ? name : ""
end
def qz
name = @name.split(/./)[1]
return name != nil ? name.to_i.abs : 0
end
def xl
name = @name.split(/@/)[1]
return name != nil ? name.to_s : ""
end
end
end
class Scene_Battle
alias update_phase3_1 update_phase3
def update_phase3
if @active_battler.state?($蓄力状态ID) or @active_battler.skill_hh > 0
@active_battler.current_action.skill_id = @active_battler.skill_id
@active_battler.current_action.kind = 1
i = $data_skills[@active_battler.current_action.skill_id].scope
if i == 1
start_enemy_select if @enemy_arrow == nil
elsif i == 3 or i == 5
start_actor_select if @actor_arrow != nil
else
phase3_next_actor
end
end
update_phase3_1
end
alias make_skill_action_result_1 make_skill_action_result
def make_skill_action_result @skill = $data_skills[@active_battler.current_action.skill_id]
unless @active_battler.current_action.forcing
unless @active_battler.skill_can_use?(@skill.id)
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
if @skill.xl == "蓄力" and !@active_battler.state?($蓄力状态ID)
@active_battler.add_state($蓄力状态ID)
@active_battler.skillid(@skill.id)
@status_window.refresh
@help_window.set_text("[蓄力]"[email protected], 1)
return
end
make_skill_action_result_1
end
end
但在技能后加“.2”时,打开游戏技能报错:脚本的第40行发生了NoMethodError private method ’split'called for nil:NilClass
对脚本几乎一窍不通,求解惑!作者: srwjrevenger 时间: 2023-12-30 11:18
把 /./ 都换成英文的 /,/
名字那里也把 . 改成 ,
不要弄错成中文的 /,/ ,