.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
  Posts  
Hipnotic rotating entities (Groups : qc : Forum : hard_code() : Hipnotic rotating entities) Locked
Thread Options
numbersix
numbersix quake-c coder++
Nov 2 2011 Anchor

Here's a note I sent about rotating entities used under the hipnotic code base:

I'll just warn you - hipnotic rotating objects are complex. They can still be done and you can do them.

They need: an info_rotate (object rotates around this point), func_rotate or func_rotate_door (rotate control ops entity), func_movewall (invisible entity that touches / blocks and crushes, rotate_object y(gives the visible appearance of the rotating thing) and possibly a trigger or two to fire the rotation event, control the event and | or stop rotation.

Sort of looks like this:

{
"classname" "info_rotate"
"origin" "-176 413 24"
"targetname" "sarsen1rot"
}
// entity 109
{
"health" "350"
"target" "sarsen1con"
"classname" "trigger_once"
"delay" "1"
"sounds" "0"
// brush 0
{
( -165 386 16 ) ( -180 379 16 ) ( -157 370 16 ) q1tex/black 0 0 0 1.000000 1.000000 0 0 0
( -187 361 16 ) ( -212 417 16 ) ( -171 402 1016 ) q1tex/black 0 0 0 1.000000 1.000000 0 0 0
( -205 402 16 ) ( -149 427 16 ) ( -165 386 1016 ) q1tex/black 0 0 0 1.000000 1.000000 0 0 0
( -156 442 16 ) ( -131 386 16 ) ( -171 402 1016 ) q1tex/black 0 0 0 1.000000 1.000000 0 0 0
( -131 386 16 ) ( -187 361 16 ) ( -171 402 1016 ) q1tex/black 0 0 0 1.000000 1.000000 0 0 0
( -198 375 144 ) ( -134 404 144 ) ( -191 359 144 ) q1tex/black 0 0 0 1.000000 1.000000 0 0 0
}
}
// entity 111
{
"classname" "func_rotate_door"
"origin" "-176 412 16"
"target" "sarsen1"
"angles" "0 0 -90"
"sounds" "0"
"dmg" "100"
"targetname" "sarsen1con"
"noise1" "misc/null.wav"
"noise2" "misc/quake.wav"
"speed" "1"
}
// entity 112
{
"classname" "func_movewall"
"dmg" "100"
"deathtype" "you were crushed by a sarsen pillar"
"targetname" "sarsen1"
// brush 0
{
( -203 402 142 ) ( -188 369 142 ) ( -188 369 126 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -152 424 142 ) ( -201 402 142 ) ( -201 402 126 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -137 393 142 ) ( -152 426 142 ) ( -152 426 126 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -136 387 142 ) ( -136 387 126 ) ( -187 364 126 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -188 369 142 ) ( -203 402 142 ) ( -154 424 142 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -201 401 116 ) ( -189 376 116 ) ( -138 399 116 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
}
}
// entity 113
{
"classname" "func_movewall"
"dmg" "100"
"deathtype" "you were crushed by a sarsen pillar"
"targetname" "sarsen1"
// brush 0
{
( -186 364 114 ) ( -186 364 84 ) ( -203 401 84 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -152 424 114 ) ( -201 402 114 ) ( -201 402 98 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -137 393 114 ) ( -152 426 114 ) ( -152 426 98 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -136 387 114 ) ( -136 387 98 ) ( -187 364 98 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -188 369 114 ) ( -203 402 114 ) ( -154 424 114 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -151 424 84 ) ( -203 401 84 ) ( -186 364 84 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
}
}
// entity 114
{
"classname" "func_movewall"
"dmg" "100"
"deathtype" "you were crushed by a sarsen pillar"
"targetname" "sarsen1"
// brush 0
{
( -203 402 86 ) ( -188 369 86 ) ( -188 369 70 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -152 424 86 ) ( -201 402 86 ) ( -201 402 70 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -137 393 86 ) ( -152 426 86 ) ( -152 426 70 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -136 387 86 ) ( -136 387 70 ) ( -187 364 70 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -188 369 82 ) ( -203 402 82 ) ( -154 424 82 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -201 401 52 ) ( -189 376 52 ) ( -138 399 52 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -164 416 36 ) ( -164 376 56 ) ( -148 416 36 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
}
}
// entity 115
{
"classname" "func_movewall"
"dmg" "100"
"deathtype" "you were crushed by a sarsen pillar"
"targetname" "sarsen1"
// brush 0
{
( -203 402 44 ) ( -188 369 44 ) ( -188 369 28 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -152 424 44 ) ( -201 402 44 ) ( -201 402 28 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -137 393 44 ) ( -152 426 44 ) ( -152 426 28 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -188 367 50 ) ( -203 400 50 ) ( -154 422 50 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
( -164 416 36 ) ( -164 376 56 ) ( -148 416 36 ) +0redpuls 0 0 0 1.000000 1.000000 0 0 0
}
}
// entity 116
{
"spawnflags" "1"
"target" "sarsen1rot"
"targetname" "sarsen1"
"classname" "rotate_object"
// brush 0
{
( -197 399 144 ) ( -183 369 144 ) ( -185 364 16 ) q1tex/metal1_6 0 0 0 1.000000 1.000000 0 0 0
( -202 401 16 ) ( -151 424 16 ) ( -165 387 1016 ) q1tex/metal1_6 0 0 0 1.000000 1.000000 0 0 0
( -157 438 16 ) ( -134 387 16 ) ( -171 401 1016 ) q1tex/metal1_6 0 0 0 1.000000 1.000000 0 0 0
( -139 389 144 ) ( -135 388 50 ) ( -184 366 61 ) q1tex/metal1_6 0 0 0 1.000000 1.000000 0 0 0
( -195 377 144 ) ( -137 403 144 ) ( -189 362 144 ) q1tex/metal1_6 0 0 0 1.000000 1.000000 0 0 0
( -201 401 44 ) ( -184 366 61 ) ( -135 388 50 ) q1tex/metal1_6 0 0 0 1.000000 1.000000 0 0 0
}
}

That is from my unreleased stonehenge map.

When the trigger_once sarsen1con is shot for 350 pts of damage it fires the func_rotate_door it targets.
This fires the rotate_object (appearance of rotation) and func_movewalls (block movement - do crushing damage while moving) to rotate around the info_rotate point, according to the rules in the func_rotate_door. The large pillar appears to rotate and fall to the ground, crushing you if you are under it.

Looks & sounds pretty cool, but is complex.
(There are 4 func_movewalls to acurately depict the physical touch space of the sarsen block as it falls. This was necessary or the player would get crushed in weird ways...)

Dont give up - you can make rotating objects.

And the reason it is complex - rotating stuff in the engine is complex. I have made rotating bsp model objects. Making a rotating bounding box does not happen - engine issues.

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.