Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
4 registered members (TipmyPip, Quad, alibaba, izorro), 545 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Creating ENTITIES ? #249168
01/31/09 18:38
01/31/09 18:38
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
In the manual it talks of 3 methods, ENTITY* which looks like a structure definition, code using ent_create() which is the one I have used and loading via WED.

Can you please explain when I would use ENTITY* rather than ent_create()

The manual misses this obvious question frown

Thanks

Re: Creating ENTITIES ? [Re: dracula] #249170
01/31/09 18:40
01/31/09 18:40
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
You use ENTITY* to create a pointer for an entity which can be used then in code to identify it.
Example:
Code:
ENTITY* myPlayerEnt;
...
myPlayerEnt = ent_create(...);


You can also create screen entities using the ENTITY* statement. This is what is described in the manual.

Re: Creating ENTITIES ? [Re: Xarthor] #249174
01/31/09 18:55
01/31/09 18:55
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
ENTITY* shotgun_onscreen =
{
type = "shotgun.mdl";
layer = 2; // display above view entities with layer 1
flags = VISIBLE;
flags2 = VISIBLE; // visible on screen from the start client_id = camera; // same camera parameters as the default view
x = 100; // place 100 quants ahead of the view
y = -50; // 50 to the right
z = 0; //

as opposed to

ent_create( ....);

What's the difference ?

drac.

Re: Creating ENTITIES ? [Re: dracula] #249175
01/31/09 18:57
01/31/09 18:57
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
K
Kaizen_31 Offline
Newbie
Kaizen_31  Offline
Newbie
K

Joined: Jan 2009
Posts: 33
Philippines, Quezon City
use ENTITY* for some pointers when you create a pointer like when you creating a panel

example
ENTITY* sky =
{
......
}

but when you use ent_create(x,y,vector,action);
thats the time when you place the character that you made
hmm..

hope that helps you..

Kaizen_31

Re: Creating ENTITIES ? [Re: dracula] #249176
01/31/09 18:57
01/31/09 18:57
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
As I said:
ent_create creates a WORLD-ENTITY (in world space)

the example you posted defines an SCREEN-ENTITY which lives on coordinates relative to the camera's position.

Re: Creating ENTITIES ? [Re: Xarthor] #249178
01/31/09 19:02
01/31/09 19:02
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Thank you so much, sometimes I can be quite stupid. It is now clear to me.

The manual is very good but unlike C++, we only have one source of official information and if you don't understand it you are lost sometimes

Thanks

drac.


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