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
m (Categorising.)
(Info about multiple tags)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{WrongTitle|[Tags]}}
 
{{WrongTitle|[Tags]}}
  
{{SideBar|Map-specific INI sections|Template:Mapping}}
+
{{MappingBar}}
  
Map Tags are responsible for telling the game about the [[Maps/Triggers|Triggers]] present on the map. ''Each trigger needs to be refered 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 [[AI/TeamTypes/Tag|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.).
+
Tags are responsible for telling the game about the [[Maps/Triggers|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. Linked triggers use its parent trigger's Tag. Tags can be simply placed in this section, and objects pre-placed on the map as well as [[AI/TeamTypes/Tag|teams]] 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.).
 +
 
 +
A single trigger can be referred to by multiple tags. For example, a trigger attached to another can have its own tag in addition to its parent trigger's tag. A trigger may also have tags with different [[#ts_PERSISTENCE|persistence states]].
  
 
__TOC__
 
__TOC__
{{clr}}
 
  
 
== Section ==
 
== Section ==
  
=== [[TD]]/[[CO]] ===
+
=== <span id="td"></span>{{td}} ===
  
=== [[RA]]/[[CS]]/[[AM]] ===
+
Section does not exist.
  
=== [[TS]]/[[FS]]/[[RA2]]/[[YR]] ===
+
=== <span id="ra"></span>{{ra}}, {{cs}}, {{am}} ===
 +
 
 +
Section does not exist.
 +
 
 +
=== <span id="ts"></span><span id="ra2"></span><span id="yr"></span>{{ts}}, {{fs}}, {{ra2}}, {{yr}} ===
  
 
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%" class="wikitable"
 
|+ Meanings of each string
 
|+ Meanings of each string
 
! style="width: 13em; " | String
 
! style="width: 13em; " | String
Line 26: Line 31:
 
|-
 
|-
 
! {{Anchor|ID|ts}}
 
! {{Anchor|ID|ts}}
| The Tag's ID. This is used to attach this Tag to other objects on the map.<br>
+
| The tag's ID. This is used to attach this tag to other objects on the map.<br>
;What can be achieved by attaching tags? : see <li>[[Maps/Events|Events]] and <li> [[Maps/Actions|Actions]]  
+
;What can be achieved by attaching tags? : see <ul><li>[[Events]] and</li><li>[[Actions]]</li></ul>
;How should tags be attached? : see <li>&#91;[[Maps/Structures#ts_ATTACHED_TAG|Structures]]], <li> &#91;[[Maps/Units#ts_ATTACHED_TAG|Units]], <li> &#91;[[Maps/Infantry#ts_ATTACHED_TAG|Infantry]]], <li> &#91;[[Maps/Aircraft#ts_ATTACHED_TAG|Aircraft]]] and <li> [TeamTypes] {{arr|r}} [[AI/TeamTypes/Tag|Tag]].
+
;How should tags be attached? : see <ul><li>[[CellTags]],</li><li>[[Structures_(maps)#ts_ATTACHED_TAG|Structures]],</li><li>[[Units_(maps)#ts_ATTACHED_TAG|Units]],</li><li>[[Infantry_(maps)#ts_ATTACHED_TAG|Infantry]],</li><li>[[Aircraft_(maps)#ts_ATTACHED_TAG|Aircraft]], and</li><li>[[TeamTypes]] {{arr|r}} [[Tag]]</li></ul>
 +
|-
 +
! {{Anchor|PERSISTENCE|ts}}
 +
| 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.
 +
{| style="width: 90%" class="wikitable"
 +
|+Applicable values
 +
|-
 +
!Value
 +
!Meaning
 +
!Description
 +
|-
 +
|0
 +
|Volatile
 +
|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.
 
|-
 
|-
! {{Anchor|REPEATING|ts}}
+
|1
| Can be set to {{Tt|2}} ('enabled') or any other value ('disabled'). Specifies whether this Tag is repeating - that is, can it notify its attached objects more than once.
+
|Semi-persistent
 +
|The tag 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
 +
|Persistent
 +
|The tag is never removed, and will continue to "spring" every time the trigger's conditions ([[events]]) are met.
 +
|}
 +
Map editors refer these as: 0 - OR one time, 1 - AND one time and 2 - OR repeating.
 +
 
 +
'''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}}
| A plain text string used as a name of this Tag. Not used ingame, only in the map editor. Should not contain commas.
+
| A plain text string used as a name of this tag. Not used ingame, only in the map editor. Should not contain commas.
 
|-
 
|-
 
! {{Anchor|TRIGGER_ID|ts}}
 
! {{Anchor|TRIGGER_ID|ts}}
| 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.
+
| 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 automatically when creating triggers in the Trigger Editor.
 
|}
 
|}
 +
 +
== Important Note ==
 +
{{W}} The hexadecimal prefix of a tag's ID (e.g. {{tt|02A2DA40}}) is used in pointer remapping during saving and loading. It should not be lower than {{tt|0x01000000}} to avoid conflicts with real pointers. In addition, it should not be shared by any [[TaskForces|TaskForce]] (local or global), else they will remap to the same pointer.
  
 
[[Category:Map Information]]
 
[[Category:Map Information]]

Latest revision as of 11:03, 31 January 2024

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


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. Linked triggers use its parent trigger's Tag. Tags can be simply placed in this section, and objects pre-placed on the map as well as teams 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.).

A single trigger can be referred to by multiple tags. For example, a trigger attached to another can have its own tag in addition to its parent trigger's tag. A trigger may also have tags with different persistence states.

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
How should tags be attached? 
see
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
Value Meaning Description
0 Volatile 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 Semi-persistent The tag 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 Persistent The tag is never removed, and will continue to "spring" every time the trigger's conditions (events) are met.

Map editors refer these as: 0 - OR one time, 1 - AND one time and 2 - OR repeating.

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 automatically when creating triggers in the Trigger Editor.

Important Note

Warning small.png The hexadecimal prefix of a tag's ID (e.g. 02A2DA40) is used in pointer remapping during saving and loading. It should not be lower than 0x01000000 to avoid conflicts with real pointers. In addition, it should not be shared by any TaskForce (local or global), else they will remap to the same pointer.