Do something if a unit enters any region in an array?

Aserpent

New Member
Reaction score
2
I'm not quite sure how to make it check if a unit enters any region in an array or anything like that, a little help?

E.g: I have 3 regions in the array "InstakillRegions"
on indexes 0 - 2, so if a unit enters ANY region in the array InstakillRegions, they will be (In this example) instantly killed.
 

Grags_1977

Ultra Cool Member
Reaction score
32
Trigger:
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Trigger - Add to Instakill <gen> the event (Unit - A unit enters InstakillRegion[(Integer A)])


Trigger:
  • Instakill
    • Events
    • Conditions
    • Actions
      • Unit - Kill (Triggering unit)


Sorry for doing it 1 to 3. I can't count from 0, I lose where i'm up to at 1 and say "Huh? how can be it 2? It clearly says 1!"
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
EDIT: Derp misread grag's post :/

Trigger:
  • Kill Units
    • Events
      • A Unit enters X[1] Region
      • A Unit enters X[2] Region
      • A Unit enters X[3] Region
    • Conditions
    • Actions
      • Unit - Kill triggering unit
 

Grags_1977

Ultra Cool Member
Reaction score
32
That won't work GFreak ;)

He needs to add the event through triggers.

EDIT: Grats on 150! You flew up!
 

Nestharus

o-o
Reaction score
84
You only need 1 region >.>


You are talking about firing a trigger whenever a unit enters any of a set of rects. Add all of the rects to 1 region and ur done.

[ljass]call RegionAddRect(myRegion, myRect)[/ljass]

JASS:

set rect myRect = Rect(minX, minY, maxX, maxY)
//add rect to region
call RemoveRect(myRect)

//continue on until all rects added

set myRect = null
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
That won't work GFreak ;)

He needs to add the event through triggers.

EDIT: Grats on 150! You flew up!

it will if he doesnt use the variable, if he uses the region itself it should work, no reason to even call a variable for this even if he saves it for use with another function

and ya i got 100 rep from The Helper for helping so much with the w.e forum :D
 

Aserpent

New Member
Reaction score
2
I'm not quite sure how to make it check if a unit enters any region in an array or anything like that, a little help?

E.g: I have 3 regions in the array "InstakillRegions"
on indexes 0 - 2, so if a unit enters ANY region in the array InstakillRegions, they will be (In this example) instantly killed.
Thanks to all of you
 
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