• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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,097
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.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
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