This article relates to the game "Portal 2." Click here for more information.

Comp kv setter: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (template update + image)
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{this is a|name=comp_kv_setter|game=Portal 2: Community Edition|e1|sprite=1}} It is also available in all games with {{Teamspen|3.1}} installed. It sets a keyvalue on an entity to a new value. This can be used in cases to compute spawnflags, or to adjust keyvalues when the target entity's options cannot be set to a fixup variable.
{{LanguageBar}}
{{P2CE topicon}}
{{this is a|point entity|internal=1|name=comp_kv_setter|sprite=1|game=Strata Source|game1=TeamSpen's Hammer Addons}}  


==KeyValues==
It sets a keyvalue on an entity to a new value. This can be used in cases to compute spawnflags, or to adjust keyvalues when the target entity's options cannot be set to a fixup variable.
{{KV|Pitch Yaw Roll (Y Z X)|angle|This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.}}
{{KV|Target Entity|target_destination|The name of the entity or entities to set values on.}}
{{KV|Mode|choices|The type of value to set}}
:*kv: KeyValues
:*flags: SpawnFlags
{{KV|Name / Mask|string|The name of the keyvalue to set, or the bits to change for spawnflags.}}
{{KV|Value - String|string|The value to apply.}}
{{KV|Value - Ent Name|target_destination|If set, use this fixed-up entity name.}}
{{KV|Invert Value|choices|If enabled, invert the value so 0 and 1 are swapped.}}
:*0: No
:*1: Yes
{{KV|Rotate Value|choices|If enabled, treat the value as a vector and rotate it by the angles set on this entity first.}}
:*0: No
:*1: Yes
{{KV|Convert To Angle|choices|If enabled, convert a +X axis normal back into the Euler angle.}}
:*0: No
:*1: Yes


==Outputs==
== Keyvalues ==
{{IO|OnUser(1-4)|Fired in response to FireUser(1-4) input.}}
{{KV Targetname null|vbsp only=1}}
{{note|These outputs seem to be a mistake, as there are no FireUser inputs. Using these will have no effect.}}
{{KV|intn=angles|Pitch Yaw Roll (Y Z X)|angles|This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.}}
{{KV|intn=target|Target Entity|target_destination|The name of the entity or entities to set values on.}}
{{KV|intn=mode|Mode|string choices|The type of value to set}}
:*"kv": Keyvalues
:*"flags": Spawnflags
{{KV|intn=kv_name|Name / Mask|string|The name of the keyvalue to set, or the bits to change for spawnflags.}}
{{KV|intn=kv_value_global|Value - String|string|The value to apply.}}
{{KV|intn=kv_value_local|Value - Ent Name|target_destination|If set, use this fixed-up entity name.}}
{{KV|intn=invert|Invert Value|boolean|If enabled, invert the value so 0 and 1 are swapped.}}
{{KV|intn=rotate|Rotate Value|boolean|If enabled, treat the value as a vector and rotate it by the angles set on this entity first.}}
{{KV|intn=conv_ang|Convert To Angle|boolean|If enabled, convert a +X axis normal back into the Euler angle.}}


==See Also==
== Outputs ==
Any output may be used. All outputs defined on a <code>comp_kv_setter</code> are copied to the target entity.
 
==See also==
* [[TeamSpen's Hammer Addons]]
* [[TeamSpen's Hammer Addons]]

Latest revision as of 11:16, 27 February 2025

English (en)Translate (Translate)

Comp kv setter.png

comp_kv_setter is an internal point entity available in Strata Source Strata Source and TeamSpen's Hammer Addons TeamSpen's Hammer Addons.

It sets a keyvalue on an entity to a new value. This can be used in cases to compute spawnflags, or to adjust keyvalues when the target entity's options cannot be set to a fixup variable.

Keyvalues

Name (targetname) <string>
Name of this entity. Can be used by compile tools as a prop_static's lighting origin.
Also displayed in Hammer's 2D views and Entity Report. No effect in-game.
Pitch Yaw Roll (Y Z X) (angles) <angles>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Target Entity (target) <targetname>
The name of the entity or entities to set values on.
Mode (mode) <string choices>
The type of value to set
  • "kv": Keyvalues
  • "flags": Spawnflags
Name / Mask (kv_name) <string>
The name of the keyvalue to set, or the bits to change for spawnflags.
Value - String (kv_value_global) <string>
The value to apply.
Value - Ent Name (kv_value_local) <targetname>
If set, use this fixed-up entity name.
Invert Value (invert) <boolean>
If enabled, invert the value so 0 and 1 are swapped.
Rotate Value (rotate) <boolean>
If enabled, treat the value as a vector and rotate it by the angles set on this entity first.
Convert To Angle (conv_ang) <boolean>
If enabled, convert a +X axis normal back into the Euler angle.

Outputs

Any output may be used. All outputs defined on a comp_kv_setter are copied to the target entity.

See also