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

Status
Not open for further replies.
Level 19
Joined
Oct 29, 2007
Messages
1,184
JASS:
function InitTrig_PICKUP takes nothing returns nothing
    set gg_trg_PICKUP = CreateTrigger(  )
    call TriggerRegisterUnitInRange( gg_trg_PICKUP, udg_u[1], 64, null )
    call TriggerRegisterUnitInRange( gg_trg_PICKUP, udg_u[2], 64, null )
    call TriggerRegisterUnitInRange( gg_trg_PICKUP, udg_u[3], 64, null )
    call TriggerRegisterUnitInRange( gg_trg_PICKUP, udg_u[4], 64, null )
    call TriggerAddAction( gg_trg_PICKUP, function Trig_PICKUP_Actions )
endfunction

Will this work as event where GetTriggerUnit equals the unit in range of udg_u?

Cause it seems function Trig_PICKUP doesn't run at all.
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
I doubt your udg_u array variable is already set to its values when this init function is run.

Write

JASS:
function InitTrig_PICKUP takes nothing returns nothing
    set gg_trg_PICKUP = CreateTrigger(  )
    set udg_u[1] = <unit>
    set udg_u[2] = <unit>
    set udg_u[3] = <unit>
    set udg_u[4] = <unit>

    call TriggerRegisterUnitInRange( gg_trg_PICKUP, udg_u[1], 64, null )
    call TriggerRegisterUnitInRange( gg_trg_PICKUP, udg_u[2], 64, null )
    call TriggerRegisterUnitInRange( gg_trg_PICKUP, udg_u[3], 64, null )
    call TriggerRegisterUnitInRange( gg_trg_PICKUP, udg_u[4], 64, null )
    call TriggerAddAction( gg_trg_PICKUP, function Trig_PICKUP_Actions )
endfunction

or call this trigger setup function after you have filled your array.
 
64 range basically means that the two units cannot have more than 32 collision (all heroes have 32 for balancing reasons) and must be perfectly touching. The range has to be the collision size of the unit plus the collision size of the actively-colliding unit, plus 64, in order to negate the collision size factor. 128 collision radius will do the job.
 
Status
Not open for further replies.
Top