Page 1 of 1
Tags. Add a tag to the actor.
Posted: Tue Nov 10, 2020 8:12 pm
by Adrian
I can see in Lua-API something about Tags.
Question:
Does the tags works with Dune2000 units?
What are these? I mean, the tags, in general.
It looks like infantry, at least, has no tag.
I see several function:
- bool AddTag(string tag) - Add a tag to the actor.
- bool HasTag(string tag)
- bool RemoveTag(string tag)
and so on...
Re: Tags. Add a tag to the actor.
Posted: Wed Nov 11, 2020 8:56 pm
by abcdefg30
Tags work on every actor type that has the "ScriptTags" trait. You may need to add that in D2k.
Re: Tags. Add a tag to the actor.
Posted: Thu Nov 12, 2020 7:41 pm
by Adrian
Would you like to explain me? What is the tag?
This is string. So I can write any text for some objects, right? Like label. Or something else?
Re: Tags. Add a tag to the actor.
Posted: Fri Nov 13, 2020 8:28 am
by abcdefg30
Yes, it is just a label, nothing more.
Re: Tags. Add a tag to the actor.
Posted: Wed Nov 18, 2020 9:43 pm
by Adrian
Thank you.
So I found that, by default, tags are off. And I need to write in Rules.yaml, for light infantry, for example :
Can I write text for tag
in yaml too?
I already found function
for Lua:
AddTag(string tag) - Add a tag to the actor.
Re: Tags. Add a tag to the actor.
Posted: Thu Nov 19, 2020 3:17 pm
by abcdefg30
Yes, you can add tags to individual actors in map.yaml like this:
https://github.com/OpenRA/OpenRA/blob/6 ... .yaml#L281
Re: Tags. Add a tag to the actor.
Posted: Thu Nov 19, 2020 3:55 pm
by Adrian
Thank you very much! It works.