• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

is this possible?? (making trigger shorter)

Status
Not open for further replies.
Level 14
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