Download

UNREAL 4 - How to "set" a new tag without overriding existing tags?

Hi, my AI´s have several tags, for example:

0 = hello
1 = alive
2 = dead

My problem si that, i need to set a new tag for this AI´s through another BP, BUT… in this case, the only node i can use is “set tags” that has an array pin, if i choose to promote that pin to variable and inside this variable i add a new tag, perhaps “jump”, it replaces tag 0 by the new value “jump”…. meaning i loose tag 0 and sometimes i loose all tags, i guess since this variable has this “jump” tag at cero and also the array sets the tag at cero, it replaces tag cero in the AI´s. Then i must find a way, to decide this tag is set at 3 or 4, so i wont replace existing tags… i already tried by adding 3 tags without anything, then writing Jump for tag 4, to try to make “set tags” to write the jump tag to the fourth row…but not working.

What can i do?

When you use Set Tags, you’re replacing the entire tag array. Instead:

Get tags -> Set Array Element

or

Get tags -> Add Unique

The latter is probably better.

Thanks but Add Unique did not work, i guess it´s still deleating some of the tags, but also later, when the AI is destroyed (hidden in game) i need to remove this exact tag, if i make it work…how can i find it and remove it without affecting all other tags?

adduniquenot-working.png

I just gave it a quick test and it seems to be working fine. Not sure how you’re doing / testing it.

You can *Find *in any array, this returns an index, which you can then use to remove an array index - the bottom bit: