Been having trouble with getting an effect to occur when my unit kills something.
I want it so when a player unit kills an enemy they get a bounty reward, I want this upgradable on an individual player basis so I didn't simply use resources on kill for the enemy units as with regular kill rewards.
So I created a behavior with a damage response for the attacker on fatal damage. These are all the fields I modified.
And the effect is a modify player effect with target
(Basic) Effect: Player + (None):Target
I have tried every variation of location and fatal on/off for the behavior and it still doesn't seem to work, if anyone with more expertise in the editor could help I would be very grateful, I would prefer to fix this in data unless I must do it in triggers.
Damage Response is called when the unit takes damage, not when it deals damage to another unit. You can use upgrades to achieve what you want more simply. Upgrades are player to player basis.
Hmm, I thought I saw that you could use damage response for either based on location, I guess not. Could you clarify on what you mean by increasing bounty through upgrades?
I know upgrades are player independent but I do not know a way to increase a ai enemy player's unit kill resource with an upgrade the player bought(without triggers).
Basically I want the player hero to be able to upgrade how much money he earns from killing units.
A no go on making upgrades affect other player's units. While possible, it's just a mess and there are simpler ways of going about it. See, I'm under the assumption that you don't want the unit to give you resources every time you kill something else, but you DO want units you kill to give you resources and the amount is dependent on the unit? Upgrades would affect each AI unit's bounty individually, but it would be the AI's upgrade. Most likely you'll have to use triggers to issue the order to the AI every time you use an ability set do to nothing. While issuing the order, have it deduct the necessary minerals from you.
I actually want a set amount based on how much you upgrade so the unit would give you it, the upgrade increases vespene drop and I also have units give a varying amount of minerals based on their level.
Well I wouldn't go with that option since it makes the upgrades global for each player killing that ai, I see two options available, a behavior applied with the weapon which gives vespene if the unit with the behavior is killed or a trigger that modifies player property when they kill a unit.
Trying to decide which one is better but I'm surprised they don't have a effect on kill field for units or behaviors.
I meant an effect for when the unit modified makes a kill, I just ended up going with a triggering solution.
And I decided to base vespene earned on unit mineral bounty times your upgrade and a constant.
Events
Unit - Any Unit dies
Local Variables
Conditions
(Triggering player) == 7
Actions
Player - Modify player (Killing player) Vespene: Add (Integer({((Integer(((Triggering unit) Bounty (Minerals) (Current))))*Vespene Extraction[(Killing player)])/5}))
Thank you for your help.
Don't know why Preserver says it is only for taking damage. Location: Attacker is a totally useful part of the damage response, and you can use it to do all kinds of things on attack/spell damage.
The only downside is that the combination of Location: Attacker and Fatal does not work, for reasons unknown.
Been having trouble with getting an effect to occur when my unit kills something.
I want it so when a player unit kills an enemy they get a bounty reward, I want this upgradable on an individual player basis so I didn't simply use resources on kill for the enemy units as with regular kill rewards.
So I created a behavior with a damage response for the attacker on fatal damage. These are all the fields I modified.
Combat: Chance 1
Combat: Fatal Enabled
Combat: Handled (Eco) - Bonus Bounty
Combat: Location Attacker
And the effect is a modify player effect with target
(Basic) Effect: Player + (None):Target
I have tried every variation of location and fatal on/off for the behavior and it still doesn't seem to work, if anyone with more expertise in the editor could help I would be very grateful, I would prefer to fix this in data unless I must do it in triggers.
@Aaternus: Go
Damage Response is called when the unit takes damage, not when it deals damage to another unit. You can use upgrades to achieve what you want more simply. Upgrades are player to player basis.
Hmm, I thought I saw that you could use damage response for either based on location, I guess not. Could you clarify on what you mean by increasing bounty through upgrades?
I know upgrades are player independent but I do not know a way to increase a ai enemy player's unit kill resource with an upgrade the player bought(without triggers).
Basically I want the player hero to be able to upgrade how much money he earns from killing units.
@Aaternus: Go
A no go on making upgrades affect other player's units. While possible, it's just a mess and there are simpler ways of going about it. See, I'm under the assumption that you don't want the unit to give you resources every time you kill something else, but you DO want units you kill to give you resources and the amount is dependent on the unit? Upgrades would affect each AI unit's bounty individually, but it would be the AI's upgrade. Most likely you'll have to use triggers to issue the order to the AI every time you use an ability set do to nothing. While issuing the order, have it deduct the necessary minerals from you.
I actually want a set amount based on how much you upgrade so the unit would give you it, the upgrade increases vespene drop and I also have units give a varying amount of minerals based on their level.
Well I wouldn't go with that option since it makes the upgrades global for each player killing that ai, I see two options available, a behavior applied with the weapon which gives vespene if the unit with the behavior is killed or a trigger that modifies player property when they kill a unit.
Trying to decide which one is better but I'm surprised they don't have a effect on kill field for units or behaviors.
@Aaternus: Go
They do. It's called Unit: Effect+ containing -Create, -Birth, -Death, and -Revive.
I meant an effect for when the unit modified makes a kill, I just ended up going with a triggering solution.
And I decided to base vespene earned on unit mineral bounty times your upgrade and a constant. Events
Unit - Any Unit dies
Local Variables
Conditions
(Triggering player) == 7
Actions
Player - Modify player (Killing player) Vespene: Add (Integer({((Integer(((Triggering unit) Bounty (Minerals) (Current))))*Vespene Extraction[(Killing player)])/5}))
Thank you for your help.
@Aaternus: Go
You're very welcome, glad you found a solution.
Don't know why Preserver says it is only for taking damage. Location: Attacker is a totally useful part of the damage response, and you can use it to do all kinds of things on attack/spell damage.
The only downside is that the combination of Location: Attacker and Fatal does not work, for reasons unknown.
@MasterWrath: Go
Ah, I see. Must be why it has never worked for me for attackers. Thanks for that information.