Teardown

Teardown

Tameable Dragon
Geneosis  [developer] Mar 21, 2023 @ 2:32pm
Tags FAQ
Introduction
If you had a look at the mod options, you probably noticed there is a few list of tags designating items that the dragon should treat a bit differently (by eating them or attacking them).

I will try to explain here a little bit more how that works for people who are not familiar with the Teardown modding system :)

What is a Tag?
So tags are basically a keyword devs and modders can add to an object so that it will be easier to find it back later in a script. You can think of it as a sort of hashtag to quickly find something or a way to share information about an object for other mods to read.

The only rule that I know to create a tag is that it must not contain spaces and no equal sign. Space is reserved to make list of tags, and equal is reserved to associate a value to a tag.

Where do I find tags?
When looking at the files of a mod (or of the main game) there is two places where you can find tags.
  • In the prefab files (fileName.xml)
  • In the script files (fineName.lua)

How do I find what tags are on a given object in front of me?
Sadly the modding API does not currently allow to list all the tags on an existing object, which makes this task impossible at the moment :/

The latest update (creative mode) added that feature \o/ So I updated my Debug Scanner so you can see the tags on any object by pointing your mouse at it ;)

How do I find tags in a prefab file?
Prefab files are files representing a 3D object that can be spwaned in the world of Teardown.
In prefab files you can find tags on pretty much any line in this form:
tags="tag1 tag2 tag3"
So here we have a list of 3 tags (tag1, tag2 and tag3), meaning scripts are able to find this object using any of those 3 tags.
Real code example:
<body pos="2.0 0.33 2.0" rot="-90" dynamic="true" tags="tameableDragon legBackLeft3"> <vox pos="2.0 -7.8 7.6" file="MOD/dragon/vox/Big_Left_Leg3.vox"/> </body>

How do I find tags in a script file?
Script files are codes that let mods interact with the world of Teardown.
In a script file you may find calls to one of the following functions related to tags: SetTag()/RemoveTag()/HasTag()/GetTagValue().
In those functions the tag is always the second parameter (eg: if you see GetTagValue(param1, param2, param3), the tag is param2).
If you are trying to find if a tag was added to a game object through script, you need to look only for the SetTag(handle, tag, value) function, as this is the only one able to change what tags are on an object.
Real code example:
SetTag(tailRotor, "broken") SetTag(door.shape, "ignoreDoor", 20)
These two lines does add a tag to two different objects.
The first one adds a tag "broken" to an object identified as tailRotor.
The second one adds a tag "ignoreDoor" to an object identified as door.shape and associate the value 20 to that tag.

How do I edit the tag lists in the mod options?
So the list in the options of this mod follows the same rules as in the prefab (kind of): you can add as many tags as you want to them, separated by spaces, the order does not matter.

Also note that the quotes (") are never parts of the tags, they are special characters of the scripts / file structures, so you must not keep then when adding tags to the lists in the options.

You can also remove any of the tags already present if you wish.

For each tag present in the Food tags list, the Dragons will consider any object with that tag as food and eventually try to eat it.

For each tag present in the Enemy tags list, the Dragons will consider any object with that tag as an enemy and attack it on sight.

For each tag present in the Ignored tags list, if the Dragons did find a object to target (hunt/attack) but that object also has a tag in the ingored list, then it will skip that object.
Last edited by Geneosis; Jun 15, 2023 @ 4:31pm
< >
Showing 1-2 of 2 comments
clone124642 Aug 2, 2023 @ 9:30am 
i know this is not turned on by default but what is the tag for mors longa NPCs so i can add them into the enemy list?
Geneosis  [developer] Aug 12, 2023 @ 8:48am 
Hmm I am not sure if they have a unique tag to them... You can check if you find one using the Debug Scanner on some of them... Else you can simply add "head" and "body" (without quotes) to the ignored tags, that should prevent it from attacking/eating most of the existing NPCs.
< >
Showing 1-2 of 2 comments
Per page: 1530 50