Issue with Yanfly Autobattle Script (VXAce)

Discussion in 'RGSSx Script Support' started by bgillisp, May 25, 2018.

Thread Status:
Not open for further replies.
    Tags:
  1. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    10,893
    Likes Received:
    10,565
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    In my project I'm using Yanfly's Autobattle script, which can be found here: https://yanflychannel.wordpress.com/rmvxa/battle-scripts/command-autobattle/

    However, I found an odd bug with the script today. It seems that when autobattle is on, characters can use skills even if they don't have the proper skill type for that skill. In other words, consider the skill Mind Tap, which requires the Mind Magic Skill Type to use. However, if Autobattle is turned on, the character can use that skill regardless of whether or not they have the proper skill type.

    I looked at the script and it seems the issue is it creates the actions for autobattle using the same rules as enemies, and enemies don't require the proper skill type to use a skill. So is there a way to fix this so that actors can only use skills they have the proper skill type for equipped at that point in time?
     
    #1
  2. Sixth

    Sixth Veteran Veteran

    Messages:
    2,088
    Likes Received:
    757
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    You can't change the features of any database objects by default, so they never put in any checks for your scenario.
    It simply checks for all learned skills, whether their skill type or ID is sealed, and that's all.
    Once it's learned, it doesn't matter which skill type it belongs to, it just assumes that the actor can use it unless it's sealed.

    You could try to use this snippet:
    Code:
    class Game_Actor < Game_Battler
    
      alias strip_list6414 make_action_list
      def make_action_list
        list = strip_list6414
        list.reject! {|act| ![*added_skill_types,0].include?(act.item.stype_id) }
        return list
      end
    
    end
    
    
    Put it below the default scripts.
    It will filter out any skills belonging to a skill type which the actor doesn't have currently in the skill type feature list.
    No idea if it will cause any troubles with other scripts, but that method is used for autobattle actions only anyway, so there shouldn't be any major issues, I guess.
    Ohh, and I haven't really tested this, as usual. :p
     
    #2
  3. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    10,893
    Likes Received:
    10,565
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Forgot about this for a while, sorry, but it appears to be working as intended. Thanks.

    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

     
    #3
Thread Status:
Not open for further replies.

Share This Page