Unit Within Range Problem

the_ideal

user title
Reaction score
61
Why doesn't this work? In my init trigger I have this line:
Trigger:
  • Trigger - Add to Player 1 <gen> the event (Unit - A unit comes within 300.00 of MAINUNIT[1])


Trigger:
  • Player 1
    • Events
    • Conditions
    • Actions
      • Player Group - Remove (Owner of MAINUNIT[1]) from PlayersWithoutTome[(Custom value of (Triggering unit))]
      • Set point2 = (Center of (Playable map area))
      • Item - Create Manual of Health at point2
      • Custom script: call RemoveLocation (udg_point2)
      • Hero - Give (Last created item) to MAINUNIT[1]


No health tome is given, for some reason.

If anyone can help me out, I'll be extremely grateful. +rep of course
 

the_ideal

user title
Reaction score
61
Yes. And I've tried granting the item to test it, and it works. I've also made sure that MAINUNIT[1] is the one I'm thinking about. The problem is with the event addition.
 

HydraRancher

Truth begins in lies
Reaction score
197
At the end of the trigger, put a...
Trigger:
  • Game - Display to (All Players) It works so far


to check wether it actually gets down to that point
 

the_ideal

user title
Reaction score
61
I tested it, and the problem is with the event. For some reason the event isn't added or doesn't fire when it should.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Dont create it at the centre of the map create it at positon of MAINUNIT[1]
 

vypur85

Hibernate
Reaction score
803
> the problem is with the event

Post the whole trigger. Also post the trigger where you initialise the MAINUNIT[1].

Event not added can possibly be due to MAINUNIT[1] is actually no unit.

And, creating the item anywhere at all doesn't matter. It will be given to the unit anyway. (You can simply use 'Hero - Create item and give to...' though).

Edit:
Also, I hope you've tried the idea posted in Post#5. It's useful.
 

HydraRancher

Truth begins in lies
Reaction score
197
If its to do with the event (and we're taking your word for it that it is) then it must be to do with the variable "Main Unit"
 
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