using .irr and .pk3

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
invas10n
Posts: 10
Joined: Wed May 28, 2008 4:40 pm

using .irr and .pk3

Post by invas10n »

I saw a tutorial on using collision detection on a .irr file. This is the code that interests me:

Code: Select all

// Setup the ZIP file "MyLevel.pk3" to be read directly        
intro->getFileSystem()->addZipFileArchive("levels/MyLevel.pk3"); 

// Load the scene file from the archive 
smgr->loadScene("MyLevel.irr"); 
intro is the IrrlichtDevice.

This is my code:

Code: Select all

    device->getFileSystem()->addZipFileArchive("media/models/maps/map.pk3");
smgr->loadScene("map.irr");
My question is, I made a .pk3 file containing the .irr file and all meshes and textures in that irr file, but when I use that code and run the game, it doesnt load anything. The error i get is:

Unable to open scene file: map.irr

What am I doing wrong?[/code]
Last edited by invas10n on Wed May 28, 2008 4:56 pm, edited 1 time in total.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

A PK3 is simply a ZIP file that the extension is renamed .PK3

You have to make sure that MyLevel.pk3 (zip renamed file) contain the MyLevel.irr file
radiant
Posts: 112
Joined: Fri Feb 22, 2008 8:04 pm
Location: Mexico

Post by radiant »

change this:

Code: Select all

smgr->loadScene("MyLevel.irr");
to this:

Code: Select all

smgr->loadScene("map.irr");
best regards
invas10n
Posts: 10
Joined: Wed May 28, 2008 4:40 pm

Post by invas10n »

Sorry, I have that. just changed the error so you know im talking about a map... changing that post now...
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

what's the structure of your PK3?

It should be something like this:

Code: Select all

map.pk3
  - directory?
  - directory?
  - map.irr
  - other_file.ext?
obviously the directories and other_file is dependent on what you've got but you certainly need map.irr to be in the root of the pk3.
Image Image Image
invas10n
Posts: 10
Joined: Wed May 28, 2008 4:40 pm

Post by invas10n »

I did have map.irr in the root directory. But I fixed the problem. But maybe you can figure out why?

These didnt work:
.pk3
.dat
.rar

I'm using .zip at the moment and all runs fine. I cant explain it... Can you?
Post Reply