Tsukihime 1,487 Posted May 12, 2012 (edited) FP: Item and Skill Restrictions Author: Tsukihime Type: Features add-on Overview You can specify required weapon types. Well, only 2, but not that bad. What about armors? What about more than two weapon types? What if a skill can only be used when you're in a certain state? Maybe you can only use a skill when you have a certain amount of money? Or your HP = 7777? This script allows you to specify usage requirements for all items and skills using a simple set of tags. Features The following apply to all item and skill usage Require specific armors to be equipped Require armor types to be equipped Require specific weapons to be equipped Require weapon types to be equipped Require state to be active to use skill Require equips (any, weapon, armor) to have a specific word in their name Require actor to be a certain class Require class name to have a specific word More to come. Look forward to stat requirements, which may be extended to say things like "HP < 5%", "HP = 7777", "atk > 300", etc. Usage In the skills tab in the database, you can tag skills that you want to have skill restrictions applied. If you want to say armor 3 must be equipped, you can type <fp:sr armor: 3> If you want to say armor type 5 must be equipped (small shields), you can type <fp:sr atype: 5> Same applies to weapons and wtypes. You can also require certain states to be in effect <fp:sr state 12> Note that the second colon is not necessary but may look pleasing. For the options that only ask for a series of numbers (eg: weapon ID, weapon type, etc), I've provided a shorthand for you. <fp:sr weapon 1,2,3,4,5> This means that if you have any of the specified weapons equipped, you can use the skill. Unfortunately there is currently no support for "AND" logic. So you can't say "weapon 1 AND 2 must be equipped" Download Script: http://db.tt/KIXl7Ebw You may want to include Equip restrictions in your project to have more control over your equips. Compatibility Well, it works with Ace Battle engine at least. Notes Looking at it again, this script is amazingly short and simple for what it does. Most of it is just me taking up a lot of lines just to define convenience methods. You could probably condense it down to 60 lines lol Edited May 13, 2012 by Tsukihime 2 Wren and AlliedG reacted to this Share this post Link to post Share on other sites
Tsukihime 1,487 Posted May 12, 2012 (edited) Additional restrictions have been added. -wtype: this type of weapon must be equipped to use the skill -weapon: this specific weapon (or weapons) must be equipped to use the skill -state: this state must be active to use this skill I'll add in the ability to specify the opposite as well so you can say things like "this weapon must not be equipped" "this state must not be active" etc One issue here is logical expressions. For example, if you want to say you want to have atype 1 AND atype2, that is not supported. Everything is currently logical OR, which is quite limited really. I mean, if you had a skill that can only be used when you have your "dragon set" which consists of "dragon shield" and "dragon mail" and "dragon boots" and "dragon hat" along with your "dragon sword", you can't do something like that yet. It is mainly a design issue: how do I know whether you meant all of them must be equipped, or any of them may be equipped? I am also considering just extending this to items as well since skills and items are pretty much the same things. Edited May 13, 2012 by Tsukihime Share this post Link to post Share on other sites
Galv 1,387 Posted May 13, 2012 Very useful script, Tsukihime - thanks. I'm using a lot of Yanfly's scripts and so far testing it out, it appears to be working with no problems. Share this post Link to post Share on other sites
Tsukihime 1,487 Posted May 13, 2012 (edited) Added a new restriction <fp:sr ename dragon> <fp:sr aname dragon> <fp:sr wname dragon> <fp:sr cname dragon> To use a skill, you must equip something that contains the specified word. Case-insensitive. Variations for weapon-only or armor-only as well. ename refers to both weapons and armors (convenience) and doesn't include class. So for example if you were equipping "dragon axe" you could use the skill that is assigned that tag, but if you don't have any "dragon" equips then you can't use it. It does not care if "Dragon" is part of another word (eg: "Pendragon") I've added support for classes as well. Now you can restrict skill/item usage to certain classes. The name support also goes for classes, so maybe anyone with the name "hunter" can use a certain gun skill. The script has been extended to items. Item usage must satisfy the same set of conditions if you choose to specify any. Edited May 13, 2012 by Tsukihime Share this post Link to post Share on other sites
Akrium 10 Posted May 13, 2012 Im using Yanfly's subclass system. Would there be any way to make this work so that skills can be restricted based on what class they currently chose to be? Share this post Link to post Share on other sites
Tsukihime 1,487 Posted May 13, 2012 (edited) I just grab the actorss current class and check whether they can use it or not so it shouldn't be a problem. Edited May 13, 2012 by Tsukihime Share this post Link to post Share on other sites
Aesorian 4 Posted June 10, 2012 Thanks for the awesome script Tsukihime, but I'm having problems getting it to work. I'm trying to run it in conjunction with your Skill Equips so that I use an item to learn a skill which I can then equip. But it never restricts the item to just 1 class. I've tried using both ctype and cname but nothings happening. Theres no error code but I can use the item on all charecters. Item + Code: Every Class can use the item: Scripts: Any help will be appriciated Share this post Link to post Share on other sites
Xypher 176 Posted June 10, 2012 Thanks for the awesome script Tsukihime, but I'm having problems getting it to work. I'm trying to run it in conjunction with your Skill Equips so that I use an item to learn a skill which I can then equip. But it never restricts the item to just 1 class. I've tried using both ctype and cname but nothings happening. Theres no error code but I can use the item on all charecters. Item + Code: Every Class can use the item: Scripts: Any help will be appriciated Isn't this script only for skills? Share this post Link to post Share on other sites
Tsukihime 1,487 Posted June 10, 2012 (edited) Should work for items. There's definitely an issue with class. And possibly a lot of other things. It seems to be only checking the first person when you actually use an item from the menu. Edited June 10, 2012 by Tsukihime Share this post Link to post Share on other sites
Runako 0 Posted April 1, 2013 Question about this script. Is it possible for a skill to require another skill before it is used? Exmaple: To use skill "Y", you must have learned skill "X" or Is it possible for a skill to require a certain item in inventory. Example: To use skill "Y", you must have item "X" in inventory. Share this post Link to post Share on other sites
Tsukihime 1,487 Posted April 1, 2013 I don't think so. When I wrote this script it was not very flexible and did not contain many restrictions. Whatever you see in the list is probably all it does Share this post Link to post Share on other sites
Maliki 33 Posted April 4, 2013 Great script! One request, though: I was hoping you could put in a way to read evaluation strings. I have a system where I want characters to learn skills by using items but can only learn/use them if variable based stats are of a high enough value. (Sometimes multiple variables per actor.) So maybe something checking target.actor.id (or whatever) and then checking the appropriate variables' value. Is that doable? Yanfly did a String evaluation with the Skill Restriction script (which this script will replace if I can get it to work correctly for me), but I have no idea how to implement it. Thanks in advance! Share this post Link to post Share on other sites
Tsukihime 1,487 Posted April 4, 2013 I have not investigated the issue thoroughly so can't give you an answer, but you may search for workarounds to achieve what you want. For example, this script allows you to place restrictions on skill learning Share this post Link to post Share on other sites
kejopo 0 Posted March 29, 2014 Hi, We're you able to add the stat requirements ? Share this post Link to post Share on other sites
ninjalex926 6 Posted March 31, 2014 Looks great! I might use it in my game. Share this post Link to post Share on other sites