Elevators, doors and the like.

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
tkarkkainen

Elevators, doors and the like.

Post by tkarkkainen »

What would be the easiest way of creating "movable brush" like a door or an elevator? I'm using Quake III maps as my map files and was wondering if it is possible to include moving brushes in the map file.
Tequilla
Posts: 40
Joined: Mon Nov 10, 2003 3:42 pm
Location: Germany
Contact:

Post by Tequilla »

I don't know whether the engine can load Animators from bsp-mapfiles, but it would be a nice feature. If it's not yet supported, I think the best way to do this is to store the entitys in a seperated file, where the meshes and the actions are defined. Then you can read this file from your game, create the meshes and animations and link them with the entity. I would such a file look like this:
---
ENTITYS 1
ANIMATIONS 1
elevator
TRIANGLES 2
ANIMATION ani_elev
TEX elevator.bmp
0.0 0.0 0.0 0.0 0.0
0.0 0.0 1.0 0.0 1.0
1.0 0.0 1.0 1.0 1.0
1.0 0.0 1.0 1.0 1.0
1.0 0.0 0.0 1.0 0.0
0.0 0.0 0.0 0.0 0.0

ani_elev
MOVE 2
PAUSE 100
0.0 0.0 0.0
0.0 100.0 0.0
0.0 100.0 0.0
0.0 0.0 0.0

---
The first line would say how many entitys are defined, and the second how many animations are defined.
Then the name of the first entity and number of triangles defined for that entity, the name of animation linked with this entity and the texturefile for it. Then the coordinates of the triangles are defined:
X Y Z U V (3 times for each triangle)
After defining all triangles the animations are comming.
First the name of the Animation, then how many steps are defined (in this case MOVE, twice), and how long to pause between each step. Finaly the coordinates for the animation are defined. From X Y Z to X Y Z...

That would be my solution. Of course you can make your own format for that, or compile it with a self written programm to a binary file.
Or you find a better way ;)
If you do it like that, the best way to interpret the data would be the sscanf()-function.
Post Reply