Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (kzhao, AndrewAMD, bigsmack), 824 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
fixed(var float) ? #224895
09/01/08 20:35
09/01/08 20:35
Joined: Oct 2005
Posts: 57
P
picoder Offline OP
Junior Member
picoder  Offline OP
Junior Member
P

Joined: Oct 2005
Posts: 57
Hello,

In C-script, I can use this function: a = fixed(floatv(x));
and result is x = a
But there isn't fixed() function anymore in lite-c.

For example,
mtl.skill1=floatv(x);
How can I find x value again from mtl.skill1 in lite-c?


Thanks in advance.


Last edited by picoder; 09/01/08 20:39.
Re: fixed(var float) ? [Re: picoder] #224954
09/02/08 07:23
09/02/08 07:23
Joined: Oct 2005
Posts: 57
P
picoder Offline OP
Junior Member
picoder  Offline OP
Junior Member
P

Joined: Oct 2005
Posts: 57
var my_var;
...
my_metarial.skill5 = floatv(500);
...
my_var = my_metarial.skill5; // my_var is 1113728.000
my_var = (var)(my_metarial.skill5); // my_var is 1113728.000
my_var = _VAR(my_metarial.skill5); // my_var is -393216.000

What should I do for my_var is 500? Any idea?

Many thanks in advance.

Re: fixed(var float) ? [Re: picoder] #225003
09/02/08 14:56
09/02/08 14:56
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
skill 5 is of type var but contains a float, so the first thing I'd try is

my_var = *(float*)&(my_material.skill5);


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1