Lets say infestor casts mind control on a unit. And that unit triggers a trigger, and I need to find the caster who is mind controlling that unit. How do I find the original infestor who cast the mind control spell?
Very good question. I glanced over all the Galaxy functions related to behaviors, I don't think there's any function to return the owner of a behavior...
You could catch the "mind control" ability in the first place to register what player is casting it, perhaps registering some custom value on the target unit for later use. In data, you can access the caster of a behavior, but I can't really think of a good solution in triggers for this.
Lets say infestor casts mind control on a unit. And that unit triggers a trigger, and I need to find the caster who is mind controlling that unit. How do I find the original infestor who cast the mind control spell?
Very good question. I glanced over all the Galaxy functions related to behaviors, I don't think there's any function to return the owner of a behavior...
You could catch the "mind control" ability in the first place to register what player is casting it, perhaps registering some custom value on the target unit for later use. In data, you can access the caster of a behavior, but I can't really think of a good solution in triggers for this.
You need a hybrid for this.
First you need to create a blank behavior (buff)
You need to alter the ability such that it gives the caster the behavior.
You make the trigger search for that behavior.
I don't think that would work if you can ever have more than 2 "mind controls" active at any time.
Catching the ability and storing a custom value on the target unit to identify the casting player would work, it's kind of messy though...