This article's documentation is for anything that uses the Source engine. Click here for more information.

Ent keyvalue: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{lang|Ent keyvalue|title=ent_keyvalue}} {{stub}} {{ent|ent_keyvalue}} is a command that sets an entity's keyvalues based on the hammer id. {{syntax|ent_key...")
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{lang|Ent keyvalue|title=ent_keyvalue}}
{{LanguageBar}}
{{stub}}
{{this is a|console command|name=ent_keyvalue}} It can change chosen entity's [[keyvalues]].
{{ent|ent_keyvalue}} is a [[ConCommand|command]] that sets an entity's [[keyvalues]] based on the hammer id.
{{syntax|ent_keyvalue <hammer id> <key> <value> [<key> <value>...]}}


==See Also==
{{syntax|ent_keyvalue <entity id> <key> <value> [<key> <value>...]}}
*{{ent|ent_fire}}
*{{ent|ent_create}}


[[Category:Console Command]]
* if <entity id> is <code>""</code> or <code>!picker</code> the picker entity will be used
* if <entity id> is <code>!self</code> / <code>!activator</code> / <code>!caller</code> the player that issued the command (works in multiplayer?{{confirm}})
* if <entity id> is hammer id then the entity will be searched by hammer id
 
{{note|If space needs to be used as some <code><value></code> make sure to enclose the value in quotes.<br>
Example <code>ent_keyvalue 848668 message "This is game_text's message keyvalue"</code>}}
 
{{note|This is using entity's KeyValue method to change keyvalues which means it's equivalent to changing keyvalues via [[AddOutput]] and it can even add outputs.<br>
Example of adding outputs to the command issuer <code>ent_keyvalue !self OnUser1 !self,Kill,,5,-1 OnUser2 "game_text,AddOutput,message changing a message of game_text"</code>. (difference from AddOutput syntax is needing to use symbol <code>,</code> instead of <code>:</code>)}}
 
== See also ==
* {{ent|ent_fire}}
* {{ent|ent_create}}

Latest revision as of 03:51, 1 May 2025

English (en)Translate (Translate)

ent_keyvalue is a console command available in all Source Source games. It can change chosen entity's keyvalues.

Syntax: ent_keyvalue <entity id> <key> <value> [<key> <value>...]

  • if <entity id> is "" or !picker the picker entity will be used
  • if <entity id> is !self / !activator / !caller the player that issued the command (works in multiplayer?[confirm])
  • if <entity id> is hammer id then the entity will be searched by hammer id
Note.pngNote:If space needs to be used as some <value> make sure to enclose the value in quotes.
Example ent_keyvalue 848668 message "This is game_text's message keyvalue"
Note.pngNote:This is using entity's KeyValue method to change keyvalues which means it's equivalent to changing keyvalues via AddOutput and it can even add outputs.
Example of adding outputs to the command issuer ent_keyvalue !self OnUser1 !self,Kill,,5,-1 OnUser2 "game_text,AddOutput,message changing a message of game_text". (difference from AddOutput syntax is needing to use symbol , instead of :)

See also