Crystal Space
Welcome, Guest. Please login or register.
April 17, 2014, 04:32:48 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7594 Members
Latest Member: Wandagarcia
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  LoadMapFile doesn't work
« previous next »
Pages: [1] Print
Author Topic: LoadMapFile doesn't work  (Read 5014 times)
Adrian
Newbie
*
Posts: 7


View Profile
« on: April 16, 2006, 04:44:23 pm »

Hi

I am new to CrystalSpace, and I am trying the tutorials in the docs.

I've compiled and run successfully the first tutorial (4.2), but when I run the second tutorial 4.2.3 (Map loading), I get the error
"Could not load level" followed by a program crash. I've tried with other levels, and got the same result.

This is the code:
-------------------------------------
bool Simple::LoadMap ()
{
  // Set VFS current directory to the level we want to load.
  csRef<iVFS> VFS (csQueryRegistry<iVFS> (object_reg));
  VFS->ChDir ("/lev/flarge")

  // Load the level file which is called 'world'.
  if (!loader->LoadMapFile ("world"))
    ReportError("Error couldn't load level!");
  return true;
}
-------------------------------------

My environment:
Windows XP Professional (no service packs)
Bloodshed Dev-C++ IDE 4.9.9.2
MinGW 5.0.2
MSYS 1.0
CrystalFree Pseudo Stable 0.99
Windows Support Libraries 0.99r0_018

I don't know what to try (I am not very proficient in c++) , so any idea would be welcome

Regards
Adrian
Logged
Mick
Guest


Email
« Reply #1 on: April 16, 2006, 10:01:03 pm »

it is essential that iVFS looks the path given in  vfs.cfg   (standard: VFS.Mount.lev/flarge   = $@data$/flarge$/ )

Look inside vfs.cfg for more information.

I suppose so.

greets,
Mick
Logged
Adrian
Newbie
*
Posts: 7


View Profile
« Reply #2 on: April 17, 2006, 05:25:46 pm »

The iVFS is ok, I've checked it with iVFS->Exists("world") and iVFS->GetCwd.

I think the problem is somewhere else...

regards
Adrian
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1704


View Profile
« Reply #3 on: April 17, 2006, 05:27:33 pm »

The iVFS is ok, I've checked it with iVFS->Exists("world") and iVFS->GetCwd.

I think the problem is somewhere else...

regards
Adrian


Where is flarge level? Are you running things from the CS dir or another dir?

Greetings,
Logged
Adrian
Newbie
*
Posts: 7


View Profile
« Reply #4 on: April 17, 2006, 05:37:07 pm »

flarge is located at

C:\cs\share\crystalspace\data\maps\flarge and is mapped in vfs.cfg as

VFS.Mount.lev/flarge   = $(CS_MAPDIR)$/flarge$/

My CS_MAPDIR environment variable points to C:\CS\share\crystalspace\data\maps\

I am running my app from a separate folder, not related to CS folder

Regards
Adrian


Logged
jorrit
Administrator
Hero Member
*****
Posts: 1704


View Profile
« Reply #5 on: April 17, 2006, 05:50:23 pm »

Can you (as a test) try to run the app in the CS folder to see if that works?

Greetings,
Logged
Adrian
Newbie
*
Posts: 7


View Profile
« Reply #6 on: April 17, 2006, 05:55:39 pm »

I copied the .exe to C:\CS and executed,  but I got the same result

regards
Adrian
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1704


View Profile
« Reply #7 on: April 18, 2006, 07:37:25 am »

I copied the .exe to C:\CS and executed,  but I got the same result

regards
Adrian


And walktest works?

Greetings,
Logged
Adrian
Newbie
*
Posts: 7


View Profile
« Reply #8 on: April 18, 2006, 03:35:04 pm »

Yes, it works fine

Regards
Adrian
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1704


View Profile
« Reply #9 on: April 18, 2006, 03:40:04 pm »

Yes, it works fine

Regards
Adrian


And you set the CRYSTAL environment variable to what exactly?

Greetings,
Logged
Adrian
Newbie
*
Posts: 7


View Profile
« Reply #10 on: April 18, 2006, 03:44:38 pm »

CRYSTAL=C:\CS\

When I built CrystalSpace from MSYS, I did ./configure --prefix=/C/CS

Regards
Adrian
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1704


View Profile
« Reply #11 on: April 18, 2006, 05:38:46 pm »

CRYSTAL=C:\CS\

When I built CrystalSpace from MSYS, I did ./configure --prefix=/C/CS

Regards
Adrian


Aha, if you start from msys then you must use:

CRYSTAL=/c/cs

i.e. you must use msys syntax and not dos syntax.

Greetings,
Logged
Adrian
Newbie
*
Posts: 7


View Profile
« Reply #12 on: April 19, 2006, 07:28:02 pm »

Sorry, I didn't explain well. What I meant was that when compiling CS from MSYS, I told configure to install it in /C/CS. I don't execute anything from MSYS, I start the app from Windows. I tried setting CRYSTAL env variable to /C/CS/, just in case, but the problem persists.

Regards
Adrian
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 7.221 seconds with 16 queries.