• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

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

Status
Not open for further replies.
Level 17
Joined
Apr 13, 2008
Messages
1,610
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 65
Joined
Jan 18, 2005
Messages
27,296
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