Event: Unit A comes within range of unit B

Sartan

New Member
Reaction score
23
what unit b?
the unit who comes in range or the unit who the incoming unit comes close too?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
The incoming unit is triggering unit...

There is no pre-existing event response to unit B, but I believe there is a system somewhere about this :S

Try searching ;)
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Sadly, the only way is to have an outside system to index Unit B, or just get the closest unit to Unit A, either way would work.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Or just store the unit in a variable then add the event to another trigger that unit comes within x of variable the just refer to the variable in the other trigger as unit b
 

jwallstone

New Member
Reaction score
33
@warden13: yes, you must know unit B when creating the trigger, but sometimes don't know it when the event triggers. As an example: a trigger with multiple of these events, one event for each unit B in a set, would present this challenge. The trigger would fire when a unit approaches any of the units in that set.

You are assuming that there is an entirely different trigger written for each unit B. You can see why that is tedious for all but the most basic uses of the event, and completely unworkable if you need it to be dynamic.

The solution I'm using now is to have a function that takes unit B as an argument and creates a trigger for this particular unit B. Then, I attach the unit B to the trigger, and retrieve by first retrieving GetTriggeringTrigger and using that to retrieve the unit. Annoying, but works fine.

Edit: What does GetEventTargetUnit do?
 
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