I have yet another problem. And this time it is with triggers. I just can't find any function that returns how much "bounty" aka "kill resource" that is earned when a unit is killed.
Yeah, it looks like it isn't available as a unit type or unit property and the "player's property has changed" event doesn't seem to have a "how much" parameter. If you need to hack it, you could keep track of the player's current resource count and whenever that resource count changes, calculate the difference to find out how much was just earned. Or find an unused field that is available through unit type (supply? acceleration?) and duplicate all your kill resource data in that field.
Heyah!
I have yet another problem. And this time it is with triggers. I just can't find any function that returns how much "bounty" aka "kill resource" that is earned when a unit is killed.
Does anyone have an idea?
Yours sincerely, Ice_bane @ B.net EU
@Ice_bane: Go
Yeah, it looks like it isn't available as a unit type or unit property and the "player's property has changed" event doesn't seem to have a "how much" parameter. If you need to hack it, you could keep track of the player's current resource count and whenever that resource count changes, calculate the difference to find out how much was just earned. Or find an unused field that is available through unit type (supply? acceleration?) and duplicate all your kill resource data in that field.
Here's how I did it for my map. The thing about this is you have to set the amounts in the data editor for each unit.
EVENT
Unit - Any Unit Dies
CONDITIONS (Owner of (Triggering unit)) == Computer
ACTIONS
General - If (Conditions) then do (Actions) else do (Actions)
If
(Killing player) == 1
Then
Variable - Set Vespene Points = (Vespene Points + (Vespene cost of (Unit type of (Triggering unit)))
Variable - Set Mineral Points = (Mineral Points + (Mineral cost of (Unit type of (Triggering unit)))
Player - Modify player (Killing player) Minerals: Add Mineral Points
Player - Modify player (Killing player) Vespene: Add Vespene Points
Else
@ rougelike: @ d3operator:
Yeah that's what I did, I used the resource field. But I'll have a look at that comparing resource amounts when a resource changes for a player.