• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[JASS] How to refer to the TriggerRegisterUnitInRange event's unit?

Status
Not open for further replies.
Okay, thank you. (I have given out too much reputation in the last 24 hours)

Okay, updatetime:
I miserably failed doing the "use the event's unit in the actions" part. I don't know how to do this. Would someone please help me out with a short example code or hints?
 
Last edited by a moderator:
To use that event properly, you need to attach the unit to the actual trigger. You can eithor use some advanced array system to do this (probably with JNGP). Or for you normal WE users, use handlevars or other such handles used with game cache systems.

If you really are desparate you can even use a O(n) methond where you loop though all instances of a spell, or trigger stored in an array system which although not recomended, is easy to use allows spells to keep full MUI.

Also double post rule is 48 hours between posts.
 
Ex, using Handle Vars (configure to your own method).

JASS:
function Actions takes nothing returns nothing
    local unit u = GetHandleUnit(GetTriggeringTrigger(),"subject") //the unit you wanted
    //etc
endfunction

function InitTrig_Something takes nothing returns nothing
    set gg_trg_Something = CreateTrigger()
    call TriggerRegisterUnitInRange(gg_trg_Something,someone,filter)
    call TriggerAddActions(gg_trg_Something,function Actions)
    call SetHandleHandle(gg_trg_Something,"subject",someone)
endfunction
 
Status
Not open for further replies.
Back
Top