.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...

Forum Thread
by member
  Posts  
Hipnotic rotating doors (Groups : qc : Forum : hard_code() : Hipnotic rotating doors) Locked
Thread Options
Oct 6 2012, 10:05pm Anchor

Got a question about the operation of the door seen here: Moddb.com
That is the rotating door found at the 1 player start position on the Hipnotic "Scourge of Armagon" expansion pack start map.
Info about SOA here: Idsoftware.com

The first piece about rotating objects can be read here: Moddb.com

In essence the door is the same - just triggered by a button instead of damage.  And it opens and closes, where the Sarsen block only falls.

You can find a convenient repack of the SOA quake-c here: Moddb.com
(I usually repack the rotation code in all my mods as well - Archon: Moddb.com , Painkeep 2.x: Moddb.com )

Now that we have all the tools, the Question:

>> Can you tell me where in the SOA source-files I'd find the code that makes this possible ?

Hipnotic rotating objects are driven by quake-c.  If you unpack the hipnotic source files linked above you will find the rotating code in "hiprot.qc".  If you wanted to add rotating entity support to any mod that is the file you would need, along with any supporting global and variable definitions.

I dove into the map (found in hipnotic/maps/start.bsp) with quark (quake army knife: Quark.sourceforge.net )
This is a list of entities for that door:

{
"model" "*35"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*36"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*37"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*38"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*39"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*40"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*41"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*42"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*43"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*44"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*45"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*46"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*47"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*48"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*49"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*50"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*51"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*52"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*53"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*54"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*55"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*56"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*57"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*58"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*59"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*60"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*61"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*62"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*63"
"classname" "func_movewall"
"targetname" "t2"
}
{
"model" "*64"
"classname" "func_movewall"
"targetname" "t2"
}
{
"targetname" "damndoor"
"origin" "816 -256 160"
"target" "t2"
"angles" "0 0 90"
"sounds" "3"
"classname" "func_rotate_door"
}
{
"classname" "info_rotate"
"origin" "816 -256 160"
"targetname" "t1"
}
{
"origin" "816 -256 160"
"model" "*65"
"classname" "rotate_object"
"target" "t1"
"targetname" "t2"
}
{
"model" "*29"
"target" "damndoor"
"wait" "4"
"sounds" "3"
"lip" "16"
"angle" "270"
"classname" "func_button"
}

So what does it all do?

The "func_button"  triggers the door between the open and close states.  The door waits in each state.
The "info_rotate"  is the center the "func_rotate_door"  rotates around when the button triggers it.
The "rotate_object"  is the visual appearance of the door specified by "model" "*65".
The many "func_movewall" provide the solidity effect of the door.  This is needed because the visual image of the rotating brushes shown by the rotate_object model are NOT solid.  They cant be!  The movewalls follow the door and provide: solidity open or closed, and crush while moving.
All the "model *" are map brushes supplied to the map compiler (quark has no way to decode these brush objects.)

Rotating objects done with the Hipnotic code base are and will remain a complex chain of entities and code.
I might make a sample map to demonstrate a simple rotating door.

Edited by: numbersix

Reply to Thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.