IO type conversions

For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.
Each output is of certain type and can pass its parameter if the "parameter override" field is left blank.
Possible output raw parameter types are: void, integer, float, boolean, string, Vector, color32, variant or ehandle.
Possible conversions

- If output and input parameter type match no conversion needed
- If output doesn't pass a parameter (void), then the input also must take no parameter (void) or be of type string in which case empty string is used
- If output passes something and input takes no parameters (void) we just give it nothing (void).
- If output passes something and input takes a variant param we just pass it along. (this means that given input will be handling the conversion as it needs)
- If output passes integer, then it can be converted to float or boolean.
- If output passes float, then it can be converted to integer or boolean.
- If output passes string, it will get converted to any type an input can be see below
- If output passes ehandle, then it can be converted to string in which case it's converted to the ehandle's targetname
Otherwise conversion is invalid and we get the "!! ERROR: bad input/output link:\n!!"
error
Conversion from string
- If string is being converted to integer/float it will take the leading portion of the string that makes sense as a number.
- If it's being converted to boolean it's first converted to integer and if it's 0 then it's false otherwise true.

"54658"
is converted to integer: 54685, float: 54685.0, boolean: true"8593.55A99999"
is converted to integer: 8593, float: 8593.55, boolean: true"-89P13"
is converted to integer: -89, float: -89.0, boolean: true"X123456"
is converted to integer: 0, float: 0.0, boolean: false"true"
is converted to integer: 0, float: 0.0, boolean: false
- If string is being converted to color32 it reads 4 values separated by spaces representing
"red green blue alpha"
(red,green,blue unspeicfied defaults to 0 alpha unspecified defaults to 255, going over 255 means overflow so using value like 1000 would really mean 1000 mod 256) - If string is being converted to Vector it first tries to read 3 numbers enclosed in
[]
brackets i.e
and if that fails it tries"[x y z]"
."x y z"

"142 25 0"
is converted to color32: (r: 142, g: 25, b:0, a:255), Vector: (x: 142.0, y: 25.0, z: 0.0)"1000 400.5 4512 100"
is converted to color32: (232, 144, 160, 100), Vector: ( 1000.0, 400.5, 4512.0)
- If string is being converted to ehandle it tries searching for the entity with the given targetname. !activator/!caller/!self are unusable here but other special targetnames still work[confirm] like !player, !pvsplayer, !rochelle
ERROR: bad input/output link examples
material_modfy_control
For example using math_counter and in it defining the following output firing to material_modify_control
OutValue some_material_modify_control SetMaterialVar 123.456
Will work without issues as SetMatrialVar takes string and parameter override is always string. But if we actually tried passing the OutValue's value which is of type float
OutValue some_material_modify_control SetMaterialVar <left blank>
then it won't work as conversion from float to string is not defined and we get "!! ERROR: bad input/output link:\n!!"
FireUserX
FireUser1-4 inputs have an unused string parameter. This causes issues in cases when an output passes some value that cannot be converted to string and parameter override is left empty. For example we use OnHealthChanged input of prop_physics making it do FireUser1.
OnHealthChanged some_entity FireUser1 <parameter left blank>
OnHealthChanged will try to pass float value to FireUser1 which is of type string therefore causing "!! ERROR: bad input/output link:\n!!".
See also
- material_modify_control - its inputs take string and conversion to string is only possible from string or ehandle
- User Inputs and Outputs - see FireUserX warning
- variant_t::Convert