Tsukihime 1,489 Posted October 27, 2012 (edited) This tag manager is very powerful when it comes to designing your database since you can classify objects anyway you want. It allows you to assign "tags" to objects. A tag is simply a single alphanumeric (A to Z, 0 to 9, some symbols) string with no spaces. Examples of tags include "sword" or "carrot" or "1000eyes". Any concept that you can imagine can be reduced to a set of tags that are used to describe the idea: You can use tags to describe an actor's gender ("male", "female") You can use tags to describe the rarity of an equip ("common", "rare") You can use tags to describe an actor's race ("human", "vampire", ... ) Once tags have been assigned, you can then assign "tag conditions", which are conditions that must be met in order for an item to be usable. For example, a "collar" might only be equippable by dogs, so you would include a condition that requires an actor to be a "dog" in order to equip it. Download Get it at Hime Works Usage We start with some basics concepts. A "tag object" is any ob ject that supports tags. The following objects support tags Actors Classes Skills Items Weapons Armors Enemies States Maps An actor's tags is the collection of all tags that are assigned to the actor, her current class, and any equips or states. Tagging objects Assign tags to tag objects using the note-tag <tag: x> <tag: x y> For strings x, y. You may have multiple tags in a single note-tag by separating them with a space Tag Conditions You can require items or skills to be usable by an actor only when all of the "tag conditions are met. Similarly, you can require weapons or armors to be equippable only when all tag conditions are met. Specify a tag condition using the note-tag <tag_cond: x> <tag_cond: x y> For strings x, y. All conditions are specified using three basic boolean operators: AND, OR, NOT. For example, "a AND b" means an actor must have both tags to meet the condition. "a OR b" means an actor must have at least one of the tags to meet the condition. "NOT a" means an actor must not have the tag to meet the condition. This script does not support parentheses matching, so you will have to use DeMorgan's laws to convert them into simpler statements that is recognized by the tag manager. a AND (b OR c) = (a AND) b or (a AND c) NOT (a AND = (NOT a) or (NOT This might be tricky at first if you are not familiar with boolean logic but it is not difficult to understand with practice. Map Conditions These are the same as tag conditions, except you use them to compare with the current map. Note-tag an object with <map_cond: x> <map_cond: x y> For some strings x, yYou will tag the map as usual with <tag: x> Map conditions are used when you require something to be true about the current map. For example, you might have items that are only usable on "world maps", and this is easily accomplished by adding a map condition for the item and tagging your maps appropriately. Edited March 31, 2015 by Tsukihime 2 Share this post Link to post Share on other sites
estriole 326 Posted November 2, 2012 i already understand how to tag database object. but how to use it in event conditional branch? example i have an event that could only accessed if the leader/battle members have the tag of "paladin" or how to access the object tags in script. example i have script that check how many people in the battle members that have tag "female" (yes famous suikoden 2 you have to bring all lady party beside the hero type ). Share this post Link to post Share on other sites
Tsukihime 1,489 Posted November 2, 2012 (edited) Game_Battler#tags Will return all of the tags that are assigned to the battler as an array. It is designed that way because you can easily use set operations and boolean logic to determine whether or not your actor(s) meet the requirements. So for example if you want an all "female" party, you just need to check that no actors in your party has a "male" tag, which can be done like ! $game_party.members.any? {|actor| actor.tags.include?("male")} For conditional branches you would probably just access it the same way as you would in a script. $game_party.leader.tags.include?("paladin") I believe all tags should be lower-case. Or at least, they should be... Edited November 2, 2012 by Tsukihime Share this post Link to post Share on other sites
estriole 326 Posted November 2, 2012 thanks for quick answer. this certainly will help a lot in eventing . Share this post Link to post Share on other sites
Kayzee 4,033 Posted November 3, 2012 (edited) Honestly I would convert tags to symbols (using .to_sym). That may speed things up. Don't know if it's really that important though. Edited November 3, 2012 by KilloZapit Share this post Link to post Share on other sites
Tsukihime 1,489 Posted March 7, 2013 (edited) The script has been updated.I have merged a bunch of plugins together. All concepts you can possibly imagine can be reduced to a set of tags and tag conditions. A string means nothing on its own; you give it meaning and context. Tag conditions can be added to items, skills, and equips. Items and skills can only be used on a target when the tag conditions have been met. Equips can only be equipped when the tag conditions have been met. Add tag conditions with the note-tag <tag_cond: x> <tag_cond: x y> For strings x and y Map objects are supported by the tag manager. Tag them as usual with <tag: x> <tag: x y> To specify a map condition, note-tag your objects with<map_cond: x> <map_cond: x y> There are two types of conditions: conjunctive and disjunctive.<tag_cond: a b> Is the same as saying "condition A and condition B" - both must be met <tag_cond: a> <tag_cond: b> Is the same as saying "condition A or condition B" - at least one of them must be met And of course negation <tag_cond: !a> Is the same as saying "NOT condition a" - must not be "a" Practice your boolean logic and De Morgan's laws a AND b a OR b NOT a NOT (a AND <=> (NOT a) OR (NOT NOT (a OR <=> (NOT a) AND (NOT Edited March 7, 2013 by Tsukihime Share this post Link to post Share on other sites
keridenes 0 Posted December 31, 2014 hi! I tried to tag my maps with "fire" where the player can use matches, but I can still use it on maps with no "fire" tag. then I tried to check within a common event for the tag with $game_map.map_id[0].has_tag?("fire") but it returned with an error that has_tag? is an undefinied method. how could I make it work? Share this post Link to post Share on other sites
Tsukihime 1,489 Posted January 1, 2015 (edited) $game_map.has_tag?("fire") is the proper way to check a map's tags. Tags themselves don't do anything. If you tag an item with "fire", then your item has a tag called "fire" If you want to require tag conditions to be met on the map, you will need to use a "map_cond" note-tag. Though, I looked at the script and there is no special handling for items being used from the party menu on the map. Add-ons will be required for your menu scene. EDIT: wait, nvm, now I remember. There's this add-on called "use condition" tags that is specifically meant for use conditions. http://himeworks.com/2013/11/use-condition-tags/ Edited January 1, 2015 by Tsukihime Share this post Link to post Share on other sites
keridenes 0 Posted January 1, 2015 thanks very much, it solved the problem! Share this post Link to post Share on other sites