Tags are switch used to toggle standard functions ON/OFF (for you programmers, it's an array of booleans).
Various actions in your game can turn tags ON or OFF such as talking to an NPC, or picking up an item. Other things can be set to check a particular tag and only work depending on whether it's ON or OFF.
To name a few, you can make an NPC who will only appear if a certain tags is ON, an item that a shop will only sell if a particular tag is OFF, a door that leads to one place when a tag is ON and another if it is OFF.
This way it is possible to keep track of what events have already happened in your game and make changes accordingly.
Some types of tags are toggled true-false automatically, such as made to detect whether an item is in the inventory or equipped by the Hero. Others are manually set to ON/OFF using Text boxes or scripts.
There are two preexisting tags, 0 and 1, which are special.
Tag 0 True/ON is used for things that will always work without any condition, the same as not checking Tags; Tag 1 is always False/OFF, for anything you'd like to disable without removing entirely, such as features only used for play-testing your game.
All other tags, 2 through 15999 are user-defined, and can toggle between 0/ON and 1/OFF using various triggers throughout a game.
When the game starts all user-defined tags Begin as False/OFF.
You can assign names to your tags to help you remember what they each mean. For example, if tag 10 is ON while you have at least one potion in your inventory, and OFF when you are out of potions, you can name it "have potions". Or if tag 14 gets turned on after you talk to the King, you can name it "Spoke to King"
Tags are used to make conditional door links which can change in the middle of your game.
By default a new door link will not check any tags (seen as Require Tag 0=ON (Always)).
You may optionally specify two tags that must be checked before the door can be used. This allows you to make doors which are locked/unlocked or that lead to different places when a certain condition is met.
Using separate maps and altering a door link is usually much easier than attempting to manipulate a huge number of linked tags or write a script to modify the map.
Using Appear When... two tags can be checked to enable or disable an NPC on the map.
To have a tag change the appearance of an NPC place two different NPCs on the same tile (placed facing different directions), have one appear with Tag ON, and the other while the same tag is OFF. The game will start with the Tag OFF, and show this NPC first until the tag is changed.
NPCs can set tags indirectly, either using automatic Tags when the NPC is a vehicle or item, and also by summoning a Text Box with conditionals which sets tags manually or uses Choice option to set tags.
Items can have four types of automatically set tags:
Own Item - At least one of that item either equipped or in inventory.
Is in inventory - Only items in inventory, Equipped items are NOT considered part of the inventory.
Is equipped - Equipped by any character in the party, including inactive heroes.
Equipped by active hero Only currently equipped by the main Hero.
Items can not be modified by tags.
Use text boxes either with Choices or using Conditional: SETTAG to manually set tags.
All text Box conditionals are also Tag-dependent.
To check multiple tags chain several text boxes using the INSTEAD conditional. In the example below this is being used to dispense a particular item depending on an earlier choice by the Hero:
Text Box A INSTEAD: If Tag 5 = ON... use Text Box B instead, otherwise ... ITEM: Always do the following -give item A
Text Box B INSTEAD: If Tag 6 = ON ... use Text Box C instead. ITEM: Always do the following - give item B.
Text Box C ITEM: Always do the following - give Item C.
One-Time Use Tags
NPCs can be set as usable only once which also uses an automatic ON/OFF tag system, previously referred to as 'One-Time use tags'. To avoid confusion with standard tags, these special One-timers are no longer worded as tags, but rather Flags.
The number displayed next to the Usable onetime setting is the unique
tag ID number used for plotscripting purposes.
One-Time flags work automatically and can only be manipulated with scripts, therefore, if you are going to want to manually manipulate your one-time-use flags, you might want to use a regular tag instead:
Name a tag. Then make the NPC only appear if this tag is OFF. Then edit the text box which is displayed when you activate the NPC, and in the "conditionals" screen, make the tag turn ON. The NPC will remove itself when used.
When you use the usable only once NPC, all copies of that NPC definition will be removed from the map (because they all share the same ID number!), and the usable only once flag will be turned on. If you want different copies of the NPCs to disappear independently, you have two choices. Either create multiple NPC definitions, or use the delete NPC script command instead of tags.
Gallery of Tag Usage
- How do I make a NPCs say something different later?
- How do I make a key-locked Door?
- Conditional Door Links
- How do I randomly set a tag?
- How do I make choices in a dialogue box?