I will try to explain. Sorry for english if smth wrong.
I have area which give me 2 minerals per second if unit of Player 1 enter the area. (just like area of influence)
Also, i have second trigger to stop gain minerals if unit leaved. And that is problem. For example, five unit stays and one leave, trigger turn off.
Can someone explain, in detail, how to make trigger check the number of units, and work only if no more unit left in the area (no more units - stop gain).
My editor in russian, so i cant just search for some things in list of triggers.
(And...can i make ability cost some amount of supply, instead of usual energy/minerals? Just like build the unit - if i have not enough of free supply, i can't use it.)
number of living units in (region) owned by player (1) == 0
you may also want to add the event: unit dies because you don't want dead units to be able to generate minerals, do you? for this I would add the condition: owner of triggering unit == player 1
number of living units in (region) owned by player (1) == 0
you may also want to add the event: unit dies because you don't want dead units to be able to generate minerals, do you? for this I would add the condition: owner of triggering unit == player 1
i have the second condition already. Its funny, but i can't just find the "number of living units..." in russian version. In which category it is? Unit? Searching for that two days now
Edit:
Actualy, i saw this line many times, but didn't find it. May be someone can get screenshot of it, where it is
as far as I know, you would have to use a unit group variable, not a unit variable as a unit variable is but a single unit, meaning that the unit that entered most recently is the variable and that if it leaves or dies, the trigger will not work until another unit enters the region to turn it back on
Thank you guys)
Reinstalled the game for this (becouse i failed to switch language, don't know why) but anyway - final condition
(Number of Living units in (Any units in "Gas Station" owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 0
And, nobody knows answer for (And...can i make ability cost some amount of supply, instead of usual energy/minerals? Just like build the unit - if i have not enough of free supply, i can't use it.)?
What you can do, as a proxy, is have the ability create a unit (which as an effect, can check if the supply cost of the created unit is met) and in the create unit effect, use the effect filed to run the real effect you want, setting it to target point.
I will try to explain. Sorry for english if smth wrong. I have area which give me 2 minerals per second if unit of Player 1 enter the area. (just like area of influence) Also, i have second trigger to stop gain minerals if unit leaved. And that is problem. For example, five unit stays and one leave, trigger turn off. Can someone explain, in detail, how to make trigger check the number of units, and work only if no more unit left in the area (no more units - stop gain). My editor in russian, so i cant just search for some things in list of triggers.
(And...can i make ability cost some amount of supply, instead of usual energy/minerals? Just like build the unit - if i have not enough of free supply, i can't use it.)
give the second trigger a condition:
number of living units in (region) owned by player (1) == 0
you may also want to add the event: unit dies because you don't want dead units to be able to generate minerals, do you? for this I would add the condition: owner of triggering unit == player 1
i have the second condition already. Its funny, but i can't just find the "number of living units..." in russian version. In which category it is? Unit? Searching for that two days now
Edit: Actualy, i saw this line many times, but didn't find it. May be someone can get screenshot of it, where it is
It consists out of two functions:
1. Unit group - Number of units in unit group
2. Unit group - units in region matching condition
The first one is the outer one counting units in a specified unit group. The second one creates the unit group.
Store the unit in a Variable then if example scenario.
EventPeriodic (1second)
Switch(UnitVariable is in Region A)
case: true
then do actions like Give Gold per Second.
case: false
then do exactly nothing.
@Reul123: Go
as far as I know, you would have to use a unit group variable, not a unit variable as a unit variable is but a single unit, meaning that the unit that entered most recently is the variable and that if it leaves or dies, the trigger will not work until another unit enters the region to turn it back on
Thank you guys) Reinstalled the game for this (becouse i failed to switch language, don't know why) but anyway - final condition
(Number of Living units in (Any units in "Gas Station" owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 0
And, nobody knows answer for (And...can i make ability cost some amount of supply, instead of usual energy/minerals? Just like build the unit - if i have not enough of free supply, i can't use it.)?
What you can do, as a proxy, is have the ability create a unit (which as an effect, can check if the supply cost of the created unit is met) and in the create unit effect, use the effect filed to run the real effect you want, setting it to target point.
@joey101d: Go
Okay. How about 2 trigger sections?
UnitEntersMap.
Add Unit to UnitGroupVariable.
Then the Second Trigger Section as explained in Reuls previous post.
PS (Trial and Error :) Simply experiment)