Changing tags in runtime... or faking it somehow :-O
homelesswombat
Member Posts: 73
So I have an enemy actor that goes to "sleep" and "wakes up." When the player bumps the enemy it wakes up, then falls back to sleep after some time. The thing is that I want enemy actors to wake each other up when they bump into each other--but only when they are awake.
Therin lies the rub. I used to use two different actors, destroyed the sleeping actor then spawned the awake actor, and I did the same when the actor fell asleep. But with many actors of this type it's insanely processor heavy. So I combined the two actors in the name of optimization and this is the last thing I can't figure out. When I used two different actors, I used tags to let the sleeping actor "know" that the awake actor was awake. Now I want to do the same thing but with a single actor.
In short I want an actor to behave one way when a collision with another actor occurs, and I want it to behave another way when a collision occurs and the other actor has had a variable changed.
I could use game.attributes, but that only works with two instances of the actor. I need this system to be scaleable to handle multiple actors. I wish I could change tags in runtime, but that's no go. I fear I may have found the limits of GS with this one, making my game idea impossible.
Anyone with their ideas would be much appreciated, I've yet to have found such a challenging GS problem.
Therin lies the rub. I used to use two different actors, destroyed the sleeping actor then spawned the awake actor, and I did the same when the actor fell asleep. But with many actors of this type it's insanely processor heavy. So I combined the two actors in the name of optimization and this is the last thing I can't figure out. When I used two different actors, I used tags to let the sleeping actor "know" that the awake actor was awake. Now I want to do the same thing but with a single actor.
In short I want an actor to behave one way when a collision with another actor occurs, and I want it to behave another way when a collision occurs and the other actor has had a variable changed.
I could use game.attributes, but that only works with two instances of the actor. I need this system to be scaleable to handle multiple actors. I wish I could change tags in runtime, but that's no go. I fear I may have found the limits of GS with this one, making my game idea impossible.
Anyone with their ideas would be much appreciated, I've yet to have found such a challenging GS problem.
Comments
One of the things I learned about GameSalad... don't treat it like the real world. You're thinking that the monster should be a single actor with two tags. Instead, why not two actors with one tag each? If a monster gets bumped, destroy it and spawn the awake actor in its place.