HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Situation Question

03-01-2006, 12:44 AM#1
BlinkBoy
Well to the main ponit, i have been working on a trade system and i have come to this event:

Trigger:
Unit - A unit comes within 256.00 of |c00004000Takeda Heavy Cavalry|r 0338 <gen>

my problem is that knowing that another trigger will add events to this trigger for each time a unit of a type is completed, and the event will be the same as it is in the code tags, How to identify the event unit knowing that the triggering unit will be the one entering this radius.
03-01-2006, 12:50 AM#2
Naakaloh
Instead of adding events, why not create a new trigger for each new unit?
03-01-2006, 01:12 AM#3
Vexorian
And the answer is that for some lame, stupid reason there is no way to know unless you create a new trigger for each unit and attach the unit to the trigger using CSCache or Handle Variables
03-02-2006, 07:53 PM#4
BlinkBoy
I found a better solution, instead of adding more memory which i don't want i'mm make it detect it this way:

Trigger:
Custom script: local unit a
Unit - Pause (Triggering unit)
Collapse Unit Group - Pick every unit in (Units within 91.00 of (Position of (Triggering unit)) matching ((Unit-type of (Picked unit)) Equal to Japanese Docks )) and do (Actions)
Collapse Loop - Actions
Custom script: local real b
Custom script: set b = GetDistance( GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()) )
Custom script: if b <= 91 and b >= 89 then
Custom script: set udg_Local_Unit = GetEnumUnit()
Custom script: endif
Custom script: set a = udg_Local_Unit
Unit - Unpause (Triggering unit)
Custom script: set a = null

PS THE SET a = null IS BECAUSE I HAVEN'T ADDED THE REST.
PS2 The range is a constant, changed value from 256 to 90.00