I have a very precious custom resource on my map. Just a few units of it can unlock a very powerful upgrade, and there are a grand total of 13 units available on the entire map. I would like to avoid these precious resources being destroyed if, for example, the harvesting SCV gets killed on its way back to the drop-off point. So I created an item that drops from the SCV as loot and can be re-harvested for the same precious resource. Obviously, however, I only want it to drop when the SCV is actually carrying this resource, so I've been trying to make a Validator that checks the SCV for the "Carry Resource" behavior; the one that for Minerals or Vespene gives the SCV the little mineral shard or gas container model as it carries it back to the drop-off.
However, I can't get it to work. Without the Validator a killed SCV will drop the resource item just fine; with it, it won't drop it at all, even when carrying the resource back to base. The Validator is a "Unit Compare Behavior Count" which checks to see if the number of the Carry Resource Behavior is equal to or greater than 1. I know this type of Validator should work, because I use a similar one on an Ability to check whether it will auto-cast on a target or not. But I can't seem to point [i]this[/i] Validator at the SCV that is dying and dropping the loot.
I've tried every possible setting for the "Validator - Unit +" field, which should determine which unit the Validator checks. Caster, Outer, Source, Target, Unit Origin; none of them work.
Does anyone know what I'm doing wrong here?
Edit: HA! As I was writing this post I thought of a workaround, and it works!
Instead of the unit dropping the item as loot, the BEHAVIOR creates it instead. I made a "Create Unit" Effect and had the Carry Resource Behavior execute it as a Damage Response when the unit with that Behavior took Fatal damage. Set the Create Unit Effect's location to Source Unit and it works perfectly! Behaves just as if it were a Loot drop, but ONLY when the SCV is carrying the resource back to base.
I have a very precious custom resource on my map. Just a few units of it can unlock a very powerful upgrade, and there are a grand total of 13 units available on the entire map. I would like to avoid these precious resources being destroyed if, for example, the harvesting SCV gets killed on its way back to the drop-off point. So I created an item that drops from the SCV as loot and can be re-harvested for the same precious resource. Obviously, however, I only want it to drop when the SCV is actually carrying this resource, so I've been trying to make a Validator that checks the SCV for the "Carry Resource" behavior; the one that for Minerals or Vespene gives the SCV the little mineral shard or gas container model as it carries it back to the drop-off.
However, I can't get it to work. Without the Validator a killed SCV will drop the resource item just fine; with it, it won't drop it at all, even when carrying the resource back to base. The Validator is a "Unit Compare Behavior Count" which checks to see if the number of the Carry Resource Behavior is equal to or greater than 1. I know this type of Validator should work, because I use a similar one on an Ability to check whether it will auto-cast on a target or not. But I can't seem to point [i]this[/i] Validator at the SCV that is dying and dropping the loot.
I've tried every possible setting for the "Validator - Unit +" field, which should determine which unit the Validator checks. Caster, Outer, Source, Target, Unit Origin; none of them work.
Does anyone know what I'm doing wrong here?
Edit: HA! As I was writing this post I thought of a workaround, and it works!
Instead of the unit dropping the item as loot, the BEHAVIOR creates it instead. I made a "Create Unit" Effect and had the Carry Resource Behavior execute it as a Damage Response when the unit with that Behavior took Fatal damage. Set the Create Unit Effect's location to Source Unit and it works perfectly! Behaves just as if it were a Loot drop, but ONLY when the SCV is carrying the resource back to base.