ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Difference between revisions of "Tags"

From ModEnc
Jump to: navigation, search
(Tags repeat case correction)
(Per RA1 source code and evidence from FinalAlert.)
Line 21: Line 21:
 
The [{{Tt|Tags}}] section in a map takes this format:
 
The [{{Tt|Tags}}] section in a map takes this format:
  
  ID=REPEATING,NAME,TRIGGER_ID
+
  ID=PERSISTENCE,NAME,TRIGGER_ID
  
 
{| style="width: 80%" border=1 class="table_descrowdesccol"
 
{| style="width: 80%" border=1 class="table_descrowdesccol"
Line 33: Line 33:
 
;How should tags be attached? : see <li>&#91;[[Structures#ts_ATTACHED_TAG|Structures]]], <li> &#91;[[Units#ts_ATTACHED_TAG|Units]], <li> &#91;[[Infantry#ts_ATTACHED_TAG|Infantry]]], <li> &#91;[[Aircraft#ts_ATTACHED_TAG|Aircraft]]] and <li> [TeamTypes] {{arr|r}} [[Tag]].
 
;How should tags be attached? : see <li>&#91;[[Structures#ts_ATTACHED_TAG|Structures]]], <li> &#91;[[Units#ts_ATTACHED_TAG|Units]], <li> &#91;[[Infantry#ts_ATTACHED_TAG|Infantry]]], <li> &#91;[[Aircraft#ts_ATTACHED_TAG|Aircraft]]] and <li> [TeamTypes] {{arr|r}} [[Tag]].
 
|-
 
|-
! {{Anchor|REPEATING|ts}}
+
! {{Anchor|PERSISTENCE|ts}}
| Can have values 0, 1 or 2:<br>
+
| This flag controls if and when the tag should be removed after being triggered. Once a tag has been removed, it cannot be triggered again. Applicable values are:
0 - Any of the associated objects - OR operator - one time<br>
+
* 0 = the tag is removed immediately when triggered. If the tag is attached to multiple objects, it's enough to "trip" any one of them to fire the attached trigger.
1 - When all of the associated objects - AND operator - one time<br>
+
* 1 = the tag is semi-persistent; it maintains a count of all objects it's attached to, and only actually "springs" after it's been triggered from all the objects; then, it removes itself.
2 - Any of the associated objects - OR operator - repeat<br>
+
* 2 = the tag is fully persistent; it just won't go away.
  
Tags could be associated with more than one objects, in such cases 0/1 can be used for any or all of them cases to activate this tag for one time. For example in case of 1, means activate this Tag one time when all the associated buildings having this TagID are destroyed, whereas a 0 would mean activate this Tag one time when any of those associated buildings get destroyed. By using 2, this Tag will not stop after one time, it will be triggered repeatedly. There is no AND operator for repeat or 3.
+
'''Example:''' a trigger will spring when attached buildings are destroyed:
 +
* {{tt|0}} fires the trigger once when ''any'' of the tagged buildings is destroyed, and never again.
 +
* {{tt|1}} fires the trigger once when ''all'' tagged buildings are destroyed.
 +
* {{tt|2}} fires the trigger ''every time'' a tagged building is destroyed.
 
|-
 
|-
 
! {{Anchor|NAME|ts}}
 
! {{Anchor|NAME|ts}}

Revision as of 15:47, 14 September 2022

This page should correctly be named "[Tags]"; it is wrong due to technical restrictions.


Map Tags are responsible for telling the game about the Triggers present on the map. Each trigger needs to be referred to by at least one tag to be considered "existant" by the game, even if the tag isn't attached to anything and thus never used itself. Tags can be simply placed in this section, and objects pre-placed on the map as well as TeamTypes can refer to the tags for additional functionality - if they do, those specific tags and their respective Triggers will be notified when the objects referring to them are somehow interacted with (detected, attacked, damaged, destroyed, etc.).

Section

Tiberian Dawn

Section does not exist.

Red Alert, Counterstrike, Aftermath

Section does not exist.

Tiberian Sun, Firestorm, Red Alert 2, Yuri's Revenge

The [Tags] section in a map takes this format:

ID=PERSISTENCE,NAME,TRIGGER_ID
Meanings of each string
String Meaning
ID The Tag's ID. This is used to attach this Tag to other objects on the map.
What can be achieved by attaching tags? 
see
  • Events and
  • Actions
  • How should tags be attached? 
    see
  • [Structures],
  • [Units,
  • [Infantry],
  • [Aircraft] and
  • [TeamTypes] → Tag.
  • PERSISTENCE This flag controls if and when the tag should be removed after being triggered. Once a tag has been removed, it cannot be triggered again. Applicable values are:
    • 0 = the tag is removed immediately when triggered. If the tag is attached to multiple objects, it's enough to "trip" any one of them to fire the attached trigger.
    • 1 = the tag is semi-persistent; it maintains a count of all objects it's attached to, and only actually "springs" after it's been triggered from all the objects; then, it removes itself.
    • 2 = the tag is fully persistent; it just won't go away.

    Example: a trigger will spring when attached buildings are destroyed:

    • 0 fires the trigger once when any of the tagged buildings is destroyed, and never again.
    • 1 fires the trigger once when all tagged buildings are destroyed.
    • 2 fires the trigger every time a tagged building is destroyed.
    NAME A plain text string used as a name of this Tag. Not used ingame, only in the map editor. Should not contain commas.
    TRIGGER_ID Reference to the Trigger related to this Tag. Again, each Trigger needs to be refered to by at least one Tag or it will not work. FinalSun and FinalAlert 2 create tags for you when you press "Place on map" in the Trigger Editor.