I was able to go from flarge to castle using this code. Thank you. I should be
set to use this code in my game.
However, if I tried to go from castle to castle, I got some errors:
Popup error:crystalspace.maploader.parse.trigger: Duplicate sequence
'LaIpoLamp.014' ! [node:world,sequences(name=LaIpoLamp.014)]
I click OK
I get another popup error: CrystalSpace.SimpleMap: Error couldn't load level!
The above error comes from the code error given in the bottom code.
Console errors:
crystalspace.renderloop.loop.loader:
Couldn't register render loop 'std_rloop_diffuse'. Maybe a loop of the same
name already exists?
[node: params]
Warning: Missing charsets in String to FontSet conversion
crystalspace.maploader.parse.trigger: Duplicate sequence 'LaIpoLamp.014'!
crystalspace.maploader.parse.trigger: [node:
world,sequences,sequence(name=LaIpoLamp.014)]
Warning: Missing charsets in String to FontSet conversion
CrystalSpace.SimpleMap: Error couldn't load level!
If I tried to go from flarge to flarge, I got some errors:
Popup error: crystalspace.maploader.parse.trigger: Duplicate sequence
'fogloop'! [node: world,sequences,sequence(name=fogloop)]
I click OK
I get another popup error: CrystalSpace.SimpleMap: Error couldn't load level!
The above error comes from the code error given in the bottom code.
Console errors:
crystalspace.renderloop.loop.loader:
Couldn't register render loop 'std_rloop_diffuse'. Maybe a loop of the same
name already exists?
[node: params]
Warning: Missing charsets in String to FontSet conversion
crystalspace.maploader.parse.trigger: Duplicate sequence 'fogloop'!
crystalspace.maploader.parse.trigger: [node:
world,sequences,sequence(name=fogloop)]
Warning: Missing charsets in String to FontSet conversion
CrystalSpace.SimpleMap: Error couldn't load level!
Nagy József <[EMAIL PROTECTED]> wrote: I used this code to load new levels:
bool cimGame::LoadMap (const char* mapname)
{
//Delete the engine's content.
engine->DeleteAll();
// Set VFS current directory to the level we want to load.
csRef<iVFS> VFS (CS_QUERY_REGISTRY (GetObjectRegistry (), iVFS));
VFS->ChDir (mapname);
// Load the level file which is called 'world'.
if (!loader->LoadMapFile ("world"))
ReportError("Error couldn't load level!");
// Initialize collision objects for all loaded objects.
csColliderHelper::InitializeCollisionWrappers (cdsys, engine);
// Let the engine prepare all lightmaps for use and also free all images
// that were loaded for the texture manager.
engine->Prepare ();
// Find the starting position in this level.
csVector3 pos (0);
if (engine->GetCameraPositions ()->GetCount () > 0)
{
// There is a valid starting position defined in the level file.
iCameraPosition* campos = engine->GetCameraPositions ()->Get (0);
room = engine->GetSectors ()->FindByName (campos->GetSector ());
pos = campos->GetPosition ();
}
else
{
// We didn't find a valid starting position. So we default
// to going to room called 'room' at position (0,0,0).
room = engine->GetSectors ()->FindByName ("room");
pos = csVector3 (0, 0, 0);
}
if (!room)
ReportError("Can't find a valid starting position!");
// Now we need to position the camera in our world.
view->GetCamera ()->SetSector (room);
view->GetCamera ()->GetTransform ().SetOrigin (pos);
// Initialize our collider actor.
collider_actor.SetCollideSystem (cdsys);
collider_actor.SetEngine (engine);
csVector3 legs (.2f, .3f, .2f);
csVector3 body (.2f, 1.2f, .2f);
csVector3 shift (0, -1, 0);
collider_actor.InitializeColliders (view->GetCamera (),
legs, body, shift);
return true;
}
2007/5/28, Jim Sager <[EMAIL PROTECTED]>: Using the application simpmap, I
would like to be able to hit the downarrow key and unload "flarge", and load up
"castle"
I tried the code:
if (kbd->GetKeyState (CSKEY_DOWN))
{
csRef<iVFS> VFS (CS_QUERY_REGISTRY (GetObjectRegistry (), iVFS));
VFS->ChDir ("/lev/castle");
loader->LoadMapFile ("world");
}
Also is there a way to unload "EVERYTHING" in the engine and start from
scratch?
Yes, use the IEngine->DeleteAll() function.
If not, I'll have to take careful measure to deallocate all the memory before
loading the new world.
,CrazyJim
---------------------------------
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto: [EMAIL PROTECTED]
--
Jocó -------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]
---------------------------------
Pinpoint customers who are looking for what you sell. -------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]