Jump to content

[Help] Introduction to the Tag Function

Recommended Posts

As the title suggests, I'd like to know more about Tags, especially the vanilla ones as well as the modded ones.
I had been looking for a while but cant seem to find anything.
Can ya help? I'd like to know what Tags do exactly, also I'd like to know where I can find the vanilla code for the character traits that are done via the Tag function

Link to comment
Share on other sites

Tags don't do anything directly, they are markers so other entities know how to interact with them.

Example: spiders target entities that don't have a "monster" tag (with other restrictions). The Spiderhat grants its wearer a "monster" tag, which is how it prevents spiders from attacking them. When removing the hat, the tag is also removed, and spiders will be hostile again. However, there's Webber, who is supposed to always have a "monster" tag. He has a special tag "spiderwhisperer" (it's special because it's unique to him, nothing else), so when the Spiderhat is removed, the gameĀ checks whether the wearer has a "spiderwhisperer" tag and if they don't, then the "monster" tag is removed.

There are three basic tag functions: AddTag, RemoveTag and HasTag. Other functions like FindEntity, TheSim:FindEntities and similar are also important and rely heavily on tags.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...