| 02-02-2006, 09:57 AM | #1 |
Why can't you set a point to equal a unit variable?! How the heck are you supposed to prevent leaking if you have to say "Position of u" all the time instead of setting p = position of u and then removing p when you are done using it??? ![]() EDIT: Sorry, this problem isn't universal but I have seen it sometimes. It seems the problem I am actually having right now is centering a region on a point. It just stays where it was placed on the map for some reason. |
| 02-02-2006, 10:08 AM | #2 |
You can't set a variable of one type to point to an object of a different type, unless it's a derived type, but inheritence only really applies to handles with Warcraft. When using JASS, the name for a point is a location. So you'll want to use RemoveLocation(location whichLocation). Edit: I think you need to post your trigger/script to get help on that one. |
| 02-02-2006, 11:43 AM | #3 |
When you preplace a region on the map, the region stays there, you can't move it for most purposes. You have to set the region as a variable and redefine it everytime. Of course this means you have to remove it every time as well. As far as I know at least. |
| 02-02-2006, 01:23 PM | #4 |
no no no. First of all there are 2 things in wc3 editing world that are kind of different : rects and regions. I'd like to thank blizzard for this confusion. regions: Can have any shape / have enter/leave events. rects: They are always rectangular shaped, you can pick all the units in a rect. Problem is that what world editor calls regions are actually rects. When you use the event A unit enters a region . It in fact is a unit enters a rect, as I said rects don't have enter/leave events. So what blizzard did was to make the event registeror create a new region then add the current points of the rect to that region . Problem is that the new region is never saved into any variable so you don't have access to it. When you move a rect, it will just move the rect. But the region that was created for the event will stay there. And that's the problem |
| 02-03-2006, 09:03 PM | #6 |
Sure you can use the within range event, you just have to add it to your trigger when you create your heroes, there's an action for adding events to triggers. |
| 02-04-2006, 12:16 AM | #7 |
Well, if you want to use it. WEU has a convert region to rect function and vice versa which should allow you to access regions, but this is an advanced trigger and thus will make your map unopenable in normal WE. |
| 02-04-2006, 05:57 AM | #8 |
Wow, thanks Anitarf. I didn't realize you could do that because when you add that event the usual way you can only choose "No Unit" or a preplaced unit. |
| 02-04-2006, 02:18 PM | #9 |
Just for reference, andvanced WEs like my UMSWE or Pitzers WEU fix the region/rect confusion. Additionally they add general region support (real regions) including the corresponding cleanup functions. As always, using Blizzards crap to write clean scripts with proper cleanup is kinda hard. |
