Ok, this is a very fundamental idea of my map, but I've run into a road block.
I want when like 2 zealots enter a region, to create a larger version of the zealot and kill the other two. But I am very frustrated because I've been looking through all the 'conditions', and I just can't find a unit name or anything.
What I have:
Events
Unit - Any Unit Enters BottomLeft-Combination-In
Local Variables
Conditions
Actions
Unit - Create 1 Big-Zealot for player (Triggering player) at (Center of BottomLeft-Combination-Out) using default facing (No Options)
Unit - Kill (Triggering unit)
I figured under "Conditions" what I'd be looking for was something like, triggering unit == 2 zealots or something like that. Any help would be appreciated.
Thanks for the reply, but that's the issue. Where it says Any Unit, I can't change to a specific Unit, such as zealot. And even if I could, I don't think i want to. I'm trying to make it so 2 units enter the region, 1 comes out, the other 2 die. And now I have my upgraded Zealot
Your trigger will be when a unit enters a region and your condition will be if that unit is a zealot.
Now in your actions it gets tricky:
If it is the first zealot you find, put it in a global variable and stop.
Otherwise you check:
Is it the same zealot (being funny by walking in and out the region all the time) -> stop.
Is it another zealot then check if the first zealot is still alive (Optionally you can also check if the first zealot is still in the region.)
If yes -> Kill both, set the global variable to null and add the upgraded unit.
If No -> Override the global variable by the current entering zealot.
Thank you, still working on getting that done. This is all somewhat relatively new to me.
and @Kimphoe
I'm having a hard time how to put that into script..
It surely wouldn't look like this would it?
triggering unit == zealot
and triggering unit == zealot?
Needless to say I am confused and my brain is somewhat fried
Edit: My main issue atm is with the condition, checking whether or not it's a zealot. I just can't for the life of me figure out what the comparison check needs to be. Any help would be amazing.
There is only one triggering unit. Frankly, the trigger shouldn't really care what the triggering unit is. If a unit enters the area, it should count the number of zealots in the area, and if it's at least 2, it performs the action.
Use the "Number of Units in Unit Group" integer function. For the Unit Group, use "Units in Region Matching Condition" function. I hope I got that right. The condition of course would be "unit-type of Matching Unit == Zealot"
Events
Unit - Any Unit Enters BottomLeft-Combination-In
Local Variables
Conditions
(Number of Living units in (Any units in BottomLeft-Combination-In owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most 2)) == 2
(Unit type of (Triggering unit)) == Zealot
Actions
Unit - Kill (Triggering unit)
Unit - Create 1 BigZealot for player (Triggering player) at (Center of BottomLeft-Combination-Out) using default facing (No Options)
1 unit does =/.. And for a couple of reasons, I can't do 'kill units in region'.
A) in case other units are in the region waiting to be a bigzealot or something or
B) someone finds the bug, and runs the first zealot out, saving however many minerals.
Events
Unit - Any Unit Enters BottomLeft-Combination-In
Local Variables
Conditions
(Number of Living units in (Any units in BottomLeft-Combination-In owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most 2)) == 2
(Unit type of (Triggering unit)) == Zealot
Actions
Unit - Kill (Triggering unit)
Unit - Create 1 BigZealot for player (Triggering player) at (Center of BottomLeft-Combination-Out) using default facing (No Options)
1 unit does =/..And for a couple of reasons, I can't do 'kill units in region'.
A) in case other units are in the region waiting to be a bigzealot or something or
B) someone finds the bug, and runs the first zealot out, saving however many minerals.
Again, thanks a lot for the help guys
Yeah, the "Units Matching Condition" doesn't work like it used to so I was confused when I recommended it (they changed how it functioned from War3 and to be honest the old functionality was WAY better).
The function you should try is "Find Units"
I actually looked into 'Find Units' But I kept running into the same problem.
Where it says 'Unit Type: (No Value)', I actually don't have the option to select any units. The top says 'String', as opposed to 'Unit Type'.
And it got me confused
And ya, this was a lot easier to do in WC3 unfortunately. But in the end, I'm sure there's a reason they did this stuff.
I can't seem to get this, I feel like something is just missing from the editor. So I'm not sure what to do about this, I've tried at least 100 ways so far to kill two different Zealots but I have no idea.
Edit: Actually, I might have a solution that isn't to kill units in region. How do i attach a region to a unit? Because if I can attach a region to a unit, I can use the 'Unit - Kill (Unit attached to BottomLeft-Combination-In)' Action.
If you are still looking to solve this I believe I may have a solution.
Event - Unit - Any unit enters BottomLeft-Combination-In
Action - If then else
If - Comparison
Value 1: Number of units in unit group
Type: Living
Unit Group: Units in Region Matching Condition
Unit Type: Zealot (Under the "value" source rather than "preset")
Region: BottomLeft-Combination-In
Player: Triggering Player
Unit Filter: not important when unit type is set to zealot, just make sure the two doesn't clash (everything to "allowed" works nicely)
Count: Any amount
Operator: >=
Value 2: 2
Then - Pick each unit in unit group
Unit Group - Units in region matching condition
Unit type: zealot
Region: BottomLeft-Combination-In
Player: Triggering Player
Unit Filter: still not important
Count: 3
Actions
Kill unit
Unit: Picked unit
Create units with default facing
Count: 1
Type: BigZealot
Player: Triggering player
Point: BottomLeft-Combination-In (assuming you want it created there)
Flags: No options.
"Else" can be left empty unless you want to make a text message or something along those lines.
It's a slightly demanding way to accomplish it, but it should work like a charm, and it's very easy to copy once you've learned how to use it :p
Ok, this is a very fundamental idea of my map, but I've run into a road block.
I want when like 2 zealots enter a region, to create a larger version of the zealot and kill the other two. But I am very frustrated because I've been looking through all the 'conditions', and I just can't find a unit name or anything.
What I have:
Events
Unit - Any Unit Enters BottomLeft-Combination-In
Local Variables
Conditions
Actions
Unit - Create 1 Big-Zealot for player (Triggering player) at (Center of BottomLeft-Combination-Out) using default facing (No Options)
Unit - Kill (Triggering unit)
I figured under "Conditions" what I'd be looking for was something like, triggering unit == 2 zealots or something like that. Any help would be appreciated.
fixed for better read
Unit - Any Unit Enters Try changing where it says ANY UNIT to ZEALOT lol
@LordOfKetchup:
Thanks for the reply, but that's the issue. Where it says Any Unit, I can't change to a specific Unit, such as zealot. And even if I could, I don't think i want to. I'm trying to make it so 2 units enter the region, 1 comes out, the other 2 die. And now I have my upgraded Zealot
Your trigger will be when a unit enters a region and your condition will be if that unit is a zealot.
Now in your actions it gets tricky:
If it is the first zealot you find, put it in a global variable and stop.
Otherwise you check:
Is it the same zealot (being funny by walking in and out the region all the time) -> stop.
Is it another zealot then check if the first zealot is still alive (Optionally you can also check if the first zealot is still in the region.)
If yes -> Kill both, set the global variable to null and add the upgraded unit.
If No -> Override the global variable by the current entering zealot.
I think you could just do a "and" condition with two comparisons? :P
@RandomNoExit:
Thank you, still working on getting that done. This is all somewhat relatively new to me.
and @Kimphoe
I'm having a hard time how to put that into script..
It surely wouldn't look like this would it?
triggering unit == zealot
and triggering unit == zealot?
Needless to say I am confused and my brain is somewhat fried
Edit: My main issue atm is with the condition, checking whether or not it's a zealot. I just can't for the life of me figure out what the comparison check needs to be. Any help would be amazing.
@Rickilicious: Go
There is only one triggering unit. Frankly, the trigger shouldn't really care what the triggering unit is. If a unit enters the area, it should count the number of zealots in the area, and if it's at least 2, it performs the action.
Use the "Number of Units in Unit Group" integer function. For the Unit Group, use "Units in Region Matching Condition" function. I hope I got that right. The condition of course would be "unit-type of Matching Unit == Zealot"
I believe Unit Type might be what you're looking for. I don't know.
Awesome!!! It works! Just one more problem =/
Events
Unit - Any Unit Enters BottomLeft-Combination-In
Local Variables
Conditions
(Number of Living units in (Any units in BottomLeft-Combination-In owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most 2)) == 2
(Unit type of (Triggering unit)) == Zealot
Actions
Unit - Kill (Triggering unit)
Unit - Create 1 BigZealot for player (Triggering player) at (Center of BottomLeft-Combination-Out) using default facing (No Options)
1 unit does =/.. And for a couple of reasons, I can't do 'kill units in region'.
A) in case other units are in the region waiting to be a bigzealot or something or
B) someone finds the bug, and runs the first zealot out, saving however many minerals.
Again, thanks a lot for the help guys
Yeah, the "Units Matching Condition" doesn't work like it used to so I was confused when I recommended it (they changed how it functioned from War3 and to be honest the old functionality was WAY better). The function you should try is "Find Units"
@MasterDinadan:
I actually looked into 'Find Units' But I kept running into the same problem.
Where it says 'Unit Type: (No Value)', I actually don't have the option to select any units. The top says 'String', as opposed to 'Unit Type'.
And it got me confused
And ya, this was a lot easier to do in WC3 unfortunately. But in the end, I'm sure there's a reason they did this stuff.
@Rickilicious: Go
Just put in the editor name of the Unit as a String. If you want to count Zealots, then type "Zealot"
@MasterDinadan:
I can't seem to get this, I feel like something is just missing from the editor. So I'm not sure what to do about this, I've tried at least 100 ways so far to kill two different Zealots but I have no idea.
Edit: Actually, I might have a solution that isn't to kill units in region. How do i attach a region to a unit? Because if I can attach a region to a unit, I can use the 'Unit - Kill (Unit attached to BottomLeft-Combination-In)' Action.
If you are still looking to solve this I believe I may have a solution.
Event - Unit - Any unit enters BottomLeft-Combination-In
Action - If then else If - Comparison Value 1: Number of units in unit group Type: Living Unit Group: Units in Region Matching Condition Unit Type: Zealot (Under the "value" source rather than "preset") Region: BottomLeft-Combination-In Player: Triggering Player Unit Filter: not important when unit type is set to zealot, just make sure the two doesn't clash (everything to "allowed" works nicely) Count: Any amount Operator: >= Value 2: 2 Then - Pick each unit in unit group Unit Group - Units in region matching condition Unit type: zealot Region: BottomLeft-Combination-In Player: Triggering Player Unit Filter: still not important Count: 3 Actions Kill unit Unit: Picked unit Create units with default facing Count: 1 Type: BigZealot Player: Triggering player Point: BottomLeft-Combination-In (assuming you want it created there) Flags: No options. "Else" can be left empty unless you want to make a text message or something along those lines.
It's a slightly demanding way to accomplish it, but it should work like a charm, and it's very easy to copy once you've learned how to use it :p
This trigger should do what you want and work "right out of the box" so to speak, just set the event region to the region you want.
@EphemeralNight:
Thanks a lot EphemeralNight. It works pretty fine. I even tested it on the most unusual Conditions and it worked fine! Thanks Again!