Automatic Battler AI Script, Need help!

SynThrone

Warper
Member
Joined
Aug 27, 2020
Messages
2
Reaction score
0
First Language
Italian
Primarily Uses
RMVXA
Hello everyone!

I have been making a prototype in the last few days using VX ACE.
I'm using this script to enhance the artificial intelligence of my auto-battlers. It works extremely well for the project I'm working on, but unfortunately, there seems to be a game-breaking bug.

The script does not recognize skills learned via item equips, which means that the AI will never utilize those abilities. This is extremely weird to me, since in the vanilla version abilities learned with equipment are used by auto-battlers just fine.

Help would be immensely appreciated!
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV

I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Search for this part in Victor's script:
Code:
  def set_auto_skill(item)
    list = []
    item.id.each do |id|
      next unless skill_learn?($data_skills[id.to_i]) ||
                  id.to_i == attack_skill_id || id.to_i == guard_skill_id
      list.push(Game_Action.new(self).set_skill(id.to_i).evaluate_auto(item))
    end
    list.max_by {|action| action.value }
  end

Replace this line there:
Code:
next unless skill_learn?($data_skills[id.to_i]) ||
With this:
Code:
next unless skills.include?($data_skills[id.to_i]) ||
Note:
Not tested.
 

SynThrone

Warper
Member
Joined
Aug 27, 2020
Messages
2
Reaction score
0
First Language
Italian
Primarily Uses
RMVXA
Search for this part in Victor's script:
Code:
  def set_auto_skill(item)
    list = []
    item.id.each do |id|
      next unless skill_learn?($data_skills[id.to_i]) ||
                  id.to_i == attack_skill_id || id.to_i == guard_skill_id
      list.push(Game_Action.new(self).set_skill(id.to_i).evaluate_auto(item))
    end
    list.max_by {|action| action.value }
  end

Replace this line there:
Code:
next unless skill_learn?($data_skills[id.to_i]) ||
With this:
Code:
next unless skills.include?($data_skills[id.to_i]) ||
Note:
Not tested.
WORKS! You are the MVP.
Thank you so much!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,586
Latest member
Usagiis
Top