| 03-20-2008, 01:36 PM | #1 |
JASS:________________ | | | | | | | | | | | | | | | | |_______________| What I want to do, is create a gravestone around a unit so they can't move much, but I don't know much about offsets. I just played around with them and I am pretty sure it can make it so a gravestone spawns around all of the edges of that region. I have to go to sleep now so I'll check this in the morning. If anyone knows how I can do this, please post. Thanks. |
| 03-20-2008, 08:50 PM | #2 |
Offsets require a grasp of cartesian coordinate system. lets say you wanted the box dimensions to be 500 x 500. This essentially means that the north edge gravestones all have the same Y coordinates, so you just need to find the Y coordinate of the center. Take the Y coordinate of the center and add (or offset if you will) by 250. All gravestones on the north side will have this Y coordinate, but differing X coordinates. So if I created a gravestone at every 50 distance, I would place them at origin location offset by (-250,+250), (-200,+250), (-150,+250), (-100,+250)...(0,+250), (+50,+250)...and (+250,+250). For the south edge I would repeat this with the X offset, but instead of offsetting the Y by +250, I would offset it by -250. For the east and west edges, the X remains the same while the Y changes. So in this case, the offset would look like this (+250,-250), (+250,-200), (+250,-150)...(+250,0), (+250,+50), (+250,+100)...(+250,+250). Once the opposite side would use -250 for the X offset instead of +250. Hopefully that gives you an idea of what you were asking. |
| 03-20-2008, 10:59 PM | #3 |
That gives me a better idea, yes. But how do I find out exactly how big the region is? |
| 03-20-2008, 11:32 PM | #4 | |
Quote:
In gui you can set a real variable to the proper values, min and max of both x and y. Which will give you what you need. |
| 03-21-2008, 03:50 AM | #6 |
I'm not sure why it's doing that, but instead of using regions, try using locations. If you are needing regions to know when units are entering a location, you can just as easily use coordinates just set RVariable = Target Point of Ability Being Cast and use that as your location instead of center of region. |
| 03-21-2008, 04:28 AM | #7 |
I changed the variable to a point, and it does the same thing.. |
| 03-21-2008, 08:39 AM | #8 | |
Quote:
|
| 03-22-2008, 04:37 PM | #11 |
Your lag is the unfortunate side effect of using gui. It is inefficient if you haven't already try learning jass because you can do this very easy, organized and with little to no delay. Use Pyro's answer it should work! |
| 03-23-2008, 05:06 AM | #13 |
That's an odd error.... I can't see why that would occur. Unless "TempPoint" isn't defined as a point variable in the variable editor. I think this line needs to be changed: Trigger: Set TempPoint = (RVariable offset by ((-150.00 + ((Real((Integer B))) x 50.00)), Offset))Trigger: Set TempPoint = (RPoint offset by ((-150.00 + ((Real((Integer B))) x 50.00)), Offset))Also, you've mixed up a line; your line for creating the GreaveStones should look like this: Trigger: Unit - Create 1 Gravestone for Player 11 (Dark Green) at TempPoint facing Default building facing degrees |
| 03-24-2008, 02:30 AM | #15 |
This line should be the last of the trigger, not inside the loops: Trigger: Custom script: call RemoveLocation(udg_RPoint) |
