Tag Manager

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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 have an effect on the target only when the target has the required tags. 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.Accessing tags

Sometimes you would like to explicitly check whether tags exist in your events or other scripts.

You can do this by accessing the `tags` property that is exposed by all Tag Objects.

For example, to access the first actor's tags, you would say

Code:
$game_actors[1].tags
This will return all of the tags that are currently assigned to actor 1.
 
Last edited by a moderator:

hyde9318

RMC Coordinator
Veteran
Joined
Apr 1, 2012
Messages
2,593
Reaction score
680
First Language
English
Primarily Uses
RMMV
Taking the tag cloud idea and putting it into Ace. Impressive. I can see this making for some cool and complicated systems. Good work.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Yes the tag clouds are a pretty nice concept. I really like how you could just click on a tag and then it displays all relevant posts. And only those posts.

A tag and a feature are very similar, except a tag is just a word whereas a feature is like a code that gives you nice bonuses. And rainbow slime.

Naturally, features can also check for tags and consequently only apply to objects with those tags......and I think when you combine the two together, and possibly with effects, you can get a lot of stuff. Well, my main motivations for introducing the tag system was

1: allow users to create their own tags without having to write code

2: allow users to specify their own conditions without having to write code

3: and most importantly save everyone time from having to write code just for the sake of saying "this guy is male". Haven't seen a script that allows you to say "this guy is human" though.
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,309
Reaction score
531
First Language
indonesian
i do made script that allow me to say "this guy is human/elf/dwarf/etc" :D . but i use it for my personal use. i guess i will switch to this instead :D .
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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 
Code:
<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"This script does not support parentheses matching, so you will have to use DeMorgan's laws to break them into simpler statements that is recognized by the tag manager.

Practice your boolean logic and De Morgan's laws

a AND b

a OR b

NOT a

NOT (a AND B) <=> (NOT a) OR (NOT B)

NOT (a OR B) <=> (NOT a) AND (NOT B)

a AND (b OR c) <=> (a AND B) OR (a AND c)
 
Last edited by a moderator:

Internetakias

RPG Maker VX Ace Noob :P
Member
Joined
Aug 26, 2012
Messages
67
Reaction score
8
First Language
Greek
Primarily Uses
Would be nice if there was a condition branch scriptlet that checked if x or variable containing the id of an item/actor/class was equal to the specified tag:

For example ,such a scriptlet could be used for a starving man event that can only accept items tagged with "food".
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Can you provide an example of how you would set it up I am not sure what you mean.
 
Last edited by a moderator:

Internetakias

RPG Maker VX Ace Noob :P
Member
Joined
Aug 26, 2012
Messages
67
Reaction score
8
First Language
Greek
Primarily Uses
Can you provide an example of how you would set it up I am not sure what you mean.
Like:

Conditional Branch: Script: is_tag.item/weapon/skill/whatever[id] = "tag"?
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Sorry saw the post on phone so couldn't test it, and then forgot about it.

That is already supported, since the tags are publicly available.

Use the script call

obj.tags.include?("your tag")For some valid database object.

eg:

$game_party.leader.weapons[0].tags.include?("holy")Will check whether the party leader's first weapon has the "holy" tag.
 
Last edited by a moderator:

Internetakias

RPG Maker VX Ace Noob :P
Member
Joined
Aug 26, 2012
Messages
67
Reaction score
8
First Language
Greek
Primarily Uses
Sorry saw the post on phone so couldn't test it, and then forgot about it.

That is already supported, since the tags are publicly available.

Use the script call

obj.tags.include?("your tag")For some valid database object.

eg:

$game_party.leader.weapons[0].tags.include?("holy")Will check whether the party leader's first weapon has the "holy" tag.
Oh, thanks!
 

Zentsuki

Story teller
Veteran
Joined
Mar 14, 2015
Messages
109
Reaction score
18
First Language
French
Primarily Uses
Hello! Trying to make the most out of this script. I think I can see many possibilities on how to make it useful. One question though... can this be used in the damage formula?

Not sure if worded right but for example...

if b.tags.include("human"); 99999; else; 100; end
 

Golden Fish Entertainment

Last Man Standing
Veteran
Joined
Oct 18, 2013
Messages
92
Reaction score
13
First Language
English
Primarily Uses
N/A
Can this plugin work without issues in RPG Maker MV? I had thought I read that this functionality was part of the base program now, but I can't find anything that says so now...I may just be crazy ;P
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
@Golden Fish Entertainment
this is a script for Ace, not a plugin - check which area of the forum it is posted in.

And yes, MV now has the meta function to check for notetags (it is described in its help file), but that function didn't exist on Ace...
 

Golden Fish Entertainment

Last Man Standing
Veteran
Joined
Oct 18, 2013
Messages
92
Reaction score
13
First Language
English
Primarily Uses
N/A
Sorry..."script", not "plugin"

I remembered that Hime had made the script available for VXAce, but I didn't know if it had been standardized for MV...figured this would be the most likely place to get a response :/

As always, I appreciate your patience with my poor post placement, and I thank you for the help! :D
 

JamesOfJames

Warper
Member
Joined
Mar 4, 2013
Messages
4
Reaction score
1
First Language
English
Primarily Uses
Just a late-coming note for anyone who may experience the problem I just hunted down.

If your .tags.include?("someTag") seems to be returning false negatives - not finding tags you're sure are there - it seems that this script is case-sensitive and wants only lower-case characters. Thus, a script to find .tags.include?("someTag") is in fact looking for exactly "sometag", and will not find an item tagged using any capital letters.
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
Looks like you could just remove all instances of .downcase to get case-sensitive tags.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top