help with flying then landing into a region and kill unit landing in region (+rep)

n[u]ll

You can change this now in User CP.
Reaction score
93
This is my trigger...

Code:
function Trig_fly_die_Func001C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0012) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0012) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func002C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0013) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0013) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func003C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0014) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0014) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func004C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0015) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0015) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func005C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0016) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0016) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func006C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0017) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0017) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func007C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0018) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0018) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func008C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0019) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0019) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func009C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0020) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0020) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func010C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0021) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0021) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Func011C takes nothing returns boolean
    if ( not ( GetUnitMoveSpeed(gg_unit_Edem_0022) == 0.00 ) ) then
        return false
    endif
    if ( not ( RectContainsUnit(gg_rct_Region_336, gg_unit_Edem_0022) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_fly_die_Actions takes nothing returns nothing
    if ( Trig_fly_die_Func001C() ) then
        call KillUnit( gg_unit_Edem_0012 )
    else
    endif
    if ( Trig_fly_die_Func002C() ) then
        call KillUnit( gg_unit_Edem_0013 )
    else
    endif
    if ( Trig_fly_die_Func003C() ) then
        call KillUnit( gg_unit_Edem_0014 )
    else
    endif
    if ( Trig_fly_die_Func004C() ) then
        call KillUnit( gg_unit_Edem_0015 )
    else
    endif
    if ( Trig_fly_die_Func005C() ) then
        call KillUnit( gg_unit_Edem_0016 )
    else
    endif
    if ( Trig_fly_die_Func006C() ) then
        call KillUnit( gg_unit_Edem_0017 )
    else
    endif
    if ( Trig_fly_die_Func007C() ) then
        call KillUnit( gg_unit_Edem_0018 )
    else
    endif
    if ( Trig_fly_die_Func008C() ) then
        call KillUnit( gg_unit_Edem_0019 )
    else
    endif
    if ( Trig_fly_die_Func009C() ) then
        call KillUnit( gg_unit_Edem_0020 )
    else
    endif
    if ( Trig_fly_die_Func010C() ) then
        call KillUnit( gg_unit_Edem_0021 )
    else
    endif
    if ( Trig_fly_die_Func011C() ) then
        call KillUnit( gg_unit_Edem_0022 )
    else
    endif
endfunction

//===========================================================================
function InitTrig_fly_die takes nothing returns nothing
    set gg_trg_fly_die = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_fly_die, 0.01 )
    call TriggerAddAction( gg_trg_fly_die, function Trig_fly_die_Actions )
endfunction




The problem is that when the unit lands into the region he doesnt die... (even when it walks into the region).
Anyone see a problem with it?
 

SFilip

Gone but not forgotten
Reaction score
634
wait haven't you asked this question before? this code seems like you just converted the trigger...
 

n[u]ll

You can change this now in User CP.
Reaction score
93
yah but this is a different code (i made it better) but i just really need to know how to do what im trying to do (read above if u odnt know what i amt rying to do) =)
 

corvusHaunt

New Member
Reaction score
96
Code:
function FlyDie_Cond takes unit u returns boolean
  return GetUnitMoveSpeed(u) == 0. and RectContainsUnit(gg_rct_region_336, u)
endfunction
Instead of all your condition functions...

Even better yet you can use it directly, since it's not a boolexpr:
Code:
....
 if GetUnitMoveSpeed(u) == 0. and RectContainsUnit(gg_rct_region_336, gg_whatever)
   call KillUnit(gg_whatever)
 endif
....
 

emjlr3

Change can be a good thing
Reaction score
395
i doubt a units movespeed will ever be 0, consdiering that is lower then the lowest possible in the editor....
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top