Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Kikutaâ„¢ on Wed 04/05/2005 15:01:39

Title: [basic scrip] Float to int.
Post by: Kikutaâ„¢ on Wed 04/05/2005 15:01:39
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 ?
Title: Re: [basic scrip] Float to int.
Post by: GarageGothic on Wed 04/05/2005 15:11:53
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
Title: Re: [basic scrip] Float to int.
Post by: Kikutaâ„¢ on Wed 04/05/2005 15:18:40
I hvae the ags 2.6 . And this version of ags doesnt have the FloatToInt function.
Title: Re: [basic scrip] Float to int.
Post by: GarageGothic on Wed 04/05/2005 15:26:50
Um, how about upgrading it? 2.7 final is out, you know.
Title: Re: [basic scrip] Float to int.
Post by: Kikutaâ„¢ on Wed 04/05/2005 15:31:31
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
Title: Re: [basic scrip] Float to int.
Post by: 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 ;)
Title: Re: [basic scrip] Float to int.
Post by: TerranRich on Wed 04/05/2005 16:26:09
Does v2.6 even support floating numbers? I did not know that.
Title: Re: [basic scrip] Float to int.
Post by: Kikutaâ„¢ on Wed 04/05/2005 18:00:23
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.
Title: Re: [basic scrip] Float to int.
Post by: Pumaman on Wed 04/05/2005 18:30:48
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.
Title: Re: [basic scrip] Float to int.
Post by: TerranRich on Wed 04/05/2005 19:45:40
You heard it from the man himself. Upgrading to v2.7 is basically your only option for converting floats to ints.