Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
2 registered members (AndrewAMD, dpn), 1,328 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
'FIXED' to 'struct ENTITY' ? #391002
01/06/12 22:05
01/06/12 22:05
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
Hi all.

Again, I have some problems converting some scripts to Lite-c.

I get an error when I run my project in this action :

...

ENTITY* Tyre;

...

action ATestTyre()
{
while(!TestCar)
{
wait(1);
}
VECTOR* temp;
VECTOR* temp2;
VECTOR* temp3;
VECTOR* dist;
VECTOR* Meio;
var SusPos ;
var UpForces;
var DownForces;
var ResultingForce;
var YouCanMove;
var Id = 0;

c_setminmax(me);
my.MaxCoilPressure = 150;
set (my,PASSABLE);
my.MinCoilPressure = 1;
my.MinDamperPressure = 0.3;
my.MaxCourse = 4;
my.SuspPosition = 1;
my.z = 1470;
my.VertSpeed = 0;
set(my,SHADOW);
my.TyreRay = 9.310;

---> Tyre[my.Ent_Id] = handle(me);

Error in line 267 :
Can not convert 'FIXED' to 'struct ENTITY'

I dont have a clue of why this happens.
Miserably I´m still very very rusty at Lite-c.

Any help will be highly appreciated.

Thx in advance.

Re: 'FIXED' to 'struct ENTITY' ? [Re: Carloos] #391006
01/06/12 22:38
01/06/12 22:38
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
You basically say that you want to go from a pointer (ENTITY*) to the original data (ENTITY), check the asterisk there!, by writing Tyre[ index ]. That's what happens in an array.

But you don't have an array: ENTITY* Tyre;
This is an array: ENTITY* Tyre[10];
Creating an array like that is in essence like saying: "give me an array of 10 elements from the type ENTITY*" (check the asterisk there). Then you have an array of 10 ENTITY pointers, and are able to assign an ENTITY* to an index in the array.

The compiler says you can't convert a FIXED variable (meaning the pointer that you get back from handle(me)) into a 'struct ENTITY' (meaning the ENTITY (no asterisk) from Tyre[ index ]).

Put into simple code, you're doing this:
ENTITY tyre = (ENTITY*)handle( me );
And a pointer (right part) can not be stored in a structure (left part).


Click and join the 3dgs irc community!
Room: #3dgs

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