Can't load pk3 file

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
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Can't load pk3 file

Post by Moore »

I'm new and i have problem. I try to load my pk3 file, but i see only grey window. It's code:

Code: Select all

#include <irrlicht.h>

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;

int main()

{ 
  IrrlichtDevice* device = createDevice( EDT_OPENGL, dimension2d<s32>(800, 600),
  32, false, false, false, 0);
	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
 
	device->setWindowCaption(L"Test");//nagłówek okna


	device->getFileSystem()->addZipFileArchive("test.pk3");
	IAnimatedMesh* mesh = smgr->getMesh("test.bsp");
    ISceneNode* node = 0;
        
        if (mesh)
                node = smgr->addOctTreeSceneNode(mesh->getMesh(0), 0, -1, 1024);
              node = smgr->addMeshSceneNode(mesh->getMesh(0));
	  smgr->addCameraSceneNodeFPS(); 
	      device->getCursorControl()->setVisible(false); 
	  
	 int lastFPS = -1;

        while(device->run())
        {
                if (device->isWindowActive())
                {
                        driver->beginScene(true, true, SColor(255,200,200,200));
                        smgr->drawAll();
                        driver->endScene();

                        int fps = driver->getFPS();

                        if (lastFPS != fps)
                        {
                                stringw str = L"Irrlicht Engine - Quake 3 Map example [";
                                str += driver->getName();
                                str += "] FPS:";
                                str += fps;

                                device->setWindowCaption(str.c_str());
                                lastFPS = fps;
                        }
                }
                else
                        device->yield();
        } 

	}

In consol is somthing like this:Needed 0ms to create OctTree SceneNode.(0 nodesm o polys)
What?
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Sounds like it loaded correctly, it may be that it didn't load the textures or that the model is offscreen.
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

I used textures form GTKRadiant(specifically-quake3), but i haven't they in my pk3. May it's problem?(i thought, in pk3 must be only myself textures)

Btw. what is 4th argument in " node = smgr->addOctTreeSceneNode(mesh->getMesh(0), 0, -1, 1024);"
What?
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

minimalPolysPerNode. Every part of the oct tree has to have at least that many I'm guessing, so if you lower it there will be more sections.
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

Ok, but what can i do this scene load correctly? You said code is ok.
When i compiled test.map into bsp(by Q3Map2, 11th option) i get tes.:
bsp,bak,prt and srf. I have these files in Maps(Script are empty). I did zip file and changed name into pk3. Something wrong? Why this not working :(
What?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Did you try loading it in example 09 (meshviewer) or example 21 (Quake3Explorer)?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

Yes, but i can't compil it. There are always some errors :/
For example(02.Quake3Map):I have error in

Code: Select all

IrrlichtDevice *device =
		createDevice(driverType, core::dimension2d<u32>(640, 480));
When i write

Code: Select all

IrrlichtDevice *device =
		createDevice(driverType, core::dimension2d<s32>(640, 480));
There is new error(129 'class irr::scene::ISceneManager' has no member named 'addOctreeSceneNode' ).In

Code: Select all

	node = smgr->addOctreeSceneNode(mesh->getMesh(0), 0, -1, 1024);
What?
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

Go to bin\win32-visualstudio, there are precompiled binaries in there
kiwibonga
Posts: 3
Joined: Sun Feb 14, 2010 3:25 am

Post by kiwibonga »

It should be "OctTree" instead of "Octree", assuming you're using an older version of Irrlicht like 1.6... Newer versions call them "Octree"
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Always use the examples which come with the Irrlicht download. The sources are in the examples folder and the Windows executables are,as ent1ty mentioned, in the bin folder.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

But i used it! I have Irrlicht 1.7 and this code is from example/

May it's dev cpp fault
What?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, example is correct. However, you're using 1.6 or older headers. This won't work ever.
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

Uh, sorry i forget i have two verison of irrlicht. In dev i have instaled 1.4 and example is from 1.7. My fault, sorry.

So i used exemaple 2 feom irrlicht 1.4. My application run but again there is only grey window.
What?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe wrong paths, incorrect dlls, or whatever. Without a proper information we cannot judge this from here.
Moore
Posts: 31
Joined: Sat Mar 06, 2010 6:23 pm
Location: Poland

Post by Moore »

What informations you need?
What?
Post Reply