Auto Battling features

Hey all I'm kinda new to this though I've been fiddling around for a while now and have been getting on alright up to this point.

I have a healer character who should be set to auto battle, whose only skills are to heal but she keeps attacking.

I've tried sealing the Attack skill in the but then she just does nothing.

I'm not too concerned with AI for now, picking a random skill of her 4 accessible skills would suit this fine, but attacking constantly is not suitable 🙁

Thanks for the help.
OK, I think I've figured this out for you.

First, I created an Auto Battling healer and started each battle at an HP deficit to make sure she had something to heal.  She would sometimes choose to Heal and sometimes choose to attack.  If your Auto Battling healer is always attacking, even when she has heavily injured allies, then you need to try using her without Auto Battler and make sure those healing skills are accessible to you in combat.

So then I looked into the Script Editor to see what I could find about Auto Battler AI.  This method, part of Game_Actor, looked like the most useful:

#-------------------------------------------------------------------------- # * Create Action Candidate List for Auto Battle #-------------------------------------------------------------------------- def make_action_list list = [] list.push(Game_Action.new(self).set_attack.evaluate) usable_skills.each do |skill| list.push(Game_Action.new(self).set_skill(skill.id).evaluate) end list endWhat this is doing is pushing the Attack command, and all "Usable" skills, into an array, then deciding which move to use from this set.  Fortunately, it's pushing them both into the array separately, so let's comment out the "Attack" line:

#-------------------------------------------------------------------------- # * Create Action Candidate List for Auto Battle #-------------------------------------------------------------------------- def make_action_list list = [] #list.push(Game_Action.new(self).set_attack.evaluate) usable_skills.each do |skill| list.push(Game_Action.new(self).set_skill(skill.id).evaluate) end list endOne pound sign did the trick!  When I test the Healer now, she constantly uses healing skills, and never attacks.  I'm not sure what she'll do once the party is at full HP (perhaps keep healing unnecessarily), or if she runs out of MP (perhaps do nothing), but that's an AI issue that's beyond the scope of your question (and beyond what I'm willing to test for the moment, though please post here if you find the answer!).

Let me know if this doesn't work, because it means there's probably something else going wrong with your game during battle.

I suppose at some point I could look into creating an Auto Battle AI script, if there's nothing out there yet.  It could be a pretty useful thing.
Sorry this reply is so late (I'm still working on these features on and off!) and thanks for the help.


For this one I ended up moving the commented out line beneath the loop for the rest of the skills, this made the other skills take priority over the auto attack and I've not seen any problems so far.


One thing I did notice is that when the party is at full HP she does indeed keep healing, so I've got a bit more work to do.


I ended up re-working my character classes entirely but this has still been helpful, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/auto-battling-features.37171/