• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

is this possible?? (making trigger shorter)

Status
Not open for further replies.
Level 13
Joined
Mar 4, 2009
Messages
1,156
  • Events
    • Unit - A unit comes within 1000.00 of FL 0059 <gen>
    • Unit - A unit comes within 1000.00 of FL 0107 <gen>
    • Unit - A unit comes within 1000.00 of FL 0124 <gen>
    • Unit - A unit comes within 1000.00 of FL 0527 <gen>
    • Unit - A unit comes within 1000.00 of FL 0528 <gen>
    • Unit - A unit comes within 1000.00 of FL 0529 <gen>
    • Unit - A unit comes within 1000.00 of FL 0530 <gen>
    • Unit - A unit comes within 1000.00 of FL 0531 <gen>
    • Unit - A unit comes within 1000.00 of FL 0532 <gen>
    • Unit - A unit comes within 1000.00 of FL 0533 <gen>
    • Unit - A unit comes within 1000.00 of FL 0534 <gen>
    • Unit - A unit comes within 1000.00 of FL 0535 <gen>
    • .......................

now i want to kill the unit on witch this event refers to

so if someone enters within 1000.00 of FL 0059 <gen> i want to kill FL 0059 <gen>
 
Level 5
Joined
Jan 5, 2008
Messages
145
you could add all the regions to a region variable with arrays. and use a another region variable and make it so if you come within 1000 of a region of a region in the array. setting it to the region variable and then destory the region set by the variable. xD
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
In jass I could do it (if all FL are the same type, and only the FL). Alright, gonna do it anyway.
JASS:
function FlFilter takes nothing returns boolean
    return GetUnitTypeId(GetFilterUnit()) == 'h000' //Replace h000 with your unit's rawcode.
endfunction

function AntiLeak takes nothing returns boolean
    return true
endfunction

function InitTrig_Shortener takes nothing returns nothing
    local filterfunc fFunc = Filter(function FlFilter)
    local filterfunc aLeak = Filter(function AntiLeak)
    local group gShort = CreateGroup()
    local unit uFl
    call GroupEnumUnitsInRect(gShort,bj_mapInitialPlayableArea,fFunc)
    
    loop
        set uFl = FirstOfGroup(gShort) //Replace TRIGGER with your trigger's name.
        call TriggerRegisterUnitInRange(gg_trg_TRIGGER,uFl,1000.0,aLeak)
        exitwhen uFl == null
    endloop
    
    call DestroyBoolExpr(fFunc)
    call DestroyBoolExpr(aLeak)
    call DestroyFilter(fFunc)
    call DestroyFilter(aLeak)
    call DestroyGroup(gShort)
    
    set fFunc = null
    set aLeak = null
    set gShort = null
    set uFl = null
endfunction
 
Status
Not open for further replies.
Top