So, I have a unit that can spawn a max of 2 of a unit type. Basically, what I want to do is make it so when the unit that spawned this unit dies, the unit will turn neutral and if an enemy or ally walks up to it, it is given to that player. How would I do this? If possible, I'd also like that unit to be able to continue forever, no matter how many ownership changes it goes through.
The ownership change between players is simple, just use the interact ability like used by the Xel'Naga tower. Only way I can think of the turn neutral when host unit dies without using triggers is to have an on death response handled behaviour on the host unit that applies a search area effect with an issue order that targets a specific neutral dummy unit (set by filters and what unit is known as) which then applies a mind control behaviour that is applied to the spawned units if orphaned. The set orphaned can probably be done using a buff behaviour that is applied along with the unit spawn and a validator that deactivates it if the host unit (caster) dies.
I am not 100% sure this will work but it is worth a try.
So, I have a unit that can spawn a max of 2 of a unit type. Basically, what I want to do is make it so when the unit that spawned this unit dies, the unit will turn neutral and if an enemy or ally walks up to it, it is given to that player. How would I do this? If possible, I'd also like that unit to be able to continue forever, no matter how many ownership changes it goes through.
The ownership change between players is simple, just use the interact ability like used by the Xel'Naga tower. Only way I can think of the turn neutral when host unit dies without using triggers is to have an on death response handled behaviour on the host unit that applies a search area effect with an issue order that targets a specific neutral dummy unit (set by filters and what unit is known as) which then applies a mind control behaviour that is applied to the spawned units if orphaned. The set orphaned can probably be done using a buff behaviour that is applied along with the unit spawn and a validator that deactivates it if the host unit (caster) dies.
I am not 100% sure this will work but it is worth a try.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg