When I use this trigger to recreate a structure if it's killed, and give the ownership of it to the killing player, there are rare times when nothing is spawned at all. The only thing I can think of that's going wrong is it's not able to determine where the point of "triggering unit" is when it comes time to create it because it's already dead? I dunno tho because it works like 99% of the time. Any ideas? Or a better way to do it?
Can two different units die at the same instant? In which case, maybe that's the problem?
I would, in my opinion, opt for a data solution to this as it would be much cleaner. But, to answer your question, yeah dealing with global variables is a problem when things happen synchronously (like two units dying at the exact same time) and you don't have any mutual exclusion protecting those variables.
Woah I can do this through the data editor? lol - how?
Well, assuming you are a bit familiar with it all you would need to do is give these buildings something similar to the Hero Incapacitated behavior (that makes it so they don't actually ever die and instead use an effect upon receiving fatal damage) and have that effect be applying behavior which transfers ownership of the unit, like neural parasite does.
I propose doing some tests where you put in a Text Message for when certain parts are triggered. So If the unit dies put "Unit Died!" and then "Create Unit" to say when the create unit trigger is triggered.
The other thing is to make up some "eye in the sky" triggers. So when ever you have a situation where the buildings should work, you have a trigger that will watch the situation and tell you if it doesn't work.
That way you can get information about what's going on in the triggers as you play it. It's like telling you if the trigger itself is not being triggered of if there is a part that is being triggered and it's screwed up because of something else.
I think in the Data section, it's the Actors associated with the unit. You go into them and look at the assets I think. That's where I found a bunch of stuff on how infestor eggs mutate into Infested terrans. On death, mutate into infested terran.
Something like that.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
When I use this trigger to recreate a structure if it's killed, and give the ownership of it to the killing player, there are rare times when nothing is spawned at all. The only thing I can think of that's going wrong is it's not able to determine where the point of "triggering unit" is when it comes time to create it because it's already dead? I dunno tho because it works like 99% of the time. Any ideas? Or a better way to do it?
@Trieva: Go
Err... I used that in the above code.
Can two different units die at the same instant? In which case, maybe that's the problem?
I would, in my opinion, opt for a data solution to this as it would be much cleaner. But, to answer your question, yeah dealing with global variables is a problem when things happen synchronously (like two units dying at the exact same time) and you don't have any mutual exclusion protecting those variables.
@peranzormal: Go
Woah I can do this through the data editor? lol - how?
Well, assuming you are a bit familiar with it all you would need to do is give these buildings something similar to the Hero Incapacitated behavior (that makes it so they don't actually ever die and instead use an effect upon receiving fatal damage) and have that effect be applying behavior which transfers ownership of the unit, like neural parasite does.
@peranzormal: Go
I propose doing some tests where you put in a Text Message for when certain parts are triggered. So If the unit dies put "Unit Died!" and then "Create Unit" to say when the create unit trigger is triggered.
The other thing is to make up some "eye in the sky" triggers. So when ever you have a situation where the buildings should work, you have a trigger that will watch the situation and tell you if it doesn't work.
That way you can get information about what's going on in the triggers as you play it. It's like telling you if the trigger itself is not being triggered of if there is a part that is being triggered and it's screwed up because of something else.
@stevehammon: Go
I think in the Data section, it's the Actors associated with the unit. You go into them and look at the assets I think. That's where I found a bunch of stuff on how infestor eggs mutate into Infested terrans. On death, mutate into infested terran.
Something like that.