Amazing!! I know you used SKeyMap to define controls, but when I copy and paste it (lol) into my game, it shows up with an error. I dunno where to put it...
Also, in my Q3 map the camera moves straight through the map. What did you do to create that collision thing? Is it the anim part?
Thx
Latest tut on Quake 3 maps
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
I think it will be much easier for you to use Event Receiver and after that simply call if the key has been pressedAmazing!! I know you used SKeyMap to define controls, but when I copy and paste it (lol) into my game, it shows up with an error. I dunno where to put it...
Also, in my Q3 map the camera moves straight through the map. What did you do to create that collision thing? Is it the anim part?
1) Create event receiver and key array
Code: Select all
bool keys[KEY_KEY_CODES_COUNT];
class Receiver : public IEventReceiver {
public:
virtual bool OnEvent(const SEvent& event) {
//* * * * * * * * * * * * * * * * * * * * * * * * * * * *
if(event.EventType == irr::EET_KEY_INPUT_EVENT)
{
keys[event.KeyInput.Key] = event.KeyInput.PressedDown;
return false;
}
//* * * * * * * * * * * * * * * * * * * * * * * * * * * *
return false;
}
};
Receiver e_receiver;
Code: Select all
createDevice(video::EDT_OPENGL, core::dimension2d<s32>(800,600),32, false, true, false,&e_receiver);
Code: Select all
for(int x=0; x<irr::KEY_KEY_CODES_COUNT; x++) keys[x] = false;
Code: Select all
if (keys[KEY_KEY_W]) { DoSomething(); }
A: He`s loading the level here:
Code: Select all
device->getFileSystem()->addZipFileArchive("./baseq3/baseq3.pk3");
scene::IAnimatedMesh* bspmesh = 0;
bspmesh = smgr->getMesh("nemesis.bsp");
scene::ISceneNode* bspnode = 0;
bspnode = smgr->addOctTreeSceneNode(bspmesh->getMesh(0));
bspnode->setPosition(core::vector3df(0,0,0));
bspnode->setScale( irr::core::vector3df(2,2,2) );
Code: Select all
//triangle selector
scene::ITriangleSelector* selector = 0;
selector = smgr->createOctTreeTriangleSelector(bspmesh->getMesh(0), bspnode, 128);
bspnode->setTriangleSelector(selector);
selector->drop();
D: Add collision to th ecamera here:
Code: Select all
//collision detector animator
scene::ISceneNodeAnimator* anim = 0;
anim = smgr->createCollisionResponseAnimator(selector, camera, core::vector3df(30,50,30),
core::vector3df(0,-100,0),
core::vector3df(0,50,0));
camera->addAnimator(anim);
anim->drop();
http://irrlicht.sourceforge.net/tut007.html
It was very useful for me 5 days ago. And the Irrlicht documentation too.
Good luck!
EDIT: I realized my problem, it was the setPosition
Hi everyone, I have a problem. When I load the default q3 map that comes with irrlicht i have no problems. However, when I load the nemesis map, there are no collisions with the map. The console says:
But the model does not collide.
The code is:
As I said, the node collides with the q3 map in the irrlicht tutorial, but not this one. Any ideas why?
Hi everyone, I have a problem. When I load the default q3 map that comes with irrlicht i have no problems. However, when I load the nemesis map, there are no collisions with the map. The console says:
Code: Select all
Irrlicht Engine version 1.5
Microsoft Windows XP Professional Service Pack 2 (Build 2600)
Using renderer: Direct3D 9.0
NVIDIA GeForce 8600 GT nv4_disp.dll 6.14.11.7516
Loaded texture: textures/nemesis/gray
Loaded texture: textures/nemesis/blue
Loaded texture: textures/nemesis/orange
Loaded texture: textures/nemesis/white
Loaded texture: textures/nemesis/gray.jpg
Loaded texture: textures/nemesis/blue.jpg
Loaded texture: textures/nemesis/orange.jpg
Loaded texture: textures/nemesis/white.jpg
Loaded mesh: nemesis.bsp
Needed 0ms to create OctTree SceneNode.(1 nodes, 44 polys)
Needed 0ms to create OctTreeTriangleSelector.(1 nodes, 44 polys)
The code is:
Code: Select all
device->getFileSystem()->addZipFileArchive("media/baseq3.pk3");
scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("nemesis.bsp");
scene::ISceneNode* q3node = 0;
if (q3levelmesh)
q3node = smgr->addOctTreeSceneNode(q3levelmesh->getMesh(0));
scene::ITriangleSelector* selector = 0;
if (q3node)
{
q3node->setPosition(core::vector3df(-1350,-130,-1400));
selector = smgr->createOctTreeTriangleSelector(
q3levelmesh->getMesh(0), q3node, 128);
q3node->setTriangleSelector(selector);
}
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(selector,pnode, core::vector3df(20,30,20),
core::vector3df(0,-5,0),
core::vector3df(0,0,0));
pnode->addAnimator(anim);
anim->drop();
As I said, the node collides with the q3 map in the irrlicht tutorial, but not this one. Any ideas why?
-
- Posts: 20
- Joined: Wed Sep 09, 2009 11:54 pm
I tried using it with Quake Amy Knife aka Quark, when i tried to load a simple level (one room with a light) the light was in the wrong place and it had pillars that i didn't place in the room. I'll give screen shots in a bit, I want to use quark any suggestions?
nvr mind dumb me never read the pdf , i'll get it working with quark now
nvr mind dumb me never read the pdf , i'll get it working with quark now
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: Latest tut on Quake 3 maps
you need to make a skybox, if it was totally open you would see 'the void' (what is outside the map, bad idea!)
"this is not the bottleneck you are looking for"