How to create rotating doors?
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.
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.
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:
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.
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:
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.
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...
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.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...
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.
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.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.
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.
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).
func_door_rotating? That sounds like one of the hipnotic entities (in for example, custents, hipnotic, or Quoth), although not quite the right name.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.
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).