Attack Skill command

command_attackSkill1

This script allows you to determine an actor’s attack skill based on different properties such as the actor’s equips, currently applied states, class, or the actor itself.

You can dynamically change the attack skill during battle by simply changing one of these properties.

By default, the attack command executes the “attack” skill, which is skill 1 in the skills database.

Download

Script: download here
Required: Command Manager

Installation

Place this script below Command Manager and above Main

Usage

Note-tag actors, classes, weapons, armors, or states with

<attack skill: ID PRIORITY>

For some skill ID.

The priority is used if you have multiple states or equips with a
attack skill ID. the highest priority is taken in this case, and if multiple
attack skill ID’s have equal priority, then whichever appears first is taken.

If you would like to use a formula for the ID, you will need to use the
extended note-tag:

<attack skill>
  id: FORMULA
  priority: x
</attack skill>

You can use any valid formula that returns a number. The following formula
variables are available:
a - the current battler you are inputting commands for
t - game troop
p - game party
v - game variables
s - game switches

If your actor does not have a custom attack skill ID, then it defaults to
the actor’s attack skill. If the actor does not have a custom attack skill,
then it defaults to the class attack skill. Finally, it will default to skill
1 if no custom attack skills are defined.

You may also like...

14 Responses

  1. Gleb says:

    Hello!
    I ran into an issue while using this script. I get the following error upon launching a Battle Test and choosing “Fight”.

    Script ‘Hime Attack Skill Command’ line 165: NoMethodError occurred.
    Undefined method ‘attack_skill_id’ for 16:FixNum

    I was attempting to set skill #16 as my default attack skill, and wrote in the actor’s and class’ note sections.
    I have the script installed below Command Manager as instructed.

  2. whoooosh says:

    Hello,

    I have been testing this script and been getting

    “line “Attack Skill” 159: NoMethodError

    undefined method priority for 1:fixnum”

    I’m currently also using other scripts, includig Yanfly’s extra equip slots, and have the command manager for this above this one.

  3. qwest says:

    Hello, i’m having a problem with this script. Here is what the error says:

    Script ‘Attack Skill’ line 179: NameError occurred.

    uninitialized constant Object::Game_BattlerCommand

    Help?

  4. charlie says:

    Hello. Having a bit of an issue getting this to work.
    Trying to put a notetag in my armor like this:

    When I attack, no matter if I have it equipped or not, I get this error:

    Script ‘Commands’ line 808: TypeError occurred
    no implicit conversion from nil to integer

    Any suggestions?

  5. koldsack says:

    ok i got it, just replace “id” with “s”. facepalm

  6. koldsack says:

    question: how do you write a formula using s? does it go by s(n) = true? or would s(n) or s[n] would suffice? i tried s(n) and s[n] on it’s own and it didn’t work.

    • Hime says:

      What is “s”? Do you mean the switches? You would write s[1] to refer to switch 1.

      • koldsack says:

        Hi hime, i’m refering to the attack skill command, just not really sure how i should go about using a formula for it.

        i’m basically changing the default attack skill to skill id 171 ( where i have the actor learn it via a battle event). what i’m doing now is activating this change via switches, like s[171] for skill id 171 for example.

        do you have some pointers on how i can write it with this tag?
        as in:

        171: s[171]? == true
        priority: 3
        </attack skill>
        perhaps? hope i’m making sense.

        oh btw, do you know that your note manager would decompress all vx ace engine notes onto the data folder? And it is possible to update the notetags directing from those decompressed files instead of using a src tag in the notetag section. like actor1.txt for actor1 for eg 🙂

        • Hime says:

          You can use this kind of formula

          s[171] ? 171 : 1
          

          However, if you have a lot of conditions, you might define a method in Game_Actor such as

          class Game_Actor 
            def my_attack
               if $game_switches[171]
                   171
               else
                    1
               end
            end  
          end
          

          And then you can use the formula

          a.my_attack
          

Leave a Reply

Your email address will not be published. Required fields are marked *