• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

how do i add units to presets

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Custom script: call TriggerRegisterUnitInRange( *trigger*), GetHandleId(*unit*) , *range* , null )
*trigger* = The trigger you want to add the event to. You can conver the trigger to custom text to get the name and then git undo to convert it back to GUI.

*unit* = The unit that other units come close to. You can use GetTriggerUnit(), GetEnumUnit() or udg_*variablename* for example.

*range* = Self explanatory.

The last null can be replaced with unit filter, but you can leave it to null and filter the unit with conditions in the trigger.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
  • Custom script: call TriggerRegisterUnitInRange( *trigger*), GetHandleId(*unit*) , *range* , null )
*trigger* = The trigger you want to add the event to. You can conver the trigger to custom text to get the name and then git undo to convert it back to GUI.

Just a note, that's a JNGP function, right? Can't do that in normal WE, I believe. In normal WE once it's turned into custom text, you can't turn it back? Been so long since i used normal WE, I might be mistaken, though.
 
Last edited:
Status
Not open for further replies.
Top