nothing really breathtaking... just an alternate way to do what typically was done using exitfade() to load a new level...
this way uses iObjectRefresh() to replace the old level with some new stuff...
the video shows in real time how quickly a 2200 x 2200 meter level loads (about 3 seconds start counting from the time the boulder stops moving)...
the next one takes a lil longer because both the terrain and the skybox are being replaced...
http://www.youtube.com/watch?v=YADG1UrNOQc
your initial levels can load faster as well seeing as they're just place holders...
the code looks like this...
--Mike
this way uses iObjectRefresh() to replace the old level with some new stuff...
the video shows in real time how quickly a 2200 x 2200 meter level loads (about 3 seconds start counting from the time the boulder stops moving)...
the next one takes a lil longer because both the terrain and the skybox are being replaced...
http://www.youtube.com/watch?v=YADG1UrNOQc
your initial levels can load faster as well seeing as they're just place holders...
the code looks like this...
Code: [Select]
int level=0, newLevel=0;
void Main()
{
if(iKeyDown(iKeyCode("DIK_1"))) newLevel=1;
if(iKeyDown(iKeyCode("DIK_2"))) newLevel=2;
if(iKeyDown(iKeyCode("DIK_3"))) newLevel=3;
if(newLevel==1 and level!=1){
iObjectRefresh(OBJ_44,".\\3drad_res\\objects\\skinmesh\\data\\testmap\\");
iObjectRefresh(OBJ_66,".\\3drad_res\\objects\\rigidbody\\data\\testmap\\");
iObjectLocationReset(OBJ_88,Vector3(0,35,0));
level=1;
}
if(newLevel==2 and level!=2){
iObjectRefresh(OBJ_0,".\\3drad_res\\objects\\sky 5x 02\\data\\skybox.sky");
iObjectRefresh(OBJ_44,".\\3drad_res\\objects\\skinmesh\\data\\terrain0100\\");
iObjectRefresh(OBJ_66,".\\3drad_res\\objects\\rigidbody\\data\\terrain0100\\");
iObjectLocationReset(OBJ_88,Vector3(0,35,0));
level=2;
}
if(newLevel==3 and level!=3){
iObjectRefresh(OBJ_44,".\\3drad_res\\objects\\skinmesh\\data\\mkx_grassstrip\\");
iObjectRefresh(OBJ_66,".\\3drad_res\\objects\\rigidbody\\data\\mkx_grassstrip\\");
iObjectLocationReset(OBJ_88,Vector3(0,35,0));
level=3;
}
}
--Mike