More script get/set fun
Moderator: Moderators
More script get/set fun
Some basic trig functions would be handy when doing some particular complex animations.
- unpossible
- Posts: 871
- Joined: 10 May 2005, 19:24
isn't there another one in there too?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.
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.
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.