How to detect when a Xel'naga tower is activated?

Monsterous

In the Shadows, Lurking.
Reaction score
99
Well since the xel'naga tower is activated when a ground unit goes near it, just do this.

Event: Unit is in Range of Xelnaga Tower
Condition: Triggering Unit = 0.5 range of Xelnaga Tower
Triggering Unit = Ground

(something along those lines)
 

Adovid

New Member
Reaction score
2
Xel'Naga tower has ability: (tower capture).

Just check for a unit to use that ability.

[edit: ehh, seems to have complications doing it this way for some reason :(. Just do it Monsterous' way if you don't know how to mess with ability commands and the data editor.]
 

FrozenShadow

I am a WolfieeifloW fan.
Reaction score
75
Yes, but if an opponent goes to a Xel'Naga tower, while it is controlled by someone else, it will deactivate. So, I'll try out Adovid's way first.

EDIT:

What do you guys think of this trigger? So far it's working pretty well for me, if you can find something else that I missed perhaps, that might cause an exploit, please tell me, thank you!

If it is flawless, also tell me, cause I don't think I can rest until I'm sure that my map is through all the typical triggers. :D

Explanation: There are two turrets, they should be able to be controlled as if it were a Xel'Naga tower, I made a way in which it returns to being owned by Neutral (0) once the last triggering unit dies, but it cannot be deactivated as the Xel'Naga tower would be when two units owned by different players both go near it, I am fine with that. I just need to know if there is a way in which someone can exploit this.

Activate Turret #1
Trigger:
  • Events
    • Unit - Any Unit Enters a distance of 2.5 from Raider Turret [20.00, 32.00]
    • Local Variables
    • Conditions
      • (Owner of (Triggering unit)) != 0
      • (Owner of Raider Turret [20.00, 32.00]) == 0
    • Actions
      • Variable - Set Turret Controller #1 = (Triggering unit)
      • Unit - Change ownership of Raider Turret [20.00, 32.00] to player (Owner of (Triggering unit)) and Change Color


Activate Turret #2
Trigger:
  • Events
    • Unit - Any Unit Enters a distance of 2.5 from Raider Turret [76.00, 32.00]
    • Local Variables
    • Conditions
      • (Owner of (Triggering unit)) != 0
      • (Owner of Raider Turret [76.00, 32.00]) == 0
    • Actions
      • Variable - Set Turret Controller #2 = (Triggering unit)
      • Unit - Change ownership of Raider Turret [76.00, 32.00] to player (Owner of (Triggering unit)) and Change Color


Deactivate Turret #1
Trigger:
  • Events
    • Unit - Any Unit Leaves a distance of 2.5 from Raider Turret [20.00, 32.00]
    • Local Variables
    • Conditions
      • (Owner of (Triggering unit)) != 0
      • (Owner of (Triggering unit)) == (Owner of Raider Turret [20.00, 32.00])
    • Actions
      • Variable - Set Turret Controller #1 = No Unit
      • Unit - Change ownership of Raider Turret [20.00, 32.00] to player 0 and Change Color


Deactivate Turret #2
Trigger:
  • Events
    • Unit - Any Unit Leaves a distance of 2.5 from Raider Turret [76.00, 32.00]
    • Local Variables
    • Conditions
      • (Owner of (Triggering unit)) != 0
      • (Owner of (Triggering unit)) == (Owner of Raider Turret [76.00, 32.00])
    • Actions
      • Variable - Set Turret Controller #2 = No Unit
      • Unit - Change ownership of Raider Turret [76.00, 32.00] to player 0 and Change Color


Checking Turret #1
Trigger:
  • Events
    • Unit - Any Unit dies
    • Local Variables
    • Conditions
      • (Triggering unit) == Turret Controller #1
    • Actions
      • Variable - Set Turret Controller #1 = No Unit
      • Unit - Change ownership of Raider Turret [20.00, 32.00] to player 0 and Change Color


Checking Turret #2
Trigger:
  • Events
    • Unit - Any Unit dies
    • Local Variables
    • Conditions
      • (Triggering unit) == Turret Controller #2
    • Actions
      • Variable - Set Turret Controller #2 = No Unit
      • Unit - Change ownership of Raider Turret [76.00, 32.00] to player 0 and Change Color
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
The Xel'Naga tower has a VERY simple ability. When a unit comes within range of it, it will select that unit and share sight with it. It's done via a few checked boxes by an "ability - interact" method.

It then has a power up actor that executes whenever it is in sight of another unit.

completely simple.

There are probably a few ways to go about bending it to your will; however, you will not be using one simple "ability - interact" method, as it is too simple for your need. (a unit can only "select" one unit at a time...)

You could use a periodic search ability on your xel'naga towers so that they choose all units within range every few seconds and share sight with all of them... fairly simple to accomplish.

The other way that I can think of is that you could just make ONE trigger that says:

Events: every 1 second of game time
--pick all units in (units within range of xel'naga tower1)
Actions: for each picked unit share vision... etc.

but definately get away from enter/leave triggers for each tower separately... that's just redundant and prone to bugs.
 

FrozenShadow

I am a WolfieeifloW fan.
Reaction score
75
The Xel'Naga tower has a VERY simple ability. When a unit comes within range of it, it will select that unit and share sight with it. It's done via a few checked boxes by an "ability - interact" method.

It then has a power up actor that executes whenever it is in sight of another unit.

completely simple.

There are probably a few ways to go about bending it to your will; however, you will not be using one simple "ability - interact" method, as it is too simple for your need. (a unit can only "select" one unit at a time...)

You could use a periodic search ability on your xel'naga towers so that they choose all units within range every few seconds and share sight with all of them... fairly simple to accomplish.

The other way that I can think of is that you could just make ONE trigger that says:

Events: every 1 second of game time
--pick all units in (units within range of xel'naga tower1)
Actions: for each picked unit share vision... etc.

but definately get away from enter/leave triggers for each tower separately... that's just redundant and prone to bugs.

I do not want the Pick all units as I only want it to be activated for one person, not every single unit touching it, I think this way is more fool proof. Please tell me how it is prone to bugs, in what way?
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
Ok that last statement confusled the bajinxses out of me...

you want it to be active for only one person at a time... so... like it works now? I thought the idea was that if one player activated the tower then all players could see the area around the tower... if not, then you're going to have restate what you want exactly.


bugs... hmmm... off the top of my head...

well for one thing you are using "a unit leaves zone" as an action. What if the unit dies? or explodes... or is transported away from the zone with the mothership ability. You have to cover all your bases to make sure that the "leaves zone" action is going to pick up on all the various different possibilities.

Sometimes such an action might not fire correctly if several units are entering and leaving all at once. There might be small time increments that have to be obeyed for it to fire. A unit also could leave as one is entering and the entering trigger would fire right before the leaving trigger, thus there would be a unit at the xel naga, but it would be turned off. Also, you won't be able to really test for a lot of these situations because they can have a small rate of occurrence or might just not present themselves up front during your tests. Chances are, you have been testing with only a few units in a very controlled situation as it is.

Usually actions are much more simplistic than you would hope for when you first make your trigger. It's up to you to think of these things. You also don't want to have 4 triggers controlling one simple task. it gets messy.
 

FrozenShadow

I am a WolfieeifloW fan.
Reaction score
75
Ok that last statement confusled the bajinxses out of me...

you want it to be active for only one person at a time... so... like it works now? I thought the idea was that if one player activated the tower then all players could see the area around the tower... if not, then you're going to have restate what you want exactly.


bugs... hmmm... off the top of my head...

well for one thing you are using "a unit leaves zone" as an action. What if the unit dies? or explodes... or is transported away from the zone with the mothership ability. You have to cover all your bases to make sure that the "leaves zone" action is going to pick up on all the various different possibilities.

Sometimes such an action might not fire correctly if several units are entering and leaving all at once. There might be small time increments that have to be obeyed for it to fire. A unit also could leave as one is entering and the entering trigger would fire right before the leaving trigger, thus there would be a unit at the xel naga, but it would be turned off. Also, you won't be able to really test for a lot of these situations because they can have a small rate of occurrence or might just not present themselves up front during your tests. Chances are, you have been testing with only a few units in a very controlled situation as it is.

Usually actions are much more simplistic than you would hope for when you first make your trigger. It's up to you to think of these things. You also don't want to have 4 triggers controlling one simple task. it gets messy.

Yes, if you checked the 'check' trigger, then it'll deactivate it once the unit dies. Leaving counts blink, and entering counts warp in. But I won't be using recall, since this map will basically be an arena.
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
Well it's kind of funky form but it will do then I suppose. I would still look into situations such as custom hero abilities warping or pushing units around via knockback or the such. There could be something that comes up later and you would just have to revisit this issue again worst case.

As long as it works, who am I to complain? Good luck with your map! ;)
 

FrozenShadow

I am a WolfieeifloW fan.
Reaction score
75
Well it's kind of funky form but it will do then I suppose. I would still look into situations such as custom hero abilities warping or pushing units around via knockback or the such. There could be something that comes up later and you would just have to revisit this issue again worst case.

As long as it works, who am I to complain? Good luck with your map! ;)

Thanks! :D

Yes, I'd probably be coding some knockbacks, but I doubt there will be any problems. As for dummy units, I'll just have to add more conditions ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top