Page 1 of 1

More script get/set fun

Posted: 11 Aug 2006, 07:27
by FLOZi
Some basic trig functions would be handy when doing some particular complex animations.

Posted: 11 Aug 2006, 08:10
by Das Bruce
You can't do trig calculations in your head? For shame.

Anyway, trig functions are in math.h so theres no excuse for not including them. Save if they're already included...

Posted: 11 Aug 2006, 08:12
by FLOZi
Well, i guess i could somehow hook up my bos scripts to the internet, so that every time the pitch to an enemy is calculated it sends me an email, whereby i grab my trusty scientific calculator and input the answer?

And the only one currently included is ATAN, because OTA had it.

Posted: 11 Aug 2006, 09:23
by unpossible
FLOZi wrote:Well, i guess i could somehow hook up my bos scripts to the internet, so that every time the pitch to an enemy is calculated it sends me an email, whereby i grab my trusty scientific calculator and input the answer?

And the only one currently included is ATAN, because OTA had it.
isn't there another one in there too?

Posted: 11 Aug 2006, 15:38
by FLOZi
There's also XZ_ATAN which gives you atan of packed coordinates.

Posted: 12 Aug 2006, 05:09
by zwzsg
TA script variables are 32 bit signed integers, not very handy for math. I mean, for instance, if you do a cos(a), then the result would have to be rounded to only three values, -1, 0 or 1, and no inbetween. Not exactly useful. Before having all kind of math and trig function accessible in script, we'd need the type "float" handled in scripts. That or try to think of tricky workaround to store useful trigonometric results in integers.

By the way, the get ATAN and get XZ_ATAN aren't exactly the pure mathematical arctangent function. They're more like the (cartesian coordinates)->(angle in polar coordinate) conversion function.

And in scripts angle aren't measured in radiant, but in units that makes 65536 equal to a full circle (360°). If you're used to using degree in scripts, it's just that < > is a preprocessing command multiplying the value inbetween by 182.