| 05-12-2008, 10:41 AM | #1 |
Why am I should use point x, y than location |
| 05-12-2008, 10:47 AM | #2 |
There are times when locations are needed; such as getting terrain height etc. So it's not "don't use locations", but rather only use them where they are appropriate. |
| 05-12-2008, 11:07 AM | #3 |
It's different ! :p Location is x AND y. You can't apply mathematic and dynamic transformation with the location or that is always proportional. |
| 05-12-2008, 11:39 AM | #4 |
Locations are easier to let leak. Coords don't leak at all. Also, things which require locations often interrupt unit orders, making them a bit odd when making unit abilities. |
| 05-12-2008, 11:49 AM | #5 |
locations are objects, they eats ram memory by leaking x and y are reals, they don't leaks |
| 05-12-2008, 01:02 PM | #6 |
so... use location when: you need to find coordinates where was cast spell (GetSpellTargetLoc()) or you need Z coordinate of terrain JASS:globals location l_temp=Location(0., 0.) endglobals //... call MoveLocation(l_temp, x, y) set z=GetLocationZ(l_temp) in the rest it is faster and more convenient than coordinate |
| 05-13-2008, 02:14 PM | #7 |
Hmm |
| 05-13-2008, 03:02 PM | #8 |
I only use locations under the case where I need a Z-coordinate, since that's impossible with just X/Y. Otherwise, I avoid locations like the plague; senseless handle declarations are silly. |
| 05-13-2008, 08:31 PM | #9 |
Using X/Y is a little bit (a very tiny bit) faster than using Locations. Also, Locations create small (very small) memory leaks if they are not removed with: call RemoveLocation(myLocationVariable) If you are going to post something at wc3campaigns (a system, a spell, etc), then you should probably use the X/Y. Otherwise, it doesn't really matter much. |
