More script get/set fun

More script get/set fun

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

More script get/set fun

Post by FLOZi »

Some basic trig functions would be handy when doing some particular complex animations.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post 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...
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post 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.
User avatar
unpossible
Posts: 871
Joined: 10 May 2005, 19:24

Post 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?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

There's also XZ_ATAN which gives you atan of packed coordinates.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post 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.
Post Reply

Return to “Feature Requests”