Quake3 map, GEEE ... where are my elevators ???!

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
bonsalty
Posts: 120
Joined: Thu Dec 10, 2009 1:30 pm
Location: Budapest,Hungary

Quake3 map, GEEE ... where are my elevators ???!

Post by bonsalty »

After solving the transparency issues with the shader, I came across another puzzle:
As you know quake3 bsp maps can have elevators, rotating objects and other stuff by default. I have a moving brigde over sewage treatment settler, which is called
func_bobbing in gtkradiant "Solid entity that oscillates back and forth in a linear motion. ...Entity bobs on the Z axis (up-down) by default. ".
The animated solid is than compiled into the same bsp.
Questions:
What am I doing wrong? ( Im using the quake3 map example 21)
Why is my object not appearing in Irrlicht? Do I have to start some animation in irrlicht for the map? Is it supported anyway?
Image
Tomi
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Quake3 map, GEEE ... where are my elevators ???!

Post by hendu »

None of the magic objects are automatically supported, that is, doors won't auto-open, triggers, elevators and whatnot do not have implementations. This is because it's out of scope for a rendering engine: your game might be using physics engine Y, and handle shooting in a completely different way than Q3.

Irr enumerates all brush entities, you can query them in your code, and then do whatever you like with them. This enables you to, for example, create func_myxmastree and have some weird christmas tree there that reacts to a button toggle. An example with a door can be found in the patches tracker.
bonsalty
Posts: 120
Joined: Thu Dec 10, 2009 1:30 pm
Location: Budapest,Hungary

Re: Quake3 map, GEEE ... where are my elevators ???!

Post by bonsalty »

OK thanks I get it, but my stupid question would be :what is the "patches tracker"? Im doing advanced search across the forum since hours and havent found it.
There are examples how to find the position for the players starting position or how to add external md2 animations, but the thing is, I need the bobbingmesh from the bsp and activate it anyway.
Tomi
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Quake3 map, GEEE ... where are my elevators ???!

Post by hendu »

Oh, forgot to add, you really should enable aniso for that arrow mesh.
bonsalty
Posts: 120
Joined: Thu Dec 10, 2009 1:30 pm
Location: Budapest,Hungary

Re: Quake3 map, GEEE ... where are my elevators ???!

Post by bonsalty »

Mipmap disable can also do the job...
driver->setTextureCreationFlag( video::ETCF_CREATE_MIP_MAPS, false);
Thanks, will check the links above.
Tomi
bonsalty
Posts: 120
Joined: Thu Dec 10, 2009 1:30 pm
Location: Budapest,Hungary

Re: Quake3 map, GEEE ... where are my elevators ???!

Post by bonsalty »

***********SOLVED*************
Thanks, marvelous!
Took the code from there and it works, now those elevators, doors etc also appear with the bsp but without the rotating, moving animations. Since you can get a reference to the meshes its very easy to make them animated like in the game. For those who were coping with the same problem: If you have static animation objects in the map
they are called func_bobbing , func_rotate etc. in gtkradiant. For making the func_bobbing (func_bobbing animates an object to move forth and back) objects appear, here is the code (put it into irrlicht exampe 16):

Code: Select all

 
quake3::tQ3EntityList &entityList = mesh->getEntityList();
quake3::IEntity search;
    IMesh *static_animations = 0;
 
search.name = "func_bobbing";  // this is what we are looking for
 
s32 index = entityList.binary_search(search); // search in bsp file
if (index >= 0) 
{
    static_animations = mesh->getBrushEntityMesh(entityList[index]); // get the reference to the mesh 
}
 
if (!static_animations)
    {
        device->drop();
        return 1;
    }
    
ISceneNode *static_animation_node = smgr->addMeshSceneNode(static_animations ); // add it to the node
core::vector3df closedpos = static_animation_node ->getPosition(); // you can get, set whatever you want with the node later... 
 
As mentioned before, they are still not animated yet, but at least they appear as they should. With the mesh reference and node you can define the proper moving, rotating, oscilating, other behaviours.
Tomi
Post Reply