Hey guys, I have a problem with one of my triggers for an AoE melee attack. I have a mouse-click attack that uses a trigger like this:
Environment - Execute Gorehowl (Damage) on (Unit 1 from (Any units in (Region(((Position of PlayerUnit) offset by 0.75 towards (Current camera yaw of player 1) degrees), 0.8)) owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) from PlayerUnit
So basically it locates an enemy unit within an area in front of my hero and deals damage to it. This only affects 1 unit, even if there are 3 or more in this area. Now I have made talents to upgrade the attack to hit 2 and 3 units. What I've done is simply check if the hero has the talent, and add another trigger:
Environment -Execute Gorehowl (Damage) on (Unit 2 from (Any units in (Region(((Position of PlayerUnit) offset by 0.75 towards (Current camera yaw of player 1) degrees), 0.8)) owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) from PlayerUnit
The problem with this is that it doesn't seem to find "Unit 2", even if there are 2 units within range. I have no clue what's wrong with this system?
Can't say I've tried anything like that. Maybe instead of having the code twice, you could use "Pick each unit in unit group" action and limit the amount of units it does (if there's supposed to be a limit). For the unit in the environment effect, you'll use the function "Picked unit". It might work.
The unit 2 reference wouldn't work in this instance since it refers to the order in which units are added into a unit group variable. The Any Amount part is where you limit the number of units
Hey guys, I have a problem with one of my triggers for an AoE melee attack. I have a mouse-click attack that uses a trigger like this:
Environment - Execute Gorehowl (Damage) on (Unit 1 from (Any units in (Region(((Position of PlayerUnit) offset by 0.75 towards (Current camera yaw of player 1) degrees), 0.8)) owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) from PlayerUnit
So basically it locates an enemy unit within an area in front of my hero and deals damage to it. This only affects 1 unit, even if there are 3 or more in this area. Now I have made talents to upgrade the attack to hit 2 and 3 units. What I've done is simply check if the hero has the talent, and add another trigger:
Environment -Execute Gorehowl (Damage) on (Unit 2 from (Any units in (Region(((Position of PlayerUnit) offset by 0.75 towards (Current camera yaw of player 1) degrees), 0.8)) owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) from PlayerUnit
The problem with this is that it doesn't seem to find "Unit 2", even if there are 2 units within range. I have no clue what's wrong with this system?
Can't say I've tried anything like that. Maybe instead of having the code twice, you could use "Pick each unit in unit group" action and limit the amount of units it does (if there's supposed to be a limit). For the unit in the environment effect, you'll use the function "Picked unit". It might work.
@DeepCover187: Go
The unit 2 reference wouldn't work in this instance since it refers to the order in which units are added into a unit group variable. The Any Amount part is where you limit the number of units
@MaskedImposter: Go
Got it working! :) Thanks guys!