Rotating Brushes

Rotating Brushes

Classname: func_rotating
Purpose: Pinwheels, decapitation, whatever.
H2 Code: misc.hc
Their brushes spin around the x, y or z=default axis, and other axes in the horizontal plane with the aid of an angle field.

And you can ride on them, and they can inflict damage. My personal experiments have been a bit perfunctory because Eutectic looked into them carefully. They need to either be triggered, or have their `START_ON' spawnflag checked.

Editors vary somewhat in the facilities they provide for rotating brushes; Here are some instructions for Worldcraft.

Fields

origin Value is a triple of numbers, the X-Y-Z coordinates of the point around which the brush rotates (no default; value REQUIRED). But if the brush rotates around the Z axis, it doesn't matter what the Z-coordinate actually is.

Many editors, including HexMaker and Worldcraft don't seem to support the origin field for rotating brushes, but instead require the use of an alternative, an origin brush. This is simply a brush, owned by the rotating door, and typically extending through it, that carries the `origin' texture (white texture with ORIGIN written on it). The origin brush will not appear in the .bsp, but the door will rotate around its center.

speed Value is a number, the speed of rotation; default = 100 (neither real fast nor real slow).
thingtype Value is a name, determines chunk-type and hit-sound when hit, as follows. Default = WOOD = 2. Only has effect when BREAK spawnflag is set.
health Value is a mumber, how much damage it takes before breaking. The BREAK spawnflag must be set this to work, health is set by default from thingtype as follows:
  • GLASS (17) = 25
  • WOOD (2) = 50
  • GREYSTONE/BROWNSTONE (1,9) = 75
  • otherwise = 25
dmg Value is a number, supposedly damage inflicted when movement is actually blocked, e.g. player is caught between rotating brush and a wallm, but only 666 = gib sems to work.
abslight Value is a number between 0 and 1, giving absolute light-level
targetname Value is a name, toggles rotation when triggered
anglespeed Value is a number, how fast rotator speeds up & slows down if the GRADUAL spawnflag is on. 1 will be very slow, 100 will be instant. (Default is 10).
angle Value is a number, rotating brushes will appear in the game rotated by that amount around its origin in the horizontal plane, and if the X_AXIS or Y_AXIS spawnflag is checked, will open accordingly (swinging around the X and Y axes thru its origin as rotated by angle). This rotation does not show up up in the map (at least with QuArK 4.7), so getting complex effects might requuire a fair amount of pre-calculation. The 3D angles field angles_y can also be used for this effect, but I haven't gotten the others to do anthing, and I haven't gotten a door to rotate around an arbitrary 3D axis).
spawnflags Value is a number, sum up the ones below for the properties you want (hopefully your editor has a checkbox scheme or something to do the arithmetic for you):
  • 1 - START_ON: makes the entity start in the on state in the game (already rotating). Must be set if rotator isn't targetted to be switched on or off.
  • 2 - REVERSE: reverses rotation of direction.
  • 4 - X_AXIS: object will rotate along the X axis instead of the default Z axis. Will also override spawnflag 8 if both are set. Can be used in conjunction with the angle field.
  • 8 - Y_AXIS: object will rotate along the Y axis instead of the default Z axis. Can be used in conjunction with the angle field.
  • 16 - BREAK: Setting this flag will make the object breakable
  • 32 - GRADUAL: object will gradually accelerate and decelerate to and from its set speed based on the value in the anglespeed field.

    Eutectic Notes: If this is used, entity cannot be toggled on and off unless spawnflag 1 is also set. It won't move otherwise. Also, everytime it is triggered, an error message "sv_startsound not precached" appears.

  • 64 - TOGGLE_REVERSE: object will switch direction each time it is triggered. There's supposed to be automatic restarting triggered by wait, but I can't get this to work.
  • 128 - KEEP START: object should return to its starting position when stopped; Eutectic says doesn't work.

Notes

The .hc comments speak of a lifetime field, but neither I nor Eutectic find it to work; doesn't seem to be used in the code either. Likewise there's also supposed to be wait, for automatic restarting, but I can't get it to work.
Back to the list.