I have a Create Unit effect on a behavior, and it's applied when the unit dies. The created unit is the same type of unit, and I want it to be created owned by the killing player - but under the Owner field in the effect, none of the options (source/target/neutral etc...) do that. How do I determine who the killing player is?
I have a Create Unit effect on a behavior, and it's applied when the unit dies. The created unit is the same type of unit, and I want it to be created owned by the killing player - but under the Owner field in the effect, none of the options (source/target/neutral etc...) do that. How do I determine who the killing player is?
If kills don't actually matter, I would opt to use a prevent death type behavior (see incapacitated behavior) on all the units and modify it so upon receiving fatal damage it applies a behavior that gives control to the killing player (see Neural Parasite behavior) and then a Modify Unit effect to set it's vitals back to maximum.
If they do matter, I would probably just use triggers.
Edit: wtf am I talking about, just make the create unit effect the Damage Reponse - Handled effect and Damage Response - Fatal enabled and the Spawn Owner - Value of the create unit effect be Target.
Also, make the Spawn Unit - None and the Target: Origin - Value be Source Unit if you want this one behavior to work for all units :)
After testing that, it sort of works... but it's creating the new starport at the point of the killing unit. Which option returns the point of the killed starport?
EDIT:: Could someone please just 'copy as text' a behavior, and the effect needed into this thread? They're really simple, only 3 or 4 fields need to be changed for each. I'm having a really hard time figuring it out on my own, and now I can't even get it back to sort of working as I changed something and can't remember where the change was. I re-did your suggestion above and I'm still missing something. Blarg.
After testing that, it sort of works... but it's creating the new starport at the point of the killing unit. Which option returns the point of the killed starport?
Target: Location - Value = Source Unit in your create unit effect.
This is what I have, and it's not working at all now... starports just die, no new unit is created. If this looks right to you, then I can post my behavior as well...
Here's the behavior. I have 2 starports on the map, one is for player 1 the other is for player 2, and they're both set to user. I then have a bunch of BC's placed that I use to kill the starports with to test. The Starport unit DOES have this as a behavior.
Okay I figured it out... in the Create Unit effect, the field Effect: Creation Options, i had to uncheck the Placement box... I would assume because it's trying to create the structure as the old one is being killed and the placement is blocked thus.
Thanks for all of your help! I'll prolly take a bunch of screenshots and make a tutorial for others if you don't mind.
I have a Create Unit effect on a behavior, and it's applied when the unit dies. The created unit is the same type of unit, and I want it to be created owned by the killing player - but under the Owner field in the effect, none of the options (source/target/neutral etc...) do that. How do I determine who the killing player is?
If kills don't actually matter, I would opt to use a prevent death type behavior (see incapacitated behavior) on all the units and modify it so upon receiving fatal damage it applies a behavior that gives control to the killing player (see Neural Parasite behavior) and then a Modify Unit effect to set it's vitals back to maximum.
If they do matter, I would probably just use triggers.
Edit: wtf am I talking about, just make the create unit effect the Damage Reponse - Handled effect and Damage Response - Fatal enabled and the Spawn Owner - Value of the create unit effect be Target.
Also, make the Spawn Unit - None and the Target: Origin - Value be Source Unit if you want this one behavior to work for all units :)
After testing that, it sort of works... but it's creating the new starport at the point of the killing unit. Which option returns the point of the killed starport?
EDIT:: Could someone please just 'copy as text' a behavior, and the effect needed into this thread? They're really simple, only 3 or 4 fields need to be changed for each. I'm having a really hard time figuring it out on my own, and now I can't even get it back to sort of working as I changed something and can't remember where the change was. I re-did your suggestion above and I'm still missing something. Blarg.
Target: Location - Value = Source Unit in your create unit effect.
@peranzormal: Go
This is what I have, and it's not working at all now... starports just die, no new unit is created. If this looks right to you, then I can post my behavior as well...
@playpong: Go
Looks fine. Post the behavior.
Could have sworn I answered this already.
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
@peranzormal: Go
Here's the behavior. I have 2 starports on the map, one is for player 1 the other is for player 2, and they're both set to user. I then have a bunch of BC's placed that I use to kill the starports with to test. The Starport unit DOES have this as a behavior.
@playpong: Go
Set chance to 1 :)
Okay I figured it out... in the Create Unit effect, the field Effect: Creation Options, i had to uncheck the Placement box... I would assume because it's trying to create the structure as the old one is being killed and the placement is blocked thus.
Thanks for all of your help! I'll prolly take a bunch of screenshots and make a tutorial for others if you don't mind.