Making skills restricted to non-weapons?

Is there a script for this?


If I'm not clear, I mean like requiring a shield to be equipped for this attack, or this attack requiring a certain type of accessory (this is the big one, because of the way I have my game set up...).


Also, a way to switch out equipment in battle would be nice, but not necessary. I may not even use this, since it would require the players to think ahead a little bit.
you either need a script, or you have the equipment add the skill without it being learned by class
https://victorenginescripts.wordpress.com/rpg-maker-vx-ace/action-conditions/ + https://victorenginescripts.wordpress.com/rpg-maker-vx-ace/passive-states/


- Create a state with no icon and bonus.


- Make the state a passive state on the equipment.


- Make a condition that the skill can be used only when affected by the state.


You can do it without the passive state script, but it would require to use a custom condition and some script codes. So with the passive state is easier.
Thanks, Victor Sant!


Since they're your scripts, I need to ask: Are your scripts available for commercial projects, or only non-commercial?
Here you go! Works for weapons or armor your choice. No states needed.

Spoiler
Code:
################################################################################
#↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓#
#↓                                                                            ↓#
#↓                    Item/Skill Equipment: Version 0.2                       ↓#
#↓                                                                            ↓#
#↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕#
#↑                                                                            ↑#
#↑                            Written By: Joe Pro                             ↑#
#↑                       Last Edited: February 3, 2014                        ↑#
#↑                                                                            ↑#
#↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑#
################################################################################

#◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
#◙ ** Disclaimer                                                              ◙#
#◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙#
#◙                                                                            ◙#
#◙ This script is not for commercial, if you wish to use this script in a     ◙#
#◙ game please PM me. All credit is to be given to me as the author of this   ◙#
#◙ script.                                                                    ◙#
#◙                                                                            ◙#
#◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
#◙ ** How To Use                                                              ◙#
#◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙#
#◙                                                                            ◙#
#◙ * Use the example below in an armor or weapon's note box to set skill      ◙#
#◙   pairing.                                                                 ◙#
#◙                                                                            ◙#
#◙    <skills: x, x, x, and so on...>                                         ◙#
#◙                                                                            ◙#
#◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#
#◙ ** Updates / Version Notes                                                 ◙#
#◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙#
#◙                                                                            ◙#
#◙   v0.1                                                                     ◙#
#◙ ~◄◙◙◙◙►~                                                                   ◙#
#◙ * Allows you too pair skill(s) to armor, allowing you to use the skill(s)  ◙#
#◙  as long as you have the paired armor equipped.                            ◙#
#◙                                                                            ◙#
#◙   v0.2                                                                     ◙#
#◙ ~◄◙◙◙◙►~                                                                   ◙#
#◙ * Allows you too pair skill(s) to weapons, allowing you to use the skill(s)◙#
#◙  as long as you have the paired weapons equipped.                          ◙#
#◙                                                                            ◙#
#◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#



################################################################################
#↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓#
#↓                                                                            ↓#
#↕                    Item/Skill Equipment: Version 0.2                       ↕#
#↑                                                                            ↑#
#↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑#
################################################################################



#==============================================================================
# ** RPG::Armor < RPG::EquipItem
#------------------------------------------------------------------------------
#  The Data Class for Armors.
#==============================================================================

class RPG::Armor < RPG::EquipItem

  #--------------------------------------------------------------------------
  # * Get Armor's Skills
  #--------------------------------------------------------------------------
  def skills
    skill_list = self.note.match(/<skills:\s*(\d+(?:\S*\s*\d+)*)*>/imx) {  
      $1.scan(/\d+/).collect { |i| i.to_i }
    }
    return skill_list
  end
  
end


#==============================================================================
# ** RPG::Weapons < RPG::EquipItem
#------------------------------------------------------------------------------
#  The Data Class for Weapons.
#==============================================================================

class RPG::Weapon < RPG::EquipItem

  #--------------------------------------------------------------------------
  # * Get Weapons's Skills
  #--------------------------------------------------------------------------
  def skills
    skill_list = self.note.match(/<skills:\s*(\d+(?:\S*\s*\d+)*)*>/imx) {  
      $1.scan(/\d+/).collect { |i| i.to_i }
    }
    return skill_list
  end
  
end


#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It is used within the Game_Actors class
# ($game_actors) and is also referenced from the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler

  #--------------------------------------------------------------------------
  # * Aliasing Method: Skills
  #--------------------------------------------------------------------------
  alias :gas354467843214 :skills
  
  #--------------------------------------------------------------------------
  # * Get Skill Object Array
  #--------------------------------------------------------------------------
  def skills
    (gas354467843214() | item_skills).sort.collect {|id| $data_skills[id] }
  end
  
  #--------------------------------------------------------------------------
  # * Get Skills given by equipment
  #--------------------------------------------------------------------------
  def item_skills
    skill_list = []
    armors.size.times { |i|
      if armors[i].skills != nil
        armors[i].skills.size.times { |s| 
          skill_list.push armors[i].skills[s]
        }
      end
    }
    weapons.size.times { |i|
      if weapons[i].skills != nil
        weapons[i].skills.size.times { |s| 
          skill_list.push weapons[i].skills[s]
        }
      end
    }
    return skill_list
  end
  
end
No script needed if you design it based on what's being provided by the features in the database editor.


You can easily add skill to an equipment so any actor wearing it will temporary be able to use that skill as long as he/she is wearing it.
True, but some scripts are designed strictly for convenience, as was this script. It is much faster to type a single line of code rather then clicking and cycling different options(in some cases). As I understand most scripts can be mimiced  via events. 
True, but some scripts are designed strictly for convenience, as was this script. It is much faster to type a single line of code rather then clicking and cycling different options(in some cases). As I understand most scripts can be mimiced  via events. 

When the method is already built in, we can't say the event is mimicking the script, but rather the script is trying to reproduce what the interpreter class(event commands) is already providing. So that means the game engine will be running two similar set of scripts at the same time which adds to the resource burden. Not to mention that the more custom scripts installed the more chance of conflicts, and notetags for equipments are often one of the most used design in other custom scripts, making the conflict chances higher than other normal scripts. If it's something that's already there in the database editor, there's no need to risk a chance of conflict by adding a script doing what a simple few clicks in the database editor can do imo.
Did you even look at my script. I doubt very strongly that it would run into any compatibility issues. The only way I can see it causing any issues would be if another script over wrote the skills method. Which in that case you just keep my script below it.

notetags for equipments are often one of the most used design in other custom scripts, making the conflict chances higher than other normal scripts.

Did you mean scripts like this? Maybe this person is not going to use the noteboxes for anything else. They requested a script. I helped out.

So that means the game engine will be running two similar set of scripts at the same time which adds to the resource burden. Not to mention that the more custom scripts installed the more chance of conflicts,

So stop writing scripts. The engine that they have created has made pretty much anything possible via events i.e. Battle systems, menus, anything.. right? Besides a few system edits i.e. inputs, screen size, fonts?, things like that. There's not much else one can do. Is there? So what is the purpose of sites like these? It is to make things easier for the programmers. My script is not going to burden anyone's engine. It is 3 methods placed into already existing classes and 1 alias. I'm sure if I looked though a list of scripts you have written I will find some pointless scripts by your measures. I can go through and point them out if you like, as you seem to always have some input for someone else. I can also go though and critique your writing habits if you like.


So as I said

...some scripts are designed strictly for convenience, as was this script.



In either case it took me a total of 5 mins to write make it look pretty. If someone can find a use for it then I'll be all the merrier. If not, it wont hurt my feelings at all. I did it to challenge myself and help someone out.
In my opinion, some of those "event solutions" are ugly and bad design. Yes they work, but they don't look good form a game design perspective.


For this post example. He wanted a "shield skill", for example a 'Shield Bash'.


He don't want the shield to grant the skill, He want to have the skill regardless of the equip, but having the equip to allow the use or not.


Also this create the issue. If the skill is granted by the equip, any actor will learn it at any level. Now what if he want that different actors to use the same items, but only some use the skill? Then we need another workaround.


The script on this case grants a more elegant design than any other workaround with the default maker features.
Okay, I come back and realize there may be some confusion with what I want, and that's okay- I'm horrible at explanations.


I would want the abilities to be limited to, say, a Shield Bash that is on a class' level list to require a shield. Conversely, my game's class mechanic relies on "Class Items". I run Yanfly's Class System, and the only workaround to a certain problem coming from that script (where once you learn a skill from a class, you keep it regardless of switching to that class) he gave was the un-elegant solution of "Just make each class use its own skill type." I don't really want that, which is where my idea came from.


By limiting the abilities to require the particular class item (and some skills simply don't make sense without the class item equipped, since they are "directly" manipulating or using that item in some way), I can keep a more sensical skill type list (Healing, Magic, Melee, etc.), while giving the player some variation in their available skills. What I don't want is for the skills to be de-leveled, which placing the skills directly on the items would do in a way.


Also, Victor, I'm sorry but I'm having an issue with your script. I added an icon to the passive state to show that it actually is on, but it's not working? I have the skill set as requiring the state, but even with the state active, I still can't use the skill?

Darkness with passive state requirement.PNG

NEcromacner Vial with skill.PNG

Necromancer Skills Enabled.PNG

Capture.PNG
@feliaria Then what you want is the skill item restriction type extension script, not item that add skill script.


http://www.rpgmakervxace.net/topic/3746-fp-item-and-skill-restrictions/


@JoePro Never mentioned your script in the first place, didn't even read the script you post. You just assumed i do. As you agreed yourself, such script can have a chance of conflict, so what i am trying to do is suggest that it can be done within the editor itself without the need of a script.


A "convenience" script is a script that shortens a few methods or a large long code into shortcuts. (Just like what the interpreter do), i don't see adding note tag vs a few clicks in the feature panel make things faster, especially when the drop down box remember your last entry and the commands are copy-paste-able.


@Victor Sant Yes, main reason is event needs to go through the interpreter class to work and not all scene supports that. But the features in the database editor works slightly different than events, it actually has a higher priority in running sequence. But well, like what you said, if the OP wants the skill to be present all time, that suggestion will not work. He wanted something like the built-in weapon restriction on skill but uses armor/accessories. Tsukihime has a script for that already so i am just going to point him to that.
Great! Hime's script is working! Thanks, MeowFace! 🙂
You're welcome!

Original thread: https://forums.rpgmakerweb.com/threads/making-skills-restricted-to-non-weapons.56282/