Hide Menu Skills

Last Updated: 2011.12.11
Download Script
Github Link

Have some skills you want hidden until certain conditions are met? Well, now you can! This script will only hide the skills from the default skill list menus. Anything that displays otherwise may or may not hide them depending on the script and what it bases off of.

<hide always>

This skill will always be hidden from the default skill list windows.

<hide in battle>

This skill will always be hidden from the default skill window in battle.

<hide until usable>

This will require the skill to be usable before it appears in the window.

<hide if switch: x>

This skill will be hidden if switch x is on. The skill will be shown if switch x is off. This switch is considered part of the “any” category.

<hide any switch: x>
<hide any switch: x, x>

This skill will be hidden if any of the switches x is on. Use multiple tags or separate the switch ID’s with commas.

<hide all switch: x>
<hide all switch: x, x>

This skill will be hidden until all of the switches x are on. Use multiple tags or separate the switch ID’s with commas.

<hide eval>
string
string
</hide eval>

For the more advanced users, replace string with lines of code to check for whether or not to hide the skill. If multiple lines are used, they are all considered part of the same line.

Here are some small examples.

<hide eval>
@actor.level > 10 && 
@actor.hp <= 1000
</hide eval>

This hides the skill if the actor’s level is above 10 and the actor’s HP is below 1000.

<hide eval>
[2, 3, 4].include?(@actor.class_id)
</hide eval>

This hides the skill if the actor’s current class is 2, 3, or 4.

<hide eval>
$game_party.item_number($data_items[1]) > 0 || 
$game_party.item_number($data_items[2]) > 0 ||
$game_party.item_number($data_items[3]) > 0
</hide eval>

Hides the skill if the party has any of the items 1, 2, or 3.

Use your imagination for the <hide eval> notetag.

And that’s all, folks!

47 comments on “Hide Menu Skills

  1. How about an eval function for the hide notetags. Like setting up a hash with text strings that you can eval, and then making a notetag like:

    Relaying the number that x gives to the text string contained inside a hash. Just a thought, would make things much more flexible for intermediate to advanced users.

  2. Need to get back into scripting but kinda have a bit of a wall since I need to find things like a list of the @actor.xyz items.

    unless @actor.states.include?(6)

    was curious if this would work or not.

  3. Hello, I just wondered if anyone knows the string for hiding abilities based on an actor’s subclass, I have been looking for it for a good little while (even taking a few wild stabs in the dark) but to no avail.

  4. I would like my game to hide skills unless a certain item is equipped. I tried doing
    @actor.equips.include?($data_armors[1])

    But that had the opposite effect of what I wanted, being it hid the skill if the item was equipped. I tried

    unless @actor.equips.include?($data_armors[1])

    and I got an error. I’ve tried a few more things but that’s the closest I came to getting it to work. Is there any way to do this that I’m missing?

    • Nobody’s answered my question here yet, but I think I might have figured yours out while messing around trying to do what I want. Try this:

      instead of unless, put a ‘!’ in front of the argument, like so:
      !@actor.equips.include?($data_armors[1])

      Hope this helps. I’m about to try and ask my question below again, hopefully in a way that might engender an answer from our Ruby Scripting Gods…

  5. Hello there, first off I’d like to say I deeply appreciate the work Yanfly has put into these scripts. You are my hero. That being said, I was hoping you (or other kind, knowledgeable people) could help me with a tweak I’d like to add to this script:

    I want to hide a skill when the actor can’t use it, but not to the all encompassing extent of the notetag “hide_until_usable” because that also hides a skill that you could use in battle when you’re out of battle if it’s a Battle Only skill.

    For example, I want a piece of equipment (a ring) to add a skill (Flame Slash), that also has an equipment requirement (Sword). So if the actor has the ring equipped but doesn’t have a sword equipped, Flame Slash will never show up in the skill menu.

    I used this: return false if item.hide_unusable_battle && !@actor.usable?(item) && $game_party.in_battle

    To my surprise it actually seemed to work! However as I feared only for showing or hiding the skill in battle depending on if it’s usable or not.

    If the Actor does have a sword equipped, I’d like it show up under the skill menu out of combat. I just can’t seem to puzzle out the right argument or whatever I need to put in to make that happen, so I’m hoping a pro can point out what I’m probably stupidly overlooking here.

    Sorry this is so long. I’m stupidly new at this scripting stuff and examining what something is doing and mimicking that with some tweaks is the limit of my abilities at the moment.

    Thanks in advance for any help with this!

  6. I kept poking at this, and thought maybe I should consider trying to figure out how to use the notetag. Using what Hamsterpirateninjas had posted before me I came up with this:

    !@actor.equips.include?($data_weapons[n])

    where n=is the weapon # obviously…

    This is getting closer, and I’m okay with specifying the exact weapon having to be equipped in order for the skill to NOT be hidden, but now I’m not sure how to have more than one possible requirement. I’m unsure of what I could put into that to indicate having a type of weapon equipped either.

    I tried:

    !@actor.equips.include?($data_weapons[n1, n2, n3])

    but it crashes, I also tried:

    !@actor.equips.include?($data_weapons[n1]) ||
    !@actor.equips.include?($data_weapons[n2])

    But it results in the skill being hidden still.
    Lastly I tried:

    !@actor.equips.include?($data_weapons[n1]) ||
    @actor.equips.include?($data_weapons[n2])

    This results in the skill correctly being shown when the actor has weapon(n1) equipped, but not when it has weapon (n2) equipped.

    Ugh, it’s late. Sorry for spam posting, I’ll try again tomorrow after I’ve slept. Maybe the RPG Maker VX Ace fairy will deliver the answer in my dreams…

  7. …something is missing from my posts…the (hide eval) and (/hide eval) opening and closings, which of course are really in arrow brackets and not paranthesis. How do you make them show up correctly in a posted comment?

  8. So, I’m going to try this again, maybe without as many words.
    Re: the hide eval notetag… I understand that

    @actor.equips.include?($data_weapons[n]

    will refer to specific weaponID, what I’d like to know is what should (or could) I replace “$data_weapons[n]” with to refer to weapon or armor “type_ID” (the ones that you create under “Terms” in the database)?

    Also, when using that particular evaluation string is there a separator or some operand you use when adding more strings that indicates “or” instead of “and”?

    • Yanfly is currently away so I’ll try to answer you. You could try something like this:

      For weapons:
      <hide_eval>
      @actor.equips.each {|i| i.is_a?(RPG::Weapon) && i.wtype_id == n}
      </hide_eval>

      For weapons:
      <hide_eval>
      @actor.equips.each {|i| i.is_a?(RPG::Armor) && i.atype_id == n}
      </hide_eval>

      I wrote this on the fly, so it’s untested. Oh, if it’s too long to fit, be sure to break after the &&.

  9. Thanks for replying Kread-EX, you’re definitely included in my “Scripting Gods”.

    I tried this and I couldn’t get it to work so first I thought I’d check and see if “too long to fit” referred to fitting on one line in the notetag? If that’s the case, there’s a forced break before the &&, so the && starts on a new line like this:
    @actor.equips.each {|i| i.is_a?(RPG::Weapon)
    && i.wtype_id == n}

    Would that make it not work?

      • This is what looks like in the notetag field:

        @actor.equips.each {|i| i.is_a?(RPG::Weapon)
        &&
        i.wtype_id == 4}

        There’s not enough room for the && to appear on the first line, and I don’t manually add a break until after the &&. It still doesn’t work like this either.

        Just so we’re on the same page, here’s my original example of what I’m trying to do:
        I want a piece of equipment (a ring) to add a skill (Flame Slash), that also has an equipment type requirement (Sword, etc.). So if the actor has the ring equipped but doesn’t have a weapon of type Sword, etc. equipped, Flame Slash won’t show up in the skill menu ever. I want to use this method instead of the default equipment requirement so that unusable skills are hidden.

        If you don’t want to be considered a god, then will you accept my respect and admiration? I’m not trying to butter you up either, I’m serious.

      • In that case, try to break it like this:
        @actor.equips.each {|i|
        i.is_a?(RPG::Weapon) &&
        i.wtype_id == 4}

        If it doesn’t work then it means the problem is elsewhere.

      • I pretty much just copied and pasted what you suggested. Sadly, that didn’t work either. T_T
        Going back to the most success I’ve had with this, which is:
        !@actor.equips.include?($data_weapons[n])
        I tried this again, but with &&

        !@actor.equips.include?($data_weapons[23])
        &&
        !@actor.equips.include?($data_weapons[25])

        and it worked, correctly showing the skill if the actor had weapon 23 or 25 equipped.

        Using this, I’ll have to specify weapons and armor individually rather than a type, but I guess I’ll have to deal with that.

      • I tried with various things and it doesn’t work even when the syntax is right. I guess it has to do with how eval() works internallly :/

    • if anyone’s still looking to make this work
      hide eval
      !@actor.weapons.any?
      {|weapon| weapon.wtype_id == 9 }
      /hide eval

      • Thanks Xypher, I think this is exactly what I was looking for. Maybe now I can move forward and continue designing things, because seriously, I’ve been dilly-dallying a LOT lately.

  10. Is it possible to use the script for when a certain character is in the party? For example, if Actor B is in the party, Actor A will be able to use the skill.

  11. I’m trying to hide a skill when another skill was learned, but I don’t get it to work. Any help is deeply appreciated.

  12. Hi! Anyone knows the string for hiding abilities based on an actor’s subclass?I’m searching in the comments along the blog but im not finding =/ i try some commands but no sucess until now.

    • I had the same problem and finally figured how to do it:

      first, you have to add this line to the class system script, after line 510 (class Game_actor…) and before alias game_actor_setup_cs…

      attr_reader :subclass_id

      with this line, you will add the attribute subclass to actor so it can be read.
      Then, in the notes, you can use @actor.subclass_id to be evaluated, like in this:

      ![X].include?(@actor.subclass_id)

      where X is the id of the subclass needed to see that skill

  13. It’s not possible to an entire Skill Type invisible during a fight? x: That way I could make a skill type called Passiv (for passiv skills/information, ex.: “Dual Wielder”, “Blacksmith”,..).. And during a battle, the skill type passiv will become invisible and so all the skills under it.. :s Mmh.. x.x Or is possible to do this without the use of this script? :o

    • Yanfly created “Battle Command List” script. You can set which skill type is visible during battle with this script.

  14. Does anyone know any possible way to lock a skill used by multiple classes. And then learn them at separate levels?

    Say if I had a Sage that learned Fire at lv 9, and then a Warlock that learned it at level 12, how would I go about this course of learning via eval?

  15. To build upon
    “hide eval
    i=$game_actors[actor b’s id];
    !$game_party.members.include?(i)
    /hide eval”

    Is it possible to add in there somewhere that a skill can only be used when Actor B is in the party and Actor B has learned skill X, that actor A will gain a skill?
    For an example, Steiners Magic Sword skills that require Vivi to be in the party, and to have learned a certain magic spell.

  16. is there a possibily to hide a skill when the actor has an other skill? (For Example: I have the Skill Lean System, if the Act learns “Skill II” ~ “Skill I” should be hide, because Skill II is a better version of Skill I.)

    ~Shiny

  17. How about a string that checks to see if an actor is in the Active Party?

    hide eval
    i=$game_actors[actor b’s id];
    !$game_party.members.include?(i)
    /hide eval

    This includes Reserve members. Could we check only those who are Actively participating in battles? I’ve tried stuff like $game_battlers and $game_battle.members.include but nothing so far has worked.

  18. Hi! I realize this is an outdated server (what with NV having been released), but I have a question. How would I make it so that a skill is hidden unless the character has an item equipped? I ask because I’m trying to build my class mechanic to work where skills require a certain item to be used. Each class has its own item, and a character can have a total of three class items at a time. However, I don’t necessarily want to put the skills on the class items themselves, as that would be a lot more work for something that wouldn’t work as well as I want.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s