Change Tag Attribute
921creative
Member, PRO Posts: 140
I am assuming you can change an actor's Tag attribute through the use of a rule, correct? Thereby, if I have an actor who collides with an object that's tagged with a specific tag, and then I change that object's tag through a rule, the actor will no longer collide with the object...correct? I tried this and the actor still collided. Is there a special way to change the Tag attribute?
Comments
cheers
I can't get an expression to retain an old tag and add to that …
but, just typing something in works
and the events initiated by a collision do not occur after that change in tags
seems to work flawlessly, in Preview
@};- MH
@};- MH
I have a TAG called FLAMING.
I can shoot things with my flame thrower, and anything that the fireballs touch go...
Change Attribute > self.Tags = Flaming
Then if anything else touches any actor that is FLAMING, then they also catch fire.
- Murray
I've figured out how to add tags to an actor that already has existing tags.
I have a wooden crate, with tags CRATES and HARD.
I have a rule, if overlap an actor containing tag FLAMING, then change attribute self.tags to CRATES HARD FLAMING
It works, if I use a TAB between each tag.
I made it so it isn't using an expression, it's just straight text in the right hand box.
Then I type the first tag, then press OPTION & TAB, type the second tag, press OPTION & TAB, then the third tag. Done!
For my purposes, I'm just explicitly specifying which tags the actor should have in each case.
But for those who are keen, you might find you can use expressions to add a new tag to existing tags. I'm imagining that you might be able to go...
Change Attribute self.tags to self.tag + " Flaming"
(where that's an OPTION & TAB before the new tag name)
Not sure how you would remove tags with an expression.
I'm so pleased and relieved to have got my hard-coded cases working, I'm just going to run away, and not try the expression-approach myself.
I was using something similar to this. Setting self.tag = "dead".
Basically wanted to stop all collisions once the actor was dead (changed the image).
In theory, things worked fine.
However, with further development and testing I came full circle back to this as a source of some horrible memory issues.
I started getting mystery, invisible actors spawning and blocking the shots fired from the avatar.
It might have had something to do with my spawn-pools to control actor spawn/destroys.
But now I am very reluctant to change any tag at run-time.
I would love to see some GS-documented use of this feature, as it would be great if I could change this data safely.
Yeah, I get the feeling it's not really a reliable way to do things.