Gamestudio Links
Zorro Links
Newest Posts
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, VoroneTZ), 1,258 guests, and 4 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
problem with ent_createlocal #306981
01/26/10 12:08
01/26/10 12:08
Joined: Jan 2010
Posts: 16
W
wacek Offline OP
Newbie
wacek  Offline OP
Newbie
W

Joined: Jan 2010
Posts: 16
Hello

I have simple code for create entity, but not works and I have no idea why.

Code:
#include <acknex.h>
#include <default.c>
#define PRAGMA_PATH "pix";
#define PRAGMA_PATH "maps";
#define PRAGMA_PATH "models";

ENTITY* postac1 =
{
type = "postac1.mdl";
layer = 2;
x = 0;
y = 0;
z = 37;
flags = SHOW;
}
function main()
{
	level_load("level1.wmb"); //wczytuje pierwsza mape z wyborem postaci
	wait(-2);
	ent_createlocal(postac1, vector(0,0,37), NULL);
	
}



My model are in "models" folder.
as I run the program shows the error
"Can't open file"

Last edited by wacek; 01/26/10 12:13.
Re: problem with ent_createlocal [Re: wacek] #306984
01/26/10 12:38
01/26/10 12:38
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
This is a common mistake, your making a view entity and try to create a world entity from that.
You dont need the ent_createlocal at all, they view entity will show up anyway.
Try it without that laugh

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: problem with ent_createlocal [Re: wacek] #306985
01/26/10 12:39
01/26/10 12:39
Joined: Mar 2009
Posts: 112
Germany
K
KDuke Offline
Member
KDuke  Offline
Member
K

Joined: Mar 2009
Posts: 112
Germany
It would be more like this:

Code:
#include <acknex.h>
#include <default.c>
#define PRAGMA_PATH "pix";
#define PRAGMA_PATH "maps";
#define PRAGMA_PATH "models";

ENTITY* postac1 = null;

function main()
{
	level_load("level1.wmb"); //wczytuje pierwsza mape z wyborem postaci
	wait(-2);
	postac1 = ent_create("postac1.mdl", vector(0,0,37), NULL);
	
}



greetings K-Duke

Last edited by KDuke; 01/26/10 12:40.

Using A7 Free
Click and join the 3dgs irc community!
Room: #3dgs
Re: problem with ent_createlocal [Re: wacek] #307406
01/29/10 02:43
01/29/10 02:43
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Originally Posted By: KDuke
It would be more like this:

Code:
#include <acknex.h>
#include <default.c>
#define PRAGMA_PATH "pix";
#define PRAGMA_PATH "maps";
#define PRAGMA_PATH "models";

ENTITY* postac1 = null;

function main()
{
	level_load("level1.wmb"); //wczytuje pierwsza mape z wyborem postaci
	wait(-2);
	postac1 = ent_create("postac1.mdl", vector(0,0,37), NULL);
	
}



greetings K-Duke
1stly, remove the ; you have after #define PRAGMA_PATH "pix" ("maps" and "models") this should then locate your model

Originally Posted By: Helghast
view entity will show up anyway.
Try it without that laugh

regards,
Incorrect.
View entities are always drawn based on the views position, if you're trying to create something that's always in 1 place on the camera, use a view entity, otherwise use ent_create, (or if you're doing multiplayer scripts use ent_createlocal, to make it appear only on the client (though ignore that for now)). You'll need to set flags2 = SHOW; instead of flags = SHOW;
and change the z = 37; to x = 37;

if you're trying to create a view entity,
Code:
ENTITY* postac1 =
{
type = "postac1.mdl";
layer = 2;
x = 0;
y = 0;
z = 37;
flags = SHOW;
}//change this to

ENTITY* postac1 =
{
type = "postac1.mdl";
layer = 2;
x = 37;
y = 0;
z = 0;
flags2 = SHOW;
}



if you want the entity specifically at (0, 0, 37) in world coordinates, use KDudes' example, but still remove the ; on lines 3,4 and 5

Hope this helps


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