Tag Manager-Tsukihime
OverviewThe
Tag Manager provides a tagging system for your project.
It allows you to add arbitrary strings to your database objects.
A tag can represent anything. For example,
1. If you use words like "male" or "female", you can add a gender tag to your actors.
2. If you use words like "elf" or "human" or "dwarf" you can add a race tag to your actors.
3. If you use words like "soldier" or "monk" you can add a class tag to your classes.
Any objects' tags that are currently assigned to an actor (such as a class, or an equip, or a state) will be transferred to the actor. This means if the "Soldier" class had a tag called "soldier" and Eric was a soldier, then he will have the "soldier" tag as well.
In addition to tagging your objects, you can use these tags as a means of filtering objects through the use of "condition tags". These condition tags can be added to any database object, which allows you to effectively allow or prevent various things such as an actor trying to equip a weapon.
This tagging system provides an intuitive and easy way to assign tags and tag conditions to all database objects, and will serve as the foundation for all tag-based scripts in the future.
DownloadGet it at
Hime WorksUsageTo add an object tag, notetag the database object with
CODE
<tag: string1 string2 string3 ...>
Where each string is an arbitrary non-whitespace terminated sequence of characters (eg: male, female, dwarf, elf, blah, carrot)
You may have multiple object tags for a single object.
Working with conditionsTo add a condition tag, notetag the database object with
CODE
<tag_cond: tag1 tag2 ... >
Tag conditions are specified as logical exp<b></b>ressions.
Conditions of the form
CODE
<tag_cond: tag1 tag2 tag3 ... >
Mean that tag1 AND tag2 AND tag3 AND ... must all be satisfied.
Conditions of the form
CODE
<tag_cond: tag1>
<tag_cond: tag2>
Mean that the requirements are satisfied if tag1 OR tag2 are present.
You also have the NOT operator, which can be specified using the ! sign, as shown:
CODE
<tag_cond: !tag1>
Which means the condition is satisfied only if tag1 does NOT exist.
You can mix all three of the above operators to create all kinds of logical exp<b></b>ressions. For example
CODE
<tag_cond: male soldier !human>
<tag_cond: female monk elf>
This translates to
QUOTE
(male AND soldier AND NOT human) OR (female AND monk AND elf)
So if Eric is a male human with soldier class, he won't be able to equip a weapon that has this condition because he fails the "not human" condition.
On the other hand, if Natalie is a female elf with monk class, then she can equip it.
Additionally, if Terence is a male vampire with soldier class, he would be able to equip it as well because he is a male, he is a soldier, and he is not human.
This post has been edited by Tsukihime: Mar 19 2013, 10:19 AM