Game Development Community

Script datatype question...

by Matt Rains · in Technical Issues · 12/31/2004 (7:16 am) · 3 replies

Ok... I've been getting prty familier now with the engine. But sometimes I still have a few problems doing simple things.

I've tried looking through documentation about using datatypes in scripts...

here is an example that I cannot get to work.

say:
%x = 66;
%y = 12;

%z = %x / %y;

%z no equals 5.5...

but I only want to have 5 in there... like it's an int.

I've tried uning int since it is declared in the ConsoleTypes... but I'm not sure of the syntax or what I should use...

can someone please clearup using datatypes in script? or point me to a link that will do so... thanks..

#1
12/31/2004 (7:22 am)
Actually, your main problem is that there really aren't any data types within script at the moment (based on Ben Garney's plan several days ago, datatypes of some form may be implemented well in the future, but it's not a promise!). In some special cases (like datablocks) you can use some functionality that implies there is inherent data type checking, but it's not really the case.

The solution to your specific example is the mFloor script function, which would be used like this:

%z = mFloor(%x/%y);
#2
12/31/2004 (8:12 am)
Sweet! perfect man...

Thanks for the simple yet very informative answer.
#3
12/31/2004 (9:54 am)
Stephen is full of them