ent_create

Posted By: joh

ent_create - 01/30/10 09:34

is there limit for using ent_create?

here's my main but the last object that i load using ent_create says can't open file but when i swap it to the
court.mdl position and put it on comment it works. but when it comment it out the court.mdl which is now at the end after i swap them says can't open file again.

anyone knows how to solve this?


function main(){
//Load the level
level_load(level);
wait(1);
active_building = 1; //Admin building loaded

//Show Main Menu on startup
display_main_menu();
activate_caption_checker();

//Make background blue
vec_set(screen_color,vector(255,255,255));

//Set mouse mode
mouse_mode = 4;

//Set the sky color
sky_color.red = 150;
sky_color.green = 150;
sky_color.blue = 200;

//Create the player and have him run "player_control" function
//Player = ent_create("models//player.mdl", vector(-2490,-2630,70), player_control);

//Set camera at birds eye level

camera.x = 10362;
camera.y = -5322;
camera.z = 50000;

camera.tilt = -90;
camera.pan = 0;
camera.roll = 0;

camera.clip_far = 100000;


//Create Buildings


//Create VPA Building
Building = ent_create("vpa.mdl", vector(25,25,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;

//Create VPA Extension Building
Building = ent_create("vpa_extension.mdl", vector(-6200,-800,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;

//Create Brickyard
Building = ent_create("brickyard.mdl", vector(6000, -9500,-100), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;

//Create Engineering Building
Building = ent_create("engineering.mdl", vector(13000,-4500,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;

//Create Centrum Building
Building = ent_create("centrum.mdl", vector(2500,-9000,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;

//Create LCA2 Building
Building = ent_create("lca2.mdl", vector(-4000,-9000,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;

//Create fame Building
Building = ent_create("fame.mdl", vector(20000,-12000,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;


//create court
Building = ent_create("court.mdl", vector(-300,-1800,10),NULL);
Building.polygon = on;
Building.push = 100;

//road
Building = ent_create("road.mdl", vector(0,0,10),NULL);
Building.polygon = on;
Building.push = 100;


//Main Loop
while(1){
update_date();
sleep(1);
}
}
Posted By: Tempelbauer

Re: ent_create - 01/30/10 12:46

i would check if the file is corrupt. try to open it in med and save it again
Posted By: joh

Re: ent_create - 01/30/10 12:59

i did but still the same error
Posted By: EvilSOB

Re: ent_create - 01/30/10 13:41

I believe the problem is that ALL these entities are being jammed into
the "Building" pointer too fast.

To test this, put a "wait(1);" between each building type.

I think what is currently happening is that "court.mdl" is large,
and is still being loaded when the next ent_create gets processed.
Because court.mdl is still being loaded, then "road.mdl" CANT get loaded,
because the Building pointer is still "busy". Hence the error.

But why are you putting all the entities into the single Building pointer anyway?
The Building pointer will only store the last one you ent_create, and all the
other entities will still exist, but you will have no way of accessing them.
Posted By: joh

Re: ent_create - 01/30/10 13:56

here's what i have now but still the same error. but since road is at the end the error now is in road and not in court

function main(){
//Load the level
level_load(level);
wait(1);
active_building = 1; //Admin building loaded

//Show Main Menu on startup
display_main_menu();
activate_caption_checker();

//Make background blue
vec_set(screen_color,vector(255,255,255));

//Set mouse mode
mouse_mode = 4;

//Set the sky color
sky_color.red = 150;
sky_color.green = 150;
sky_color.blue = 200;

//Create the player and have him run "player_control" function
Player = ent_create("models//player.mdl", vector(-2490,-2630,70), player_control);

//Set camera at birds eye level
/*
camera.x = 10362;
camera.y = -5322;
camera.z = 50000;

camera.tilt = -90;
camera.pan = 0;
camera.roll = 0;

camera.clip_far = 100000;
*/

//Create Buildings

//Create VPA Building
Building = ent_create("vpa.mdl", vector(20,20,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;
wait(1);
//Create admin Building
Building = ent_create("admin.mdl", vector(-6200,-2000,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;
wait(1);
//Create Brickyard
Building = ent_create("brickyard.mdl", vector(5500,-6850,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;
wait(1);
//Create Engineering Building
Building = ent_create("engineering.mdl", vector(15000,300,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;
wait(1);
//Create Centrum Building
Building = ent_create("centrum.mdl", vector(2000,-10600,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;
wait(1);
//Create LCA2 Building
Building = ent_create("lca2.mdl", vector(-4000,-9000,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;
wait(1);
//Create fame Building
Building = ent_create("fame.mdl", vector(20000,-15000,0), NULL);
Building.passable = off;
Building.polygon = on;
Building.push = 100;
wait(1);

Other = ent_create("court.mdl", vector(-300,-1800,10),NULL);
Other.polygon = on;
Other.push = 100;
wait(1);

Other = ent_create("road.mdl", vector(-300,-1800,10),NULL);
Other.polygon = on;
Other.push = 100;
wait(1);

//Main Loop
while(1){
update_date();
sleep(1);
}
}
Posted By: joh

Re: ent_create - 01/30/10 13:59

any more idea sir? thanks
Posted By: joh

Re: ent_create - 01/30/10 14:06

@EvilSOB it works now. thanks a lot i reopen it and then try again now it works fine thanks a lot for your help! God Bless.
Posted By: joh

Re: ent_create - 01/30/10 14:08

ohh the error is back again when i try it again frown
Posted By: EvilSOB

Re: ent_create - 01/30/10 16:29

OK, seeing as it is intermittant, it still doesnt tell prove me wrong...
Now you can remove all those wait's you added. That was just for testing.

So for our next test try creating a new pointer called court.
And put the court.mdl into it, but dont put any other entities in it...

If that STILL doesnt fix it, put court.mdl last and see how that goes.
Posted By: joh

Re: ent_create - 01/30/10 16:48

still it doesn't work..

when i put the court.mdl at the last part then the error now that can't open file is the court
Posted By: EvilSOB

Re: ent_create - 01/30/10 21:05

So its always the court.mdl that causes errors then?
(if I understand your initial post correctly, it was a bit 'blurry')

with all the 'building' models you ent_create, you dont tell them to
go to the 'models' folder. By this I assume these models arent in it.
Is this also true for court.mdl?

This can sometimes be tricky, because I found in the past if you
are using WED, and place models from another directory, it places
copies of them to the game folder...
Posted By: joh

Re: ent_create - 01/31/10 03:41

my models are placed in only one folder which i put in path..
if i put the road in comment court will work but if i put court in comment road will work. but if i comment out both the last mdl will be the one that will cause error
Posted By: EvilSOB

Re: ent_create - 01/31/10 14:27

It just doesnt make sense...

OK, try putting this line after the last ent_create,
but before the main-loop.
while(key_space) { wait(1); }

and see how that goes...
Posted By: joh

Re: ent_create - 01/31/10 16:21

alright the same error BUT the road.mdl is in the last line but it wasn't cause the error but the court.mdl so i tried to make new one and still the same error
Posted By: EvilSOB

Re: ent_create - 01/31/10 17:07

Its got me stumped...
Is therre any way for you to post a zip or rar of the whole project?
Scripts and models included...

AND what version of A7 are you using?
Posted By: joh

Re: ent_create - 01/31/10 19:38

http://hotfile.com/dl/26597326/88ff82d/CdDMap.rar.html

here's the link...

im using
A7 Pro
Posted By: EvilSOB

Re: ent_create - 02/01/10 12:01

Works perfectly for me. No errors at all.

But I dont have any controllers besides mouse and keyboard, so I
couldnt do much beyond looking at the map (in the explore option).

FYI I tested it using A7 commercial version 7.80.0
Posted By: joh

Re: ent_create - 02/01/10 12:15

oohhh what might cause the errors?is it the version?
Posted By: zwecklos

Re: ent_create - 02/01/10 13:19

maybe its an issue with the nexus...
can you try to increase this value? you can find it some where under map properties.

although the error message should say "nexus too small", but I can not see what else it could be except the version you are using, like EvilSOB mentioned.

cheers
Posted By: joh

Re: ent_create - 02/01/10 13:54

how am i going to increase nexus?
Posted By: joh

Re: ent_create - 02/01/10 14:01

alright i put 200 on nexus but still error occurs...
© 2024 lite-C Forums