Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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