Func rotating: Difference between revisions
Jump to navigation
Jump to search

Note:
This entity did not rotate visually until the 19/12/2018 patch, due to bugged implementation of the
Bug:The maximum degrees this angle can turn is 360000 degrees, at which it stops rotating. [todo tested in ?]
Note:Archived page history
Important:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.
No edit summary |
Kestrelguy (talk | contribs) m (updated templates used.) |
||
Line 1: | Line 1: | ||
{{ | {{lang|func rotating}} | ||
{{brush ent|func_rotating}} | |||
{{note|{{tf2}} This entity did not rotate visually until the 19/12/2018 patch, due to bugged implementation of the <code>Client-side rotation</code> spawnflag.}} | {{note|{{tf2}} This entity did not rotate visually until the 19/12/2018 patch, due to bugged implementation of the <code>Client-side rotation</code> spawnflag.}} | ||
{{ | {{bugfix|The maximum degrees this angle can turn is 360000 degrees, at which it stops rotating.|This can be remedied by scripting the entity to pause rotating for a short period of time.}} | ||
{{clr}} | {{clr}} | ||
==Entity | ==Entity Description== | ||
[[Image:Hammer Axis visual guide.png|thumb|300px|A visual guide showing the axis in each viewport (Click to enlarge)]] | [[Image:Hammer Axis visual guide.png|thumb|300px|A visual guide showing the axis in each viewport (Click to enlarge)]] | ||
It is used to create rotating brushes. Compare with | It is used to create rotating brushes. Compare with {{ent|func_door_rotating}}. | ||
===Friction Explanation & Formula=== | ===Friction Explanation & Formula=== | ||
Line 34: | Line 35: | ||
'''Purpose:''' | '''Purpose:''' | ||
Think function: Accelerates a func_rotating to a higher angular velocity. | Think function: Accelerates a <code>func_rotating</code> to a higher angular velocity. | ||
new_speed = fabs( current_speed ) + 0.2 * maxspeed * fanfriction; | new_speed = fabs( current_speed ) + 0.2 * maxspeed * fanfriction; | ||
'''Purpose:''' | '''Purpose:''' | ||
Decelerates the rotator from a higher speed to a lower one. | Decelerates the rotator from a higher speed to a lower one. | ||
new_speed = fabs( current_speed ) - 0.1 * maxspeed * fanfriction; | new_speed = fabs( current_speed ) - 0.1 * maxspeed * fanfriction; | ||
----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ||
'''Conclusion:''' | '''Conclusion:''' | ||
* A higher | * A higher <code>fanfriction</code> value will accelerate/deaccelerate faster. | ||
* A lower | * A lower <code>fanfriction</code> value will accelerate/deaccelerate slower. | ||
== Keyvalues == | == Keyvalues == | ||
{{KV|Max Rotation Speed|intn=maxspeed|integer|The maximum rotation speed of the brushes, in degrees per second. Seems to be limited to a number around 2000, after which the rotational speed ignores the last remaining digits ( | {{KV|Max Rotation Speed|intn=maxspeed|integer|The maximum rotation speed of the brushes, in degrees per second. Seems to be limited to a number around 2000, after which the rotational speed ignores the last remaining digits (e.g., 2500{{=}}250).}} | ||
{{KV|Friction (0 - 100%)|intn=fanfriction|integer|The amount of rotational friction. Value must be between 0 and 100 %. The lower the friction is, the slower it spins up and spins down. This is the opposite of how it would work in real life.}} | {{KV|Friction (0 - 100%)|intn=fanfriction|integer|The amount of rotational friction. Value must be between 0 and 100 %. The lower the friction is, the slower it spins up and spins down. This is the opposite of how it would work in real life.}} | ||
{{KV|Rotating sound WAV|intn=message|sound|Sound to play while rotating.}} | {{KV|Rotating sound WAV|intn=message|sound|Sound to play while rotating.}} | ||
Line 57: | Line 58: | ||
:* 0 : VPhysics | :* 0 : VPhysics | ||
:* 1 : BSP | :* 1 : BSP | ||
{{KV | {{KV BaseEntity|brush=1}} | ||
{{KV | {{KV visiblebrush|l4d=1}} | ||
{{KV Reflection}} | {{KV Reflection}} | ||
== Flags == | == Flags == | ||
{{fl|1|Start ON}} | |||
{{fl|2|Reverse Direction}} | |||
{{fl|4|X Axis|If enabled, the entity will spin at the X Axis.}} | |||
{{fl|8|Y Axis|If enabled, the entity spin at the Y Axis.}} | |||
{{fl|16|Acc/Dcc|If enabled, the entity will accelerate and decelerate from maximum speed based on the Friction property.}} | |||
{{fl|16|Client-side Rotation|Intended to simulate the entity entirely on the client.|only={{Tf2}}}} | |||
{{fl|32|Fan Pain|With this enabled, the player will be hurt when coming into contact with the brush.}} | |||
{{fl|64|Not Solid}} | |||
{{fl|128|Small Sound Radius|Use [[Soundscripts#SoundLevel|ATTN_IDLE]] (60dB).}} | |||
{{fl|256|Medium Sound Radius|Use [[Soundscripts#SoundLevel|ATTN_STATIC]] (~67dB).}} | |||
{{fl|512|Large Sound Radius|Use [[Soundscripts#SoundLevel|ATTN_NORM]] (~75dB). If the other two options are unset, this is used.}} | |||
{{fl|1024|Client-side Animation|since={{l4d}}}} | |||
== Inputs == | == Inputs == | ||
Line 89: | Line 86: | ||
{{IO|Reverse|Reverse the direction of rotation of the rotator, preserving the current speed.}} | {{IO|Reverse|Reverse the direction of rotation of the rotator, preserving the current speed.}} | ||
{{IO|SnapToStartPos|Snap to the initial position and stop moving.|since=l4d2}} | {{IO|SnapToStartPos|Snap to the initial position and stop moving.|since=l4d2}} | ||
{{IO|GetSpeed|Causes the func_rotating to fire its <code>OnGetSpeed</code> output with its current speed.|since=p2}} | {{IO|GetSpeed|Causes the <code>func_rotating</code> to fire its <code>OnGetSpeed</code> output with its current speed.|since=p2}} | ||
{{I | {{I BaseEntity}} | ||
{{I | {{I visiblebrush|portal2=1}} | ||
== Outputs == | == Outputs == | ||
{{IO|OnGetSpeed|Fired when the <code>GetSpeed</code> input is called. The current speed of the func_rotating is passed with this output.|param=integer|since=p2}} | {{IO|OnGetSpeed|Fired when the <code>GetSpeed</code> input is called. The current speed of the <code>func_rotating</code> is passed with this output.|param=integer|since=p2}} | ||
{{O Targetname}} | {{O Targetname}} | ||
== See Also == | |||
*{{ent|func_door_rotating}} | |||
*{{ent|func_platrot}} | |||
*{{ent|func_rot_button}} | |||
*{{ent|momentary_rot_button}} |
Revision as of 11:49, 12 May 2022




Client-side rotation
spawnflag.
Fix:This can be remedied by scripting the entity to pause rotating for a short period of time.
Entity Description
It is used to create rotating brushes. Compare with func_door_rotating.
Friction Explanation & Formula
Fan friction may be a little tricky to understand. Below is an explanation of how it works.
If Hammer has the fanfriction key set to 0 and the game spawns the entity, code sets it to 1 so it doesn't divide by zero.
Friction = fanfriction key / 100
Key | Hammer Value | Code Value |
---|---|---|
fanfriction | 100 | 1 |
fanfriction | 50 | 0.5 |
fanfriction | 0/1 | 0.01 |
Note: These formulas get called every 0.1 seconds.
Purpose:
Think function: Accelerates a func_rotating
to a higher angular velocity.
new_speed = fabs( current_speed ) + 0.2 * maxspeed * fanfriction;
Purpose: Decelerates the rotator from a higher speed to a lower one.
new_speed = fabs( current_speed ) - 0.1 * maxspeed * fanfriction;
Conclusion:
- A higher
fanfriction
value will accelerate/deaccelerate faster. - A lower
fanfriction
value will accelerate/deaccelerate slower.
Keyvalues
- Max Rotation Speed (maxspeed) <integer>
- The maximum rotation speed of the brushes, in degrees per second. Seems to be limited to a number around 2000, after which the rotational speed ignores the last remaining digits (e.g., 2500=250).
- Friction (0 - 100%) (fanfriction) <integer>
- The amount of rotational friction. Value must be between 0 and 100 %. The lower the friction is, the slower it spins up and spins down. This is the opposite of how it would work in real life.
- Rotating sound WAV (message) <sound>
- Sound to play while rotating.
- Volume (10 = loudest) (volume) <integer>
- The volume of the rotation sound.
- Minimum Light Level (_minlight) <string>
- The minimum level of ambient light that hits this brush.
- Blocking Damage (dmg) <integer>
- Damage done to any entity that blocks the rotation, per frame.
- Solid Type (solidbsp) <choices>
- Brush solidity type
- 0 : VPhysics
- 1 : BSP

This template (and its redirect) is
Deprecated. Its use is not recommended and its functionality may be compromised.
Please use {{Brush rendering note}} instead.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.

Please use {{Brush rendering note}} instead.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.


- Render in Fast Reflections (drawinfastreflection) <boolean> (in all games since
)
- If enabled, this entity will render in fast water reflections (i.e. when a water material specifies
$reflectonlymarkedentities
) and in the world impostor pass.
Flags
- Start ON : [1]
- Reverse Direction : [2]
- X Axis : [4]
- If enabled, the entity will spin at the X Axis.
- Y Axis : [8]
- If enabled, the entity spin at the Y Axis.
- Acc/Dcc : [16]
- If enabled, the entity will accelerate and decelerate from maximum speed based on the Friction property.
- Fan Pain : [32]
- With this enabled, the player will be hurt when coming into contact with the brush.
- Not Solid : [64]
- Small Sound Radius : [128]
- Use ATTN_IDLE (60dB).
- Medium Sound Radius : [256]
- Use ATTN_STATIC (~67dB).
- Large Sound Radius : [512]
- Use ATTN_NORM (~75dB). If the other two options are unset, this is used.
- Client-side Animation : [1024] (in all games since
)
Inputs
- SetSpeed <float >
- Set the speed as a ratio of the specified Max Rotation Speed, where 0 is stopped and 1 is the Max Rotation Speed. Negative values rotate backwards.
- Start
- Start the rotator rotating.
- Stop
- Stop the rotator from rotating.
- StopAtStartPos
Stop
the rotator from rotating when it gets around to the start position again (on its rotation axis). If the speed is greater than 100 degrees per second, slows down to 100 degrees per second and spins for one extra revolution before stopping.
- StartForward
- Start the rotator rotating forward at maximum speed.
- StartBackward
- Start the rotator rotating backward at maximum speed.
- Toggle
- Toggle the rotator between rotating and not rotating.
- Reverse
- Reverse the direction of rotation of the rotator, preserving the current speed.
- SnapToStartPos (in all games since
)
- Snap to the initial position and stop moving.
- GetSpeed (in all games since
)
- Causes the
func_rotating
to fire itsOnGetSpeed
output with its current speed.
- SetDamageFilter <targetname >
- Sets a filter for this entity for when it receives damage.
- EnableDamageForces
- Allows the entity to be pushed by damage done to it (usually force amount correlates with the damage done).
- DisableDamageForces
- Prevents the entity from being pushed by damage done to it.
Todo: move/mention at proper place
Outputs
- OnGetSpeed <integer > (in all games since
)
- Fired when the
GetSpeed
input is called. The current speed of thefunc_rotating
is passed with this output.