Tags. Add a tag to the actor.

Dune2000

Information and discussion for custom maps and mods.
Post Reply
Adrian
Posts: 73
Joined: Wed Feb 12, 2020 5:44 pm

Tags. Add a tag to the actor.

Post 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...

abcdefg30
Posts: 641
Joined: Mon Aug 18, 2014 6:00 pm

Re: Tags. Add a tag to the actor.

Post by abcdefg30 »

Tags work on every actor type that has the "ScriptTags" trait. You may need to add that in D2k.

Adrian
Posts: 73
Joined: Wed Feb 12, 2020 5:44 pm

Re: Tags. Add a tag to the actor.

Post 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?

abcdefg30
Posts: 641
Joined: Mon Aug 18, 2014 6:00 pm

Re: Tags. Add a tag to the actor.

Post by abcdefg30 »

Yes, it is just a label, nothing more.

Adrian
Posts: 73
Joined: Wed Feb 12, 2020 5:44 pm

Re: Tags. Add a tag to the actor.

Post 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 :

Code: Select all

light_inf:
	ScriptTags:
Can I write text for tag in yaml too?

I already found function for Lua:
AddTag(string tag) - Add a tag to the actor.

abcdefg30
Posts: 641
Joined: Mon Aug 18, 2014 6:00 pm

Re: Tags. Add a tag to the actor.

Post by abcdefg30 »

Yes, you can add tags to individual actors in map.yaml like this: https://github.com/OpenRA/OpenRA/blob/6 ... .yaml#L281

Adrian
Posts: 73
Joined: Wed Feb 12, 2020 5:44 pm

Re: Tags. Add a tag to the actor.

Post by Adrian »

Thank you very much! It works.

Post Reply