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,561 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
How to create a shadow entity at runtime? #338413
08/17/10 23:59
08/17/10 23:59
Joined: Sep 2004
Posts: 130
Italy
Alessandro Offline OP
Member
Alessandro  Offline OP
Member

Joined: Sep 2004
Posts: 130
Italy
Hello,
I'm modifying the source code of CAR.C in order to automatically load a SHADOW model (MDL) during the wheel loading process (see function "car_wheelcreate()" for more info).

Now I need to refer to an entity with the same name of the wheel, but with the postfix "_shadow". For example, if the car is called FORMULA1.mdl, then the wheel will be FORMULA1_wheel.mdl (it already works in this way). Shadow model for the wheel should be:

FORMULA1_wheel_shadow.mdl

My problem is I cannot load and refer to it at runtime.
For the car body I use a global ENTITY:

Code:
ENTITY* carShadow = {type = "buggy_shadow.MDL"; flags = SHOW; }



But I cannot use the same way for the wheel, since in the function I don't know how that model will be called.
So I tried this code:

Code:
ENTITY* wheelShadow = ent_create(wheel_shadow_name, offset, NULL);
wheel.shadow = wheelShadow;



Where wheelShadow is the entity used to manage the MDL model, and wheel_shadow_name is the full name of the MDL model self.
My problem is the created entity always appear in the screen!
Furthermore, even if I don't get any error, it seems it does not work.

Can you help me please?

Thank you!

Re: How to create a shadow entity at runtime? [Re: Alessandro] #338539
08/18/10 21:33
08/18/10 21:33
Joined: Sep 2004
Posts: 130
Italy
Alessandro Offline OP
Member
Alessandro  Offline OP
Member

Joined: Sep 2004
Posts: 130
Italy
Hello, I red my post again and I found a small mistake in my code:

Code:
ENTITY* carShadow = {type = "buggy_shadow.MDL"; }



Flag TYPE does not contain "SHOW".
Basically my question is:

if I can load a shadow entity by defining a global variable defined as:

Code:
ENTITY* carShadow = {type = "buggy_shadow.MDL"; }



How can I define it using code and local variables?
It seems it the previous code example the model is not shown, instead if I use the following code the model is shown in the 3D environment:

Code:
ENTITY* carShadow = ent_create("buggy_shadow.MDL", offset, NULL);
car.shadow = carShadow;



Thank you!


Moderated by  HeelX, Spirit 

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