How to create rotating doors?

Discuss the construction of maps and the tools to create maps for 3D games.
Nash
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

I'm sorry but I'm afraid this is all overwhelming my brain. I just simply don't get it. :(

Can you or anyone else post an example uncompiled map file and example QC on how to make a rotating door similar to Chris' tutorial?
Preach
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Post by Preach »

When I suggested hipnotic, I just meant use the code for the "rotate_object" but make it solid, rather than using the pusher walls and that stuff.

http://www.btinternet.com/~chapterhonour/gateway.zip
contains three example maps. The gateway - before copy is just for reference, it shows how the map looks before the files are split. Note that for the door_001 map, all of the brushes have been moved to world, so that it would compile. Compile the door_001 and the gateway map and load the latter. The only change to the code you need to make it to add

precache_model (self.model);
above
setmodel (self, self.model);

in the spawn function.

If you ever figure out how to make origin brushes work you won't have to do the seperated files, but bear in mind you also need the compiler to support origin brushes. You may also need a texture called origin in your wad - although it doesn't matter what the texture looks like, it might matter if it's absent.
Hipnotic has another way of resetting the origin, which is built into the compilers and is a huge hack. If you want to do things that way, then you'll need to obey their naming conventions. In fact, the best way to do that is to practice a few times by making maps for the hipnotic mod, without changing any of the code. Once you've got your head around the map compiling side, you can start to adapt the code, make brushes solid etc.
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

Waffles.
Chris
Posts: 79
Joined: Sat Aug 05, 2006 5:31 am

Post by Chris »

To do this make a brush that you want as your door, then make another brush where you want the hinge of the door to be. This second brush you should apply the "origin" texture. If you're using Worldcraft you may have to make a texture called origin and add it to a .wad. (However I wrote this tutorial with q3bsp in mind, where the origin texture is found in the 'common' folder.).

Now with both of your brushes selected, Tie to Entity and rename the entity's classname to func_door_rotating. However on top of this I wrote that tutorial about a year ago and didn't have the code to fully understand the player's origin relevant to the door and choosing sides, so I documented the 'setpointdoor' key you can add to the door, to decide which way it swings.




example in gtkradiant:

Image

edit:

I remember the Quake map format not supporting origin brushes, they however are supported in Half-life1, and Quake3 bsp formats which Darkplaces supports.
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

Chris: it doesn't have to do with the map format, really. It has to do with the compiler. Origin brushes have been used by many a mappers in the past, just fine, including myself.
I was once a Quake modder
Nash
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Hmmm it seems LH's hmap2 doesn't like origin brushes. I did exactly per Chris' instructions but the origin brush literally appears in-game and the door is still rotating around the world's origin.

I'll try reading up on the other map formats (maybe HL or Q3) and see if I can switch map formats.

So much to learn...
Nash
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Does anyone know what compilers support origin brushes?

The ones I tried so far (hmap2, txqbsp) doesn't work at all.
LordHavoc
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA
Contact:

Post by LordHavoc »

Nash wrote:Hmmm it seems LH's hmap2 doesn't like origin brushes. I did exactly per Chris' instructions but the origin brush literally appears in-game and the door is still rotating around the world's origin.

I'll try reading up on the other map formats (maybe HL or Q3) and see if I can switch map formats.

So much to learn...
hmap2 doesn't support origin brushes, it does support the hipnotic mission pack entities (which are really not that fun to use) like all the other quake1 map compilers.

I'd appreciate a patch adding origin brush support if anyone feels like coding it though.

You can manually set the entity origin by adding an origin key in the entity key/value editor however, just type in the exact coordinates of the center of rotation you want.
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

I'm confused. Maybe I used a sort of origin entity
I was once a Quake modder
Nash
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

LordHavoc wrote: You can manually set the entity origin by adding an origin key in the entity key/value editor however, just type in the exact coordinates of the center of rotation you want.
That was one of the first things I tried earlier. I created a brush, textured it to look like a door, turned it into an entity, gave it a class name of "func_door_rotating", added a key to it called "origin" and entered the coordinates.

What happened was, when I test the map, the brush still rotates around the world's origin, and when I re-open the map in Worldcraft 3.3, the origin key is gone.
Preach
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Post by Preach »

That's because worldcraft strips out origin keys from brush entities, assuming they shouldn't be there. Perhaps it would be better to give it a unique key name like _rotate_origin for the compiler to read, which is then interpreted as the origin both for rotational centre and for the origin of the entity(so it appears in the right place in game).
Nash
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

I give up. I guess it'll just never happen for me. :(

Thanks to everyone who tried to help.
Preach
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Post by Preach »

Don't give up, the external model method works regardless of the compiler, which is why I recommend it, at least for now. It will work with solid rotation in dp, as the example map above shows.
LordHavoc
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA
Contact:

Post by LordHavoc »

Nash wrote:That was one of the first things I tried earlier. I created a brush, textured it to look like a door, turned it into an entity, gave it a class name of "func_door_rotating", added a key to it called "origin" and entered the coordinates.
func_door_rotating? That sounds like one of the hipnotic entities (in for example, custents, hipnotic, or Quoth), although not quite the right name.

Those require several entities to work, if I recall correctly you create an info_null which is the center of rotation, put your brushes in a rotate_object which targets the info_null, and put the behavioral settings in a func_door_rotate entity. Then to make it collidable you had to make a bunch of func_movewall boxes which are also children of the func_door_rotate, and are like a chopped up bunch of cubes in the same shape as the rotate_object (these move around with it and do not rotate, pushing or blocking the player if appropriate, approximating the rotating shape).

There appears to be a short tutorial on the use of hipnotic rotating entities on the Quoth tutorial page.

DarkPlaces however supports true rotating brushes, but you still need a mod to make them work.

Since func_door_rotating is not a hipnotic entity, I must ask, what mod?

dpmod has its own func_rotatingdoor and func_rotatingobject entities, which contain brushes, and target a info_rotate to set the center of rotation, which sounds more like what you're doing.

Oh and I'd recommend the BSP quake editor http://www.bspquakeeditor.com instead of WorldCraft if you can cope with the learning curve, it's a more technical editor and directly supports Quake1 (unlike WorldCraft 3).
Nash
Posts: 95
Joined: Fri Oct 19, 2007 5:56 pm
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

LordHavoc:

1) func_door_rotating is Chris' rotating door code, which I linked to in my first post in this thread.

2) Where is the QC code for dpmod's rotating entities? I can't find them in your mod's QC folder.

3) Yes, I am considering stuffing WC and learning BSP.
Post Reply