• 🏆 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!

[Trigger] Jass, "Death Regions"

Status
Not open for further replies.
Level 2
Joined
Jun 27, 2008
Messages
8
Hello.
This is the Trigger I want :)

  • Death Region
    • Events
      • Unit - A unit enters Region 380 <gen>
      • (and all Regions in between)
      • Unit - A unit enters Region 2351 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Unit - Kill (Triggering unit)
The Problem is.. That I don't want to select 1971 Regions..
It would take forever. I've Already placed out the Regions so I wonder if there is any fast way to do it in Jass. I've heard about but I'm not really sure :)
"PreThanks"
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
If you are making an escape map, search this forum(there should be a thread on first or second page).
But they make it work by making the terrain under all those regions other than anywhere else on the map.
 
Level 2
Joined
Jun 27, 2008
Messages
8
Yeah I know. the thing is that I've used the "Death Terrain" on safe spots too.. So it won't work. besides. when you use it that way.. the "death regions" are too strict to be good.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
It was a smart idea to put this as a GUI topic.... *sarcastic*

Why the hell do you have 1971 regions?? That's too many, even if you're making a huge arena or something. My idea would be to put all the regions in an array and then just use a jass loop to add the event (I can make it for you), but you have to have a map initialization trigger that sets each region to a certain array (I suppose you know how to make a region array variable).

Sorry, but 1971 is really to many, I'm 99% sure that you could've done that (whatever it is) a lot easier.....

  • Map Initialization
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: local integer i = 0
    • Set Reg[0] = Region 380 <gen>
    • Set Reg[1] = Region 381 <gen>
    • Set Reg[2] = Region 382 <gen>
    • ...
    • Set Reg[1971] = Region 2351 <gen>
    • Custom script: loop
    • Custom script: exitwhen i == 1971
    • Custom script: call TriggerRegisterEnterRegion(gg_trg_Death_Region, udg_Reg[i], null)
    • Custom script: set i = i + 1
    • Custom script: endloop
Just remove the events from Death Event. There is no better way, except if the regions are somehow following a pattern so they can be created via triggers.
 
Level 9
Joined
Apr 14, 2008
Messages
192
JASS:
function Trig_Help_Conditions takes nothing returns boolean
    if ( not ( GetTriggerUnit() == GetOrderedUnit() ) ) then
        return false
    endif
    return true
endfunction

function Trig_Help_Actions takes nothing returns nothing
    call KillUnit( GetTriggerUnit() )
endfunction

//===========================================================================
function InitTrig_Help takes nothing returns nothing
    set gg_trg_Help = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Help, gg_rct_Death_Rei )
    call TriggerAddCondition( gg_trg_Help, Condition( function Trig_Help_Conditions ) )
    call TriggerAddAction( gg_trg_Help, function Trig_Help_Actions )
endfunction

This shows if a unit walks on a reigon the unit dies.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Hmm, couple of questions:
  1. Why did you convert it to JASS? It looks a lot nicer in GUI
  2. What the hell does your post have to do with anything? He knows how to kill a unit that enters a region
  3. He asked for the way to put all 1971 regions in the event without creating 1971 events (he said that it's ok if it's in JASS)
  4. Why did you revive this thread? And what is more, you revived without even reading the topic

I have nothing against you, I'm just really curious.
 
Status
Not open for further replies.
Top