Ent keyvalue: Difference between revisions
Jump to navigation
Jump to search

Note:If space needs to be used as some
Example
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.
Example of adding outputs to the command issuer
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{ | {{LanguageBar}} | ||
{{this is a|console command|name=ent_keyvalue}} It | {{this is a|console command|name=ent_keyvalue}} It can change chosen entity's [[keyvalues]]. | ||
{{syntax|ent_keyvalue <entity id> <key> <value> [<key> <value>...]}} | |||
{{ | * 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


ent_keyvalue
is a console command available in all 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

<value>
make sure to enclose the value in quotes.Example
ent_keyvalue 848668 message "This is game_text's message keyvalue"

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 :
)