[basic scrip] Float to int.

Started by Kikutaâ„¢, Wed 04/05/2005 15:01:39

Previous topic - Next topic

Kikutaâ„¢

I'm tring to convert, in ags, a float var into a int.
In C, i use the floor, that uses math.h

So, how can i import a C++ lib into ags ?

GarageGothic

I have no idea what you just said, but if you want to convert a float to int, there's a fine little function called FloatToInt

Kikutaâ„¢

I hvae the ags 2.6 . And this version of ags doesnt have the FloatToInt function.

GarageGothic

Um, how about upgrading it? 2.7 final is out, you know.

Kikutaâ„¢

too lazy to download, and too lazy to change all my script :P and i prefere 2.6 rather than an object oriented ags :P

GarageGothic

You don't have to use object oriented scripting - or change your scripts. 2.7 is backwards compatable. If you're just too lazy to download.. well, I give up ;)

TerranRich

Does v2.6 even support floating numbers? I did not know that.
Status: Trying to come up with some ideas...

Kikutaâ„¢

#7
Quote from: GarageGothic on Wed 04/05/2005 15:34:50
You don't have to use object oriented scripting - or change your scripts. 2.7 is backwards compatable. If you're just too lazy to download.. well, I give up ;)

I know don't have to use ^^Ã,  But i'm like this. It the next ags is object oriented, i dont to have 2 typs of coding in my game. So, i would make myself change every code line i ever made :P


Quote from: TerranRich
Does v2.6 even support floating numbers? I did not know that.

You can't declare a var as float, but I think you can obtain float numbers.

Pumaman

AGS 2.6 doesn't support floating point variables, so what you're asking is pretty much impossible. There was a handy plugin written that allows you to simulate some floating point stuff with 2.6, though.

TerranRich

You heard it from the man himself. Upgrading to v2.7 is basically your only option for converting floats to ints.
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk