05-07-2010, 11:46 PM
Hi everyone,
Before I post my request, I want to apologize in advance for my ignorance of scripting. I'm still learning how to do this, and I'm afraid that my question will be extremely basic. Nonetheless, as I've spent several hours trying to make sense of this, I think it's time I turned to the experts.
I'm trying to use the KGC delayed skill script for RMXP:
http://ytomy.sakura.ne.jp/tkool/rpgtech/...elay_skill
Here is the translated version of the script:
My problem is that I can't figure out where I need to create the database of the skills along with their delay times, etc. Do I insert this information at the beginning of the script? This seems to be the common practice with "English"-written scripts. Or do I need to "import" something from an external file.
Thank you very much for any help that you are willing to give, and I apologize once more should this turn out to be an embarrassingly easy problem to solve.
Before I post my request, I want to apologize in advance for my ignorance of scripting. I'm still learning how to do this, and I'm afraid that my question will be extremely basic. Nonetheless, as I've spent several hours trying to make sense of this, I think it's time I turned to the experts.
I'm trying to use the KGC delayed skill script for RMXP:
http://ytomy.sakura.ne.jp/tkool/rpgtech/...elay_skill
Here is the translated version of the script:
Content Hidden
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/
# _ / Delay skills ? - KGC_DelaySkill ?
# _ / ? Last update: 2008/03/23 ?
#_/----------------------------------------------- -----------------------------
# _ / Create a time lag occurs before the fire skills.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/
$ Imported = () if $ imported == nil
$ Imported ["DelaySkill"] = true
if $ game_special_elements == nil
$ Game_special_elements = ()
$ Data_system = load_data ("Data / System.rxdata")
end
# Delay skill attributes
$ Game_special_elements ["skill_delay"] = $ data_system.elements.index ("Skills" delay)
if $ game_special_elements ["skill_delay"] == nil
# Order to preserve compatibility "time lag" It will do
$ Game_special_elements ["skill_delay"] = $ data_system.elements.index ("skills lag")
end
if $ game_special_elements ["skill_delay"] == nil
$ Game_special_elements ["skill_delay"] = $ data_system.elements.index ("DelaySkill")
end
#================================================= =============================
# ? Game_DelaySkillInfo
#------------------------------------------------- -----------------------------
# A class that holds information skills delay.
#================================================= =============================
class Game_DelaySkillInfo
#------------------------------------------------- -------------------------
# Public instance variables ?
#------------------------------------------------- -------------------------
attr_accessor: turn_count # delay the number of turns
attr_accessor: skill_id # invoke ID Skills
attr_accessor: user # by invoking
#------------------------------------------------- -------------------------
# Object initialization ?
#------------------------------------------------- -------------------------
def initialize
@ Turn_count = 0
@ Skill_id = 0
@ User = nil
end
end
# ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
#================================================= =============================
# ? Game_Battler (1 split definition)
#================================================= =============================
class Game_Battler
#------------------------------------------------- -------------------------
# Public instance variables ?
#------------------------------------------------- -------------------------
attr_accessor: delay_skills # array of skills delay
attr_accessor: states # states
#------------------------------------------------- -------------------------
# Object initialization ?
#------------------------------------------------- -------------------------
alias initialize_KGC_DelaySkill initialize
def initialize
initialize_KGC_DelaySkill
@ Delay_skills = []
end
end
# ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
#================================================= =============================
# ? Scene_Battle (1 split definition)
#================================================= =============================
class Scene_Battle
#------------------------------------------------- -------------------------
# Main processing ?
#------------------------------------------------- -------------------------
alias main_KGC_DelaySkill main
def main
clear_actor_delay_skills
main_KGC_DelaySkill
end
#------------------------------------------------- -------------------------
# Remove the skills of all actors delay ?
#------------------------------------------------- -------------------------
def clear_actor_delay_skills
$ Game_party.actors.each (| actor | actor.delay_skills = [])
end
end
# ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
#================================================= =============================
# ? Scene_Battle (4 split definition)
#================================================= =============================
class Scene_Battle
#------------------------------------------------- -------------------------
# Frame update ? (1 Main Phase Step: Prepare action)
#------------------------------------------------- -------------------------
alias update_phase4_step1_KGC_DelaySkill update_phase4_step1
def update_phase4_step1
update_phase4_step1_KGC_DelaySkill
update_delay_skill if @ active_battler! = nil
end
#------------------------------------------------- -------------------------
Skills Update # delay ?
#------------------------------------------------- -------------------------
def update_delay_skill
# Reduce the number of turns to fire skill delay
for ds in@active_battler.delay_skills
ds.turn_count -= 1
end
end
#------------------------------------------------- -------------------------
? action resulting skill #
#------------------------------------------------- -------------------------
alias make_skill_action_result_KGC_DelaySkill make_skill_action_result
def make_skill_action_result
make_skill_action_result_KGC_DelaySkill
make_delay_skill_effect
end
#------------------------------------------------- -------------------------
# Create a delay effect ? Skills
#------------------------------------------------- -------------------------
def make_delay_skill_effect
return unless@skill.element_set.include? ($ game_special_elements ["skill_delay"])
for i in 0 ... @ target_battlers.size
target = @ target_battlers [i]
# In case of damage to Miss Next
next if target.damage == nil | | target.damage == "Miss"
# Back in front hit the target skill
target.states = @ target_battlers2 [i]. states.dup
target.hp = @ target_battlers2 [i]. hp
target.sp = @ target_battlers2 [i]. sp
# On the turn, trigger skill set fire to their
d_skill = Game_DelaySkillInfo.new
d_skill.turn_count = @ skill.variance
d_skill.skill_id = @ skill.power
d_skill.user = @ active_battler
target.delay_skills <<d_skill
# Damage "Reserve" Set
target.damage = "Reserve"
end
end
#------------------------------------------------- -------------------------
Butler set the target or item # skills ?
# Scope: area of effect skill or item
#------------------------------------------------- -------------------------
alias set_target_battlers_KGC_DelaySkill set_target_battlers
def set_target_battlers (scope)
set_target_battlers_KGC_DelaySkill (scope)
# Save for the Butler
@ Target_battlers2 = []
for i in 0 ... @ target_battlers.size
@ Target_battlers2 [i] = @ target_battlers [i]. Dup
end
end
#------------------------------------------------- -------------------------
# Frame update ? (main phase)
#------------------------------------------------- -------------------------
alias update_phase4_KGC_DelaySkill update_phase4
def update_phase4
if @ phase4_step == 6
check_delay_skill
end
update_phase4_KGC_DelaySkill
end
#------------------------------------------------- -------------------------
# Determine trigger delay ? Skills
#------------------------------------------------- -------------------------
def check_delay_skill
# Object (the action) if the non-combat skills are delayed release
if@active_battler.dead?
@ Active_battler.delay_skills = []
return
end
for i in 0 ... @ active_battler.delay_skills.size
If the fire is still # next
next if@active_battler.delay_skills [i]. turn_count> 0
skill = $ data_skills [@ active_battler.delay_skills [i]. skill_id]
# Invoke the skills
@ Active_battler.skill_effect (@ active_battler.delay_skills [i]. User, skill)
@ Help_window.set_text (skill.name, 1)
@ Animation2_id = skill.animation2_id
@ Common_event_id = skill.common_event_id
@ Target_battlers = [@ active_battler]
# Remove the skill trigger delay, move to Step 4
@ Active_battler.delay_skills.delete_at (i)
@ Phase4_step = 4
break
end
end
end
# _ / Delay skills ? - KGC_DelaySkill ?
# _ / ? Last update: 2008/03/23 ?
#_/----------------------------------------------- -----------------------------
# _ / Create a time lag occurs before the fire skills.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/
$ Imported = () if $ imported == nil
$ Imported ["DelaySkill"] = true
if $ game_special_elements == nil
$ Game_special_elements = ()
$ Data_system = load_data ("Data / System.rxdata")
end
# Delay skill attributes
$ Game_special_elements ["skill_delay"] = $ data_system.elements.index ("Skills" delay)
if $ game_special_elements ["skill_delay"] == nil
# Order to preserve compatibility "time lag" It will do
$ Game_special_elements ["skill_delay"] = $ data_system.elements.index ("skills lag")
end
if $ game_special_elements ["skill_delay"] == nil
$ Game_special_elements ["skill_delay"] = $ data_system.elements.index ("DelaySkill")
end
#================================================= =============================
# ? Game_DelaySkillInfo
#------------------------------------------------- -----------------------------
# A class that holds information skills delay.
#================================================= =============================
class Game_DelaySkillInfo
#------------------------------------------------- -------------------------
# Public instance variables ?
#------------------------------------------------- -------------------------
attr_accessor: turn_count # delay the number of turns
attr_accessor: skill_id # invoke ID Skills
attr_accessor: user # by invoking
#------------------------------------------------- -------------------------
# Object initialization ?
#------------------------------------------------- -------------------------
def initialize
@ Turn_count = 0
@ Skill_id = 0
@ User = nil
end
end
# ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
#================================================= =============================
# ? Game_Battler (1 split definition)
#================================================= =============================
class Game_Battler
#------------------------------------------------- -------------------------
# Public instance variables ?
#------------------------------------------------- -------------------------
attr_accessor: delay_skills # array of skills delay
attr_accessor: states # states
#------------------------------------------------- -------------------------
# Object initialization ?
#------------------------------------------------- -------------------------
alias initialize_KGC_DelaySkill initialize
def initialize
initialize_KGC_DelaySkill
@ Delay_skills = []
end
end
# ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
#================================================= =============================
# ? Scene_Battle (1 split definition)
#================================================= =============================
class Scene_Battle
#------------------------------------------------- -------------------------
# Main processing ?
#------------------------------------------------- -------------------------
alias main_KGC_DelaySkill main
def main
clear_actor_delay_skills
main_KGC_DelaySkill
end
#------------------------------------------------- -------------------------
# Remove the skills of all actors delay ?
#------------------------------------------------- -------------------------
def clear_actor_delay_skills
$ Game_party.actors.each (| actor | actor.delay_skills = [])
end
end
# ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
#================================================= =============================
# ? Scene_Battle (4 split definition)
#================================================= =============================
class Scene_Battle
#------------------------------------------------- -------------------------
# Frame update ? (1 Main Phase Step: Prepare action)
#------------------------------------------------- -------------------------
alias update_phase4_step1_KGC_DelaySkill update_phase4_step1
def update_phase4_step1
update_phase4_step1_KGC_DelaySkill
update_delay_skill if @ active_battler! = nil
end
#------------------------------------------------- -------------------------
Skills Update # delay ?
#------------------------------------------------- -------------------------
def update_delay_skill
# Reduce the number of turns to fire skill delay
for ds in@active_battler.delay_skills
ds.turn_count -= 1
end
end
#------------------------------------------------- -------------------------
? action resulting skill #
#------------------------------------------------- -------------------------
alias make_skill_action_result_KGC_DelaySkill make_skill_action_result
def make_skill_action_result
make_skill_action_result_KGC_DelaySkill
make_delay_skill_effect
end
#------------------------------------------------- -------------------------
# Create a delay effect ? Skills
#------------------------------------------------- -------------------------
def make_delay_skill_effect
return unless@skill.element_set.include? ($ game_special_elements ["skill_delay"])
for i in 0 ... @ target_battlers.size
target = @ target_battlers [i]
# In case of damage to Miss Next
next if target.damage == nil | | target.damage == "Miss"
# Back in front hit the target skill
target.states = @ target_battlers2 [i]. states.dup
target.hp = @ target_battlers2 [i]. hp
target.sp = @ target_battlers2 [i]. sp
# On the turn, trigger skill set fire to their
d_skill = Game_DelaySkillInfo.new
d_skill.turn_count = @ skill.variance
d_skill.skill_id = @ skill.power
d_skill.user = @ active_battler
target.delay_skills <<d_skill
# Damage "Reserve" Set
target.damage = "Reserve"
end
end
#------------------------------------------------- -------------------------
Butler set the target or item # skills ?
# Scope: area of effect skill or item
#------------------------------------------------- -------------------------
alias set_target_battlers_KGC_DelaySkill set_target_battlers
def set_target_battlers (scope)
set_target_battlers_KGC_DelaySkill (scope)
# Save for the Butler
@ Target_battlers2 = []
for i in 0 ... @ target_battlers.size
@ Target_battlers2 [i] = @ target_battlers [i]. Dup
end
end
#------------------------------------------------- -------------------------
# Frame update ? (main phase)
#------------------------------------------------- -------------------------
alias update_phase4_KGC_DelaySkill update_phase4
def update_phase4
if @ phase4_step == 6
check_delay_skill
end
update_phase4_KGC_DelaySkill
end
#------------------------------------------------- -------------------------
# Determine trigger delay ? Skills
#------------------------------------------------- -------------------------
def check_delay_skill
# Object (the action) if the non-combat skills are delayed release
if@active_battler.dead?
@ Active_battler.delay_skills = []
return
end
for i in 0 ... @ active_battler.delay_skills.size
If the fire is still # next
next if@active_battler.delay_skills [i]. turn_count> 0
skill = $ data_skills [@ active_battler.delay_skills [i]. skill_id]
# Invoke the skills
@ Active_battler.skill_effect (@ active_battler.delay_skills [i]. User, skill)
@ Help_window.set_text (skill.name, 1)
@ Animation2_id = skill.animation2_id
@ Common_event_id = skill.common_event_id
@ Target_battlers = [@ active_battler]
# Remove the skill trigger delay, move to Step 4
@ Active_battler.delay_skills.delete_at (i)
@ Phase4_step = 4
break
end
end
end
My problem is that I can't figure out where I need to create the database of the skills along with their delay times, etc. Do I insert this information at the beginning of the script? This seems to be the common practice with "English"-written scripts. Or do I need to "import" something from an external file.
Thank you very much for any help that you are willing to give, and I apologize once more should this turn out to be an embarrassingly easy problem to solve.