| 01-13-2007, 07:50 PM | #1 |
When there are two rects overlapping or occupying the same space, if a unit enters where they overlap, does the unit "enter" both regions, or just one or the other? Also, because it's a related question, Instantly moving a unit to a point inside a rect does not count as the unit "entering" the rect, correct? |
| 01-13-2007, 07:57 PM | #2 |
1. I would think that it would count as a unit entering both rects, because it's inside both rects, right? 2. Moving a unit instantly into a rect triggers the "Unit Enters Rect" event I'm 95% sure. |
| 01-13-2007, 08:06 PM | #3 | |
Really? Quote:
Region 000: I understand it to mean that the trigger won't fire if the unit is moved by the above actions... |
| 01-13-2007, 08:12 PM | #4 |
If a unit is already in a region and then is instantly moved into a point in the same region, I don't think that would could as "Entering the rect". |
| 01-13-2007, 08:31 PM | #5 |
There is no such thing as a unit enters rect event. Region events do not interfer with each other - they are independant. I don't think moving within a region will trigger the event. In fact, I'm 99% positive. |
| 01-13-2007, 08:41 PM | #6 |
Pyrogasm, that trigger wont work because "Unit enters region" fires right before the unit actually enters the region. That means your condition will always be false. Someone wrote a system called "Super Rects" where you could create rects and determine which rect a unit entered, and other useful stuff. The easy work around is to make a slightly larger region, and check to see if the unit is inside that region, when entering the smaller one. |
| 01-13-2007, 08:45 PM | #7 |
Or make a custom function that checks if it is just outside the region? |
| 01-13-2007, 11:42 PM | #8 | |
Oh, that wasn't my trigger. I was quoting Anitarf and the trigger I posted above was the trigger that he was commenting on. Quote:
Trigger: Events
![]() Unit - A unit enters Region 000 <gen> |
| 01-13-2007, 11:54 PM | #9 |
Maybe because he meant there IS a thing as "a unit enters region event"? Lol. |
| 01-13-2007, 11:55 PM | #10 |
Aren't rects and regions equivalent? In GUI it's a region, and in JASS it's a rect. I said "rect" because it's the correct term for them... isn't it? |
| 01-14-2007, 12:53 AM | #11 |
That's one reason to trash GUI. Real definitions: region : Group of points can trigger events when units leave/exit the group of points (this is actually related to collision size). It is easy to add/remove points from them and also rects rect : An object that holds 4 reals, max x, max y , min x , min y, coordinates of 2 points that form a rectangle, these do not have any enter/leave event. In fact, when you call that BJ function of the enter rect event it creates a region object, adds the rect to the region and registers the event for the newly created region. This is the reason many people think that moving rects is "bugged" , btw if you actually "move the region" instead of the rect, the event works correctly and all.. |
| 01-14-2007, 02:29 AM | #12 |
I stand corrected. |
