Kingdom Ablaze
Sponsor
ok so im working on this AI system, which is working great!!! all except it lets my healers use moves they dont know here is the code giving me issues:
[rgss]#@values is the power of a skill(all neg because i filtered out the healing skills beforehand)
#@skill is the skill ^^^^
#@choice starts at 0
for i in 1...$data_skills.size
if @values != nil #just to be safe, tho it shouldn't occur
if @values < @choice && self.skill_can_use?(@skill.id)
p(i.to_s+","+self.skill_can_use?(i).to_s+","+self.id.to_s)
@choice = @values
@skill_choice = @skill.id
end
end
end
[/rgss]
my print give me:
1,true,1 <---right
2,true,1 <---wrong
everything is default (1 is heal, 2 is greater heal)
as you can see below enemy 1 does not know greater heal
any idea why @skill_choice keeps ending up as 2 when self.skill_can_use? should prevent it
[rgss]#@values is the power of a skill(all neg because i filtered out the healing skills beforehand)
#@skill is the skill ^^^^
#@choice starts at 0
for i in 1...$data_skills.size
if @values != nil #just to be safe, tho it shouldn't occur
if @values < @choice && self.skill_can_use?(@skill.id)
p(i.to_s+","+self.skill_can_use?(i).to_s+","+self.id.to_s)
@choice = @values
@skill_choice = @skill.id
end
end
end
[/rgss]
my print give me:
1,true,1 <---right
2,true,1 <---wrong
everything is default (1 is heal, 2 is greater heal)
as you can see below enemy 1 does not know greater heal
any idea why @skill_choice keeps ending up as 2 when self.skill_can_use? should prevent it