Math remap: Difference between revisions
Jump to navigation
Jump to search
Note:These do not have to be in order - the math_remap will create an inverse relationship between the input and output if the output keyvalues are swapped.
TeamSpen210 (talk | contribs) (Add note explaining that flipping max and min values works.) |
(-added class hierarchy, cleanup, internal names) |
||
Line 1: | Line 1: | ||
{{ | {{CD|CMathRemap|fil1=test}} | ||
{{entity|type=e0|math_remap}} It remaps a range of input values to a given range of output values. | |||
__NOTOC__ | |||
== Flags == | |||
{{fl|1|Ignore out of range input values}} | |||
{{fl|2|Clamp output to output range}} | |||
== Keyvalues == | == Keyvalues == | ||
{{KV|Minimum Valid Input Value|integer|Input values below this value will be ignored.}} | {{KV Targetname}} | ||
{{KV|Maximum Valid Input Value|integer|Input values above this value will be ignored.}} | {{KV|Minimum Valid Input Value|intn=in1|integer|Input values below this value will be ignored.}} | ||
{{KV|Output Value When Input Is Min.|integer|When the input value is equal to "Minimum Valid Input Value", this is the output value.}} | {{KV|Maximum Valid Input Value|intn=in2|integer|Input values above this value will be ignored.}} | ||
{{KV|Output Value When Input Is Max.|integer|When the input value is equal to "Maximum Valid Input Value", this is the output value.}} | {{KV|Output Value When Input Is Min.|intn=out1|integer|When the input value is equal to "Minimum Valid Input Value", this is the output value.}} | ||
{{KV|Output Value When Input Is Max.|intn=out2|integer|When the input value is equal to "Maximum Valid Input Value", this is the output value.}} | |||
{{note|These do not have to be in order - the math_remap will create an inverse relationship between the input and output if the output keyvalues are swapped.}} | {{note|These do not have to be in order - the math_remap will create an inverse relationship between the input and output if the output keyvalues are swapped.}} | ||
{{KV EnableDisable}} | {{KV EnableDisable}} | ||
== Inputs == | == Inputs == | ||
{{IO|InValue|Input value and fire the output with the remapped value.|param=float}} | {{IO|InValue|Input value and fire the output with the remapped value.|param=float}} | ||
{{I EnableDisable}} | {{I EnableDisable}} | ||
== Outputs == | == Outputs == | ||
{{IO|OutValue|Fired when the <code>InValue</code> input is received, with the remapped input value as the parameter.|param=float}} | {{IO|OutValue|Fired when the <code>InValue</code> input is received, with the remapped input value as the parameter.|param=float}} | ||
Revision as of 17:48, 27 August 2023
![]() |
---|
CMathRemap |
Template:Entity It remaps a range of input values to a given range of output values.
Flags
- Ignore out of range input values : [1]
- Clamp output to output range : [2]
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Minimum Valid Input Value (in1) <integer>
- Input values below this value will be ignored.
- Maximum Valid Input Value (in2) <integer>
- Input values above this value will be ignored.
- Output Value When Input Is Min. (out1) <integer>
- When the input value is equal to "Minimum Valid Input Value", this is the output value.
- Output Value When Input Is Max. (out2) <integer>
- When the input value is equal to "Maximum Valid Input Value", this is the output value.

- Start Disabled (StartDisabled) <boolean>
- Stay dormant until activated (with the
Enable
input).
Inputs
- InValue <float >
- Input value and fire the output with the remapped value.
EnableDisable:
- Enable / Disable
- Enable/disable this entity from performing its task. It might also disappear from view.
Outputs
- OutValue <float >
- Fired when the
InValue
input is received, with the remapped input value as the parameter.