Okay, I have a trigger that kills any unit you select. I want you to get a mineral for every unit you kill. Currently, I have the event set as any unit dies. I know the modify player x's minerals: add 1. I just can't find anything to put in for x that locates which player killed the unit.
What method of killing the unit are you using? Pure triggers? You could add a line in the trigger you are using to kill the unit before the unit dies, and set a variable of the killing player using a variable array of integers.
Essentially, using the 'Player selects unit' event in conjunction with storing that player and the giving of the resources.
I see his issue. There is just "kill unit" and nothing like Deal damage from player or something.
Well create custom action
In action: parameter u unit
parameter p player
parameter x integer
action: kill u give player p x money
In you "kill trigger" with event "Player selects unit" do in actions
custom action(Selected unit, Triggering player)
I belive Selected unit is actually Unit group of Selected units so you may use "Unit from Unit Group(1, Selected Units) or do something like if player selects more than one you make Select unit (Unit from Unit Group(1, Selected Units)) and then run so it will prevent them from selecting multiple units at once
Okay, I have a trigger that kills any unit you select. I want you to get a mineral for every unit you kill. Currently, I have the event set as any unit dies. I know the modify player x's minerals: add 1. I just can't find anything to put in for x that locates which player killed the unit.
Thanks for your help!
What method of killing the unit are you using? Pure triggers? You could add a line in the trigger you are using to kill the unit before the unit dies, and set a variable of the killing player using a variable array of integers. Essentially, using the 'Player selects unit' event in conjunction with storing that player and the giving of the resources.
I see his issue. There is just "kill unit" and nothing like Deal damage from player or something. Well create custom action
In action:
parameter u unit
parameter p player
parameter x integer
action:
kill u
give player p x money
In you "kill trigger" with event "Player selects unit" do in actions
custom action(Selected unit, Triggering player)
I belive Selected unit is actually Unit group of Selected units so you may use "Unit from Unit Group(1, Selected Units)
or do something like if player selects more than one you make Select unit (Unit from Unit Group(1, Selected Units)) and then run so it will prevent them from selecting multiple units at once
Thanks everybody I got it working!