How to use the unit within range event?

Status
Not open for further replies.
You need additional trigger for that operation.
Its all about adding event to another trigger.
  • TRIGGER 1
    • Events
      • Map Initialization
    • Conditions
      • <stuff here>
    • Actions
      • Set importantUNIT = (triggering unit)
      • <stuff here>
      • Trigger - Add to TRIGGER 2 the event (Unit - A unit comes within 256.00 of (importantUNIT))
  • TRIGGER 2
    • Events
    • Conditions
      • <stuff here>
    • Actions
      • <stuff here>
As you can see, second trigger has no event event at first, but after trigger 1 runs, it will have new event - which normaly can not be added. So now it looks like this:
  • TRIGGER 2
    • Events
      • Unit - A unit comes within 256.00 of (importantUNIT)
    • Conditions
      • <stuff here>
    • Actions
      • <stuff here>
 
Level 9
Joined
Aug 7, 2009
Messages
380
That event just work if the "Unit" is placed on your map not created by triggers after
Then, i think this will work as same as the result of that event:
  • Trigger 1
  • Events
    • Time - Every 0.40 seconds of game time
  • Conditions
    • (Number of units in (Units within X range of (Variable Y set to the position of the unit you want to check if there's any unit nearby)))) greater than 0
  • Actions
    • Action blah blah..
That's it, Remember to clear the Variable Y (leak)
Well, i think this would work too spinnaker. And Explain:
Condition: use Integer Comparison for that
Variable Y you could set it in a trigger that use Map Initialization

Edit: Seems to be i'm not alone :)
Edit 2: sorry, edit the trigger again
Edit 3: a little explain
 
Last edited:
Man, your trigger is also proper, however mine too.
Nothing stands between changing event:
  • TRIGGER 1
    • Events
      • Unit - starts the effect of ability
    • Conditions
      • <stuff here>
    • Actions
      • Set importantUNIT = (Triggering unit)
      • <stuff here>
      • Trigger - Add to TRIGGER 2 the event (Unit - A unit comes within 256.00 of (importantUNIT))
Your dicision when to add this.
 
Status
Not open for further replies.
Top