Set Guard/Attack Skills

● ARCHIVED · READ-ONLY
Started by Vlue 17 posts View original ↗
  1. Set Guard/Attack Skills v1.0

    By V.M. of D.T.


    Introduction

    It's a script! Set different skills to be used when the guard or attack command are chosen for specific actors!

    Features

    - Set different skills to be used when the guard or attack command are chosen for specific actors!

    How to Use

    Place in, edit hashes as needed. Details in script.

    Script

    Convenient Pastebin: Here

    FAQ

    N/A

    Credit and Thanks

    - By V.M. of D.T.

    - Free to use in any project with credit given

    Author's Notes

    Banana banana banana.
  2. Either I'm just stupid or I'm just stupid, I have been starring at the script for a good 10mins and i still don't know what to edit.

    Please advise.
  3. CaeSera0 said:
    Either I'm just stupid or I'm just stupid, I have been starring at the script for a good 10mins and i still don't know what to edit.

    Please advise.
    1. ACTOR_ATTACK_SKILL_ID = { 1 => 1,
    2.                           2 => 1,
    3.                           3 => 1,
    4.                         }
    Actor 1 uses Skill ID 1 when choosing Attack command. Change the skill ID to the skill of your choice.

    Actor 2 => Skill ID

    Actor 3 => Skill ID

    Feel free to add an extra 4 => "Skill ID," before the ending bracket on a next line if you need to add more actors.

    Same goes for 

    1. ACTOR_GUARD_SKILL_ID = { 1 => 2,
    2.                          2 => 2,
    3.                          3 => 2,
    4.                         }
     

    It's like the first thing in the script after the commented section. For future reference most scripts have their editable regions come first, immediately after the commented sections/instructions.
  4. ok got it to work now.

    now my next question is how do I change the name for each individual character, or is there another thread that has this answer?

    Thanks again
  5. ...You just do that through the Actor tab of the database?

    Or there's an event to change Actor Name whenever you want. (for mid-game purposes or something)
  6. sorry I meant for the skills themselves
    So instead of attack it would be Air Blade
  7. This is quite an old thread, but I'll try my luck.

    Your script states, that you can change the default attack for not just an actor, but weapons/armor as well. Could you give a brief explanation as to how I could do that, that would be nice. A certain weapon having it's own default attack would solve most of my problems I'm having with my battle system.
    I can't understand this code and trailing and erroring didn't get me very far.

    Thanks!
  8. I'm actually using an older version, but how I read the updated script it would be like this:

    First decide what attack you want to give it. For the sake of this example, we will say that you create a new skill in slot 73 (for example, it might add Fire to the attack)
    Make sure you have the damage formula you want as well plus any features you want, TP/MP cost etc. etc.

    Now go to your weapon tab and select the sword that you want to have this attack.
    In the note box type
    <Attack_Id 73>

    If you want another weapon to have a different attack, create a new one - let's assume it's the next slot down, i.e. slot 74.
    In the new weapon's note box you type
    <Attack_Id 74>
  9. There we go, now we got it! I was using the new script as well, but also the old instructions.

    Thanks a bunch, probably wouldn't have figured it out without you!
  10. Hello, regarding this script, is it reasonably possible to also have it check the note text of skills? I'd like to be able to change the guard command on level up, preferably more than once.

    Sorry for the necro, thanks in advance
  11. @Shoal Necroposting in threads for things like scripts, which may need ongoing support, is okay. Just be aware Vlue has not been online here in 2 years and is unlikely to see your request. I recommend you post in Script Requests to see if perhaps someone could help add this function for you, if Vlue's terms of use allow modification.
  12. @Shoal I think you could actually event it, if you're fine with that anyway. Like make a guard skill specific for that actor which will serve as the "initiator". Then set it to be that actor's guard skill then make the skill run a common event which then utilizes the "Force Action" command to make the actor use the actual guard skill that corresponds to his level.

    Or if the only difference between the various guard skills is the guard state that they add, just add the correct state using the damage formula since you can use RGSS code in the damage formula, or add the state using a common event.
  13. Shoal said:
    change the guard command on level up
    try this. Changes the guard skill at the level you specify.
    Vlue - attack/guard skill by level addon
    Code:
    #Set Guard/Attack Skills v1.3
    #----------#
    #Features: Let's you set different attack/guard actions for individual actors
    #
    #Usage:    Placed in note tags of actors, weapons, armors, classes:
    #          <Attack_Id skill_id level> - changes default attack if level matches
    #          <Guard_Id skill_id level>  - changes default guard if level matchs
    #
    #           e.g. <guard_id 44 15>
    #           guard skill is quick move at level 15
    #        Must be in order. You cannot put a lower level below the higher level
    #
    #          Weapons/Armors overrides Classes overides Actors.
    #       
    # addon by Roninator2
    #----------#
    #-- Script by: V.M of D.T
    class Game_Actor
      def guard_skill_id
        @equips.each do |item|
          next unless item.object
          return $1.to_i if item.object.note.upcase =~ /<GUARD_ID (\d+)>/
        end
        return $1.to_i if self.class.note.upcase =~ /<GUARD_ID (\d+)>/
        idg = actor.note.upcase =~ /<GUARD_ID (\d+)>/ ? $1.to_i : 2
        actor.note.upcase.each_line { |line|
          if line =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
            if @level >= $2.to_i
              idg = $1.to_i
            end
          end
         }
        return idg
      end
      def attack_skill_id
        @equips.each do |item|
          next unless item.object
          return $1.to_i if item.object.note.upcase =~ /<ATTACK_ID (\d+)>/
        end
        return $1.to_i if self.class.note.upcase =~ /<ATTACK_ID (\d+)>/
        ida = actor.note.upcase =~ /<ATTACK_ID (\d+)>/ ? $1.to_i : 1
        actor.note.upcase.each_line { |line|
          if line =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
            if @level >= $2.to_i
              ida = $1.to_i
            end
          end
         }
        return ida
      end
    end
  14. @Roninator2 Thank you!!! It's better than i was anticipating. ♥

    At some point i'm sure i will run into something that forces me to learn how to do more and different kinds of events but for now it's smooth sailing =3

    Edit:
    It seems the level defining part is breaking? I did some quick tests and the guard effect runs fine if i remove the level so that it's just guard id as originally.

    Would using yanfly's class system mess with this thing in particular?
  15. Shoal said:
    Would using yanfly's class system mess with this thing
    I don't know, but the script is designed to have equipment notes overwrite -> class notes overwrite -> actors notes
    Do you have any of these attack or guard notes in your equipment or class?

    Also what I made only works for actors.
  16. For the test, i was using it exclusively in the class. there are no other places where attack or guard notes exist yet, so the chance of conflict shouldn't exist and i tested it using the player character.

    I appreciate your help with this! at some point i'll do a better test with my other scripts disabled but time is not too plentiful for me atm. ^^'
  17. Shoal said:
    i was using it exclusively in the class.
    So just like what I was saying, the add on I made is for actors only, not classes or equipment.
    If you specify using this script in a class then you do not need my add on.
    but I can try and rework it for classes.

    Try this
    Vlue - Attack/Guard skill change by level
    Code:
    #Set Guard/Attack Skills v1.3.2
    #----------#
    #Features: Let's you set different attack/guard actions for individual actors
    #
    #Usage:    Placed in note tags of actors, weapons, armors, classes:
    #          <Attack_Id skill_id level> - changes default attack if level matches
    #          <Guard_Id skill_id level>  - changes default guard if level matchs
    #
    #           e.g. <guard_id 44 15>
    #           guard skill is quick move at level 15
    #
    #          Weapons/Armors overrides Classes overides Actors.
    #          Levels must be in a low to high order
    #           e.g. <guard_id 44 10>
    #           e.g. <guard_id 49 15>
    #         
    # addon by Roninator2
    #----------#
    #-- Script by: V.M of D.T
    class Game_Actor
      def guard_skill_id
        @equips.each do |item|
          next unless item.object
        iidg = item.object.note.upcase =~ /<GUARD_ID (\d+)>/i ? $1.to_i : 2
        item.object.note.upcase.each_line { |line|
          if line =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
            if @level >= $2.to_i
              iidg = $1.to_i
            end
          end
         }
        return iidg if item.object.note.upcase =~ /<GUARD_ID (\d+)>/i
        return iidg if item.object.note.upcase =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
        end
     
        cidg = self.class.note.upcase =~ /<GUARD_ID (\d+)>/ ? $1.to_i : 2
        self.class.note.upcase.each_line { |line|
          if line =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
            if @level >= $2.to_i
              cidg = $1.to_i
            end
          end
         }
        return cidg if self.class.note.upcase =~ /<GUARD_ID (\d+)>/i
        return cidg if self.class.note.upcase =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
        
        idg = actor.note.upcase =~ /<GUARD_ID (\d+)>/i ? $1.to_i : 2
        actor.note.upcase.each_line { |line|
          if line =~ /<GUARD_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
            if @level >= $2.to_i
              idg = $1.to_i
            end
          end
         }
        return idg
      end
     
      def attack_skill_id
        @equips.each do |item|
          next unless item.object
          iida = item.object.note.upcase =~ /<ATTACK_ID (\d+)>/i ? $1.to_i : 1
          item.object.note.upcase.each_line { |line|
            if line =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
              if @level >= $2.to_i
                iida = $1.to_i
              end
            end
           }
          return iida if item.object.note.upcase =~ /<ATTACK_ID (\d+)>/i
          return iida if item.object.note.upcase =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
        end
        
        cida = self.class.note.upcase =~ /<ATTACK_ID (\d+)>/i ? $1.to_i : 1
        self.class.note.upcase.each_line { |line|
          if line =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
            if @level >= $2.to_i
              cida = $1.to_i
            end
          end
         }
        return cida if self.class.note.upcase =~ /<ATTACK_ID (\d+)>/i
        return cida if self.class.note.upcase =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
        
        ida = actor.note.upcase =~ /<ATTACK_ID (\d+)>/i ? $1.to_i : 1
        actor.note.upcase.each_line { |line|
          if line =~ /<ATTACK_ID (\d+)\s*[ ,]?\s*(\d+)*>/i
            if @level >= $2.to_i
              ida = $1.to_i
            end
          end
         }
        return ida
      end
    end