| 05-27-2006, 01:18 PM | #1 |
wanna know why people use polarprojection for making movement? It's just good for doing circular movements, while coordinate xyz can be used to do anything |
| 05-27-2006, 01:21 PM | #2 |
Because it is easier and simpler. Anyway, doing it by co-ordinates you have to do exactly the same thing as polar projection, except you don't use a BJ, and don't convert the co-ordinates to a point. |
| 05-27-2006, 01:23 PM | #3 |
well... maybe it is simple but it's only good to do circular movement |
| 05-27-2006, 01:48 PM | #4 |
http://www.wc3jass.com/viewtopic.php?t=2417 http://www.wc3jass.com/viewtopic.php?t=2542 Some discussions on the subject. |
| 05-27-2006, 03:36 PM | #5 | |
Quote:
And to move by an angle variable (though it is more effective to use co-ordinates and trig, which is basically what the BJ does). |
| 05-27-2006, 04:28 PM | #6 |
It is better to use pure Radian operations instead of using angles and PolarProjectionBJ forces you to use locations and do cleanup. I am against the use of locations, and theo only times they are needed are because GetSpellTargetLoc() and GetLocationZ() don't have xy equivalents, I swear that if it wasn't because of those I would always use coordintates |
| 05-27-2006, 04:48 PM | #7 |
i'm also agains locations... I try to avoid all locations in my jass |
| 05-27-2006, 05:10 PM | #8 |
Locations are good for function returns at times though. Sometimes I get lazy and have some function return a location so I can get the X and the Y with the same function. Bleh, it's like my use of BoolExprs. People think I'm crazy, but I actually kind of like them. >_> |
| 05-27-2006, 05:16 PM | #9 |
If you wanted a function to return 2 reals, you could just do this: JASS:function MakeSomeReals takes nothing returns location local real mana = 100 local real hp = 500 return Location(mana, hp) endfunction function SetUnitStuff takes nothing returns nothing call SetUnitManaOrWhatever(someunit, GetLocationX(MakeSomeReals())) call SetUnitHpOrWhatever(someunit, GetLocationY(MakeSomeReals())) call DoNothingLol() endfunction Locations dont always have to be used for what they are assumed to be used as. I see a location as just reals combined. |
| 05-27-2006, 05:21 PM | #10 |
Wouldn't that leak...? |
| 05-27-2006, 05:24 PM | #11 |
yup... I use locations and PolarProjectionBJ because I don't care about performance as long as my triggers doesn't lag... |
| 05-27-2006, 06:06 PM | #12 |
Yea it would leak like hell, that wasent what i was showing though, it was a example. You dont have to be that uptight on everything man... |
| 05-27-2006, 07:11 PM | #13 |
It's not the leak that's the problem with your example, it's the fact that you're calling the function twice. If that function would, say, make a unit, then that code would make the unit twice. |
| 05-27-2006, 07:23 PM | #14 |
well, for simple triggers its ok, but in my systems it runs every 0.01 sec, so tats why i cant use location |
| 05-27-2006, 07:23 PM | #15 | ||
Quote:
Err no, it is better to use global variables for the returning. If only we had variable arguments (references for god's sake) JASS:function Something takes integer b returns nothing local integer a=b * 89 udg_temx = a*4 udg_temy = a*3 endfunction function UseSomething takes nothing returns nothing call Something() call BJDebugMsg("x "+R2S(udg_temx)+" : y"+R2S(udg_temy)) endfunction Anyways if you are somehow alergic to declaring new global variables you can always use the thousands of temp global variables declared in blizzard.j Quote:
|
