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

[Spell] Point in Region

Status
Not open for further replies.

sentrywiz

S

sentrywiz

Hi all.

Is there a way to track if an ability has been cast in specific region?

I like to cast a point target spell like Shockwave and I want to track in which region was the spell cast. Note that the unit casting is not in the region, but casts it from outside the region, so the point is saved in a variable. I guess the question might be: is there a way to track the point variable in specific region.

Any ideas?
 

sentrywiz

S

sentrywiz

regions are rectangles.. with min/max X and min/max Y. if you cast a spell you can save x/y of the caster or the target unit or point and check wether X and Y are between min and max values.

So yes you can:D

Can you show me via some trigger example?

Use an array that contains all regions. Then loop through them and check if the ability cast point is within region[x]

Yeah but how? Where is the condition for that? I saw no condition "Point is in region". There is unit in region but not point
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
  • For each (Integer A) from 1 to number_of_regions, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (allRegions[(Integer A)] contains my_loc) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: found!
        • Else - Actions
it's a boolean condition, region contains point.
 
Status
Not open for further replies.
Top