Check to see if a player has units 2.5 away from a tower.
if: Distance between (closest unit toposition of( XelNage tower)) and (XelNaga tower) < 2.5
then: add one to towerscontroled[owner of(Closest unit to position of(XelNaga tower))]
This will check whatever unit is closest to the tower, If its in range to control it, set your variable.
Another method: create zones in a circle 2.5 around the position of your towers, add units to unit groups when they're in these zones, if all units near a tower are of player x, player x controls it.
i thought about the method with areas around the towers but then i have to write this trigger for every single tower and remove burrowed and flying units and lots of more to do.
to aktivate a tower is interacting with a building. is it possible to request this as a event. this would be some generally solution for all towers then maybe.
i tryed the event "a xel Naga is using a ability" but i dont get it work.
i just wanna have: Team1 got 2 Xel Nagas / Team2 got 3 Xel Nagas in variables
it should really be a solution wich use to request "the xel naga is using his ability" and then give me the Team the unit wich is aktivating the tower is owned to.
1. Loop through all units in the map. Look in the trigger category "unit group". (I don't have the english client and can't give you exact function names therefore)
2. Filter out only xel naga towers (do a "If-Unittype of picked unit=Xel'naga tower")
3. Create another unit-group-loop. You will need to use the "ForEachUnit" here since you can't have the other loop inside of itself.
4. Set the region of the unitgroup for the loop 3. to a circle which has its middle at the location of the xel naga tower and a radius of 2,5
5. Filter out burried, flying and everything that doesn't make a tower being controlled.
6. If there is only one unit as a result for this loop, increase a variable for the owner of this unit.
I can't help you find the functions, you will have to search them. The only thing I could do would be telling you the raw-data names
Edit: Actually the whole xel naga towers work with one simple auto-cast ability which selects a unit within 2,5 range. The ability is called TowerCapture (Turm - Einfangen). Ordername: Designate
You can set up an event with this ability. Remember to change the phase to something else (generic- execute should be fine).
dam, i hear "unit-group-loop" the first time. I dont know what that is. wtf!
and this with the phase of an abilitiy confuse me complete. I use the german version too and this should make it more thougher to handle.
It should be so easy:
-a unit use an ability
-the ability is tower-capture
-give owner of captured unit anything wich i can use to handle a variable...
But i tryed it loong hours and i just wanna play the map. I will not be able to create it myself for sure. If anyone search a nice projekt idea atm, just take it!
create a tiny dialog in the top middle where the Teamtickets running down like in Battlefield and its ready.
Like i said in the other thread:
The simpelst Games are the best! I believe this Gameplay is funny and motivating to play it much.
How can i read out the count of how many X´el Nagas a Player/Team is holding in the moment?
Y, thats all. Got no solution for this -.-
Check to see if a player has units 2.5 away from a tower.
if: Distance between (closest unit toposition of( XelNage tower)) and (XelNaga tower) < 2.5 then: add one to towerscontroled[owner of(Closest unit to position of(XelNaga tower))]
This will check whatever unit is closest to the tower, If its in range to control it, set your variable.
Another method: create zones in a circle 2.5 around the position of your towers, add units to unit groups when they're in these zones, if all units near a tower are of player x, player x controls it.
i thought about the method with areas around the towers but then i have to write this trigger for every single tower and remove burrowed and flying units and lots of more to do.
to aktivate a tower is interacting with a building. is it possible to request this as a event. this would be some generally solution for all towers then maybe.
It should be something like:
a units interact with a building
a xel naga gets aktivated
i tryed the event "a xel Naga is using a ability" but i dont get it work.
i just wanna have: Team1 got 2 Xel Nagas / Team2 got 3 Xel Nagas in variables
it should really be a solution wich use to request "the xel naga is using his ability" and then give me the Team the unit wich is aktivating the tower is owned to.
This editor is so weird to do simple things -.-
push
pls guys, anyone of u knows how!!!!
1. Loop through all units in the map. Look in the trigger category "unit group". (I don't have the english client and can't give you exact function names therefore)
2. Filter out only xel naga towers (do a "If-Unittype of picked unit=Xel'naga tower")
3. Create another unit-group-loop. You will need to use the "ForEachUnit" here since you can't have the other loop inside of itself.
4. Set the region of the unitgroup for the loop 3. to a circle which has its middle at the location of the xel naga tower and a radius of 2,5
5. Filter out burried, flying and everything that doesn't make a tower being controlled.
6. If there is only one unit as a result for this loop, increase a variable for the owner of this unit.
I can't help you find the functions, you will have to search them. The only thing I could do would be telling you the raw-data names
Edit: Actually the whole xel naga towers work with one simple auto-cast ability which selects a unit within 2,5 range. The ability is called TowerCapture (Turm - Einfangen). Ordername: Designate
You can set up an event with this ability. Remember to change the phase to something else (generic- execute should be fine).
dam, i hear "unit-group-loop" the first time. I dont know what that is. wtf! and this with the phase of an abilitiy confuse me complete. I use the german version too and this should make it more thougher to handle. It should be so easy:
-a unit use an ability
-the ability is tower-capture
-give owner of captured unit anything wich i can use to handle a variable...
But i tryed it loong hours and i just wanna play the map. I will not be able to create it myself for sure. If anyone search a nice projekt idea atm, just take it! create a tiny dialog in the top middle where the Teamtickets running down like in Battlefield and its ready.
Like i said in the other thread: The simpelst Games are the best! I believe this Gameplay is funny and motivating to play it much.
@playlessNamer: Go
Here you go.