0 registered members (),
1,382
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
ent_create
#307576
01/30/10 09:34
01/30/10 09:34
|
Joined: Nov 2009
Posts: 96 philippines
joh
OP
Junior Member
|
OP
Junior Member
Joined: Nov 2009
Posts: 96
philippines
|
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); } }
|
|
|
Re: ent_create
[Re: joh]
#307608
01/30/10 13:41
01/30/10 13:41
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
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.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: ent_create
[Re: EvilSOB]
#307611
01/30/10 13:56
01/30/10 13:56
|
Joined: Nov 2009
Posts: 96 philippines
joh
OP
Junior Member
|
OP
Junior Member
Joined: Nov 2009
Posts: 96
philippines
|
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); } }
|
|
|
Re: ent_create
[Re: joh]
#307632
01/30/10 16:29
01/30/10 16:29
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
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.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|