Page 1 of 1

Can't load pk3 file

Posted: Sat Mar 06, 2010 6:28 pm
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)

Posted: Sat Mar 06, 2010 6:40 pm
by Lonesome Ducky
Sounds like it loaded correctly, it may be that it didn't load the textures or that the model is offscreen.

Posted: Sat Mar 06, 2010 6:50 pm
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);"

Posted: Sat Mar 06, 2010 6:59 pm
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.

Posted: Mon Mar 08, 2010 5:06 pm
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 :(

Posted: Mon Mar 08, 2010 5:40 pm
by CuteAlien
Did you try loading it in example 09 (meshviewer) or example 21 (Quake3Explorer)?

Posted: Mon Mar 08, 2010 6:14 pm
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);

Posted: Mon Mar 08, 2010 6:18 pm
by ent1ty
Go to bin\win32-visualstudio, there are precompiled binaries in there

Posted: Mon Mar 08, 2010 6:47 pm
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"

Posted: Mon Mar 08, 2010 10:17 pm
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.

Posted: Tue Mar 09, 2010 7:07 am
by Moore
But i used it! I have Irrlicht 1.7 and this code is from example/

May it's dev cpp fault

Posted: Tue Mar 09, 2010 8:56 am
by hybrid
Yes, example is correct. However, you're using 1.6 or older headers. This won't work ever.

Posted: Tue Mar 09, 2010 5:24 pm
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.

Posted: Tue Mar 09, 2010 9:02 pm
by hybrid
Maybe wrong paths, incorrect dlls, or whatever. Without a proper information we cannot judge this from here.

Posted: Sun Mar 21, 2010 9:42 am
by Moore
What informations you need?