ScriptKitty
Member
Before anyone gets on my case, I am using the legal version of RMXP, I only use the term "Call Script" because it's clearer what I'm talking about than saying "the 'Script...' button". In fact, it's the legal version that's giving me so many problems.
I'm using a script that SephirothSpawn made for me, shown here:
To call the script, I've been using "$game_party.actors[001].deteriorizing = true"... But thanks to English RMXP's ridiculously narrow input windows, it puts the "= true" on a line of its own. So I also have to use this script by sandgolem in order to use that call.
Unfortunately, I still recieve this error:
I am not using SDK.
Can anyone point me in the direction of a solution?
I'm using a script that SephirothSpawn made for me, shown here:
Code:
class Game_Actor
Skill_HP_Cost = {}
Deterioration_State_ID = 017
Time_To_Deterioration = 5 # In Seconds
attr_reader :deteriorizing
attr_accessor :last_deterioration_time
alias seph_detsys_gmactr_setup setup
alias seph_detsys_gmactr_states states
alias seph_detsys_gmactr_scu? skill_can_use?
alias seph_detsys_gmactr_se skill_effect
def setup(actor_id)
seph_detsys_gmactr_setup(actor_id)
@deteriorizing = false
@last_deterioration_time = Graphics.frame_count / Graphics.frame_rate
end
def states
states = seph_detsys_gmactr_states
if @deteriorizing
states << Deterioration_State_ID
end
return states.sort
end
def skill_can_use?(skill_id)
if Skill_HP_Cost.has_key?(skill_id)
if @hp < Skill_HP_Cost[skill_id]
return false
end
end
return seph_detsys_gmactr_scu?(skill_id)
end
def skill_effect(user, skill)
seph_detsys_gmactr_se(user, skill)
if user.is_a?(Game_Actor)
if user.deteriorizing
if Skill_HP_Cost.has_key?(skill.id)
user.hp -= Skill_HP_Cost[skill.id]
end
end
end
end
def deteriorizing=(state)
if state
@deteriorizing = true
@last_deterioration_time = Integer(Graphics.frame_count / Graphics.frame_rate)
else
@deteriorizing = false
end
end
def update_deterioration
if @deteriorizing
current_time = Graphics.frame_count / Graphics.frame_rate
if @last_deterioration_time + Time_To_Deterioration <= current_time
@maxhp_plus -= 1
@last_deterioration_time = current_time
@hp = [@hp, maxhp].min
end
end
end
end
module Graphics
class << self
if @stack_update.nil?
alias orig_update update
@stack_update = true
end
def update
orig_update
unless $game_party.nil?
$game_party.actors.each {|actor| actor.update_deterioration}
end
end
end
end
To call the script, I've been using "$game_party.actors[001].deteriorizing = true"... But thanks to English RMXP's ridiculously narrow input windows, it puts the "= true" on a line of its own. So I also have to use this script by sandgolem in order to use that call.
Unfortunately, I still recieve this error:
NoMethodError occoured while running script:
undefined method `deteriorizing=' for nil:NilClass
I am not using SDK.
Can anyone point me in the direction of a solution?