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
633
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.
  • tom_mai78101 tom_mai78101:
    As for Github, I often frequent there, boasting about my genetic algorithm for tools-assisted speedrunning and such. I'm also pretty active on Discord, with my tag @asperatology.
  • tom_mai78101 tom_mai78101:
    Yeah, the whole earthquake + air pollution combo made me completely forget about bringing updates. I'll be sure to keep on top of things after all things are less requiring my attentions.
    +2
  • The Helper The Helper:
    I am just glad that you are OK Tom! Thank you for the update!
  • Varine Varine:
    Glad to hear you're okay! I only knew about your Github cuz I tried to follow some of you when I was learning how to program, but didn't understand any of it so kind of quit paying attention to what anyone does on it
  • The Helper The Helper:
    Freaking storm outside is kicking!
  • Blackveiled Blackveiled:
    I wouldn't know, I'm in Joliet, Illinois right now working. I left Houston area about 2 weeks ago lol
  • Blackveiled Blackveiled:
    Not permanently of course, just a temporary job.
    +1
  • jonas jonas:
    Glad you're ok @tom_mai78101
  • jonas jonas:
    @Blackveiled you know another word for permanent? temporary
    +1
  • Varine Varine:
    Briefly, he'll only be there for the interim. Like a stopgap of sorts, he'll be back home in short time
  • O Old Mountain Shadow:
    Hurray! Tom has reappeared!
  • The Helper The Helper:
    Happy Thursday!
  • Blackveiled Blackveiled:
    Yep. Just another fun night at work.
  • Varine Varine:
    Broke the nozzle on my 3d printer and I don't have another heater block. So... I guess I'm fucked on that this weekend
  • The Helper The Helper:
    that sucks i bet they are expensive
  • Varine Varine:
    Not really
  • Varine Varine:
    The entire hot end is like 20 dollars, I just can't get anymore until next week
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top