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!
Hi, the question is given. I don't know how to refer to the TriggerRegisterUnitInRange even't unit. I know the triggering unit is the unit which comes into range but how do I get the unit in the origo?
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?
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.
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.