• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to base a trigger of owner of killing unit?

Status
Not open for further replies.
Level 6
Joined
Dec 9, 2014
Messages
176
So, I just need a way to make the event of a trigger be the triggering player as the one who killed rather than the player who's unit was killed. I'm trying to make it so that if a certain unit is killed, then the player that did the killing get's an effect specific to them. I fiddled with stuff for a bit but couldn't figure out how to do this. Basically, it's a when x player kills x unit, then change ownership of y unit to x player. Any help is much appreciated.
 
Level 6
Joined
Dec 9, 2014
Messages
176
I think I read it four times without understanding.

This is my best guess.

If we have the event:
A unit dies

You want to use the owner of the killing unit.

In which case, just use "owner of killing unit"

I couldn't find that condition anywhere. I'll look again real quick.
 
Level 6
Joined
Dec 9, 2014
Messages
176
If you select player comparison this is the default:
  • (Owner of (Triggering unit)) Equal to Player 1 (Red)
just change to killing unit

Okay cool that worked. I was looking in unit comparisons. Now I just gotta figure out why this shredder, when owned by Neutral, is unable to return lumber to the Neutral resource return building but has no problem when owned by the player.
 
Level 6
Joined
Dec 9, 2014
Messages
176
Possibly hard coded, certain gather abilities only work for certain townhalls.
@Dr Super Good might have more knowledge about this.
Well, just to make it easy, I just took the human town hall, copied it, changed the model to something else and then gave ownership to neutral. This worked fine for the neutral workers but the Shredder doesn't seem to like it for some reason.
 
Level 6
Joined
Jul 8, 2018
Messages
129
Okay cool that worked. I was looking in unit comparisons. Now I just gotta figure out why this shredder, when owned by Neutral, is unable to return lumber to the Neutral resource return building but has no problem when owned by the player.

Could possibly be that one is owned by neutral passive and the other by neutral hostile. The shredder itself may be hardcoded some reason to do this or the harvest ability it uses is hard coded against it for whatever reason. You could possibly try copying a normal build and changing it to look like a shredder with same carry capic and see how it works.
 
Status
Not open for further replies.
Top