• 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.

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

Status
Not open for further replies.
Level 17
Joined
Apr 13, 2008
Messages
1,608
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:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
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.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
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.
Top