Entity Alias Triggering



Sorry, we couldn't find any images attached to this page.

Entity Alias Triggering




It is possible to trigger entity(s) through the use of an alias rather than through their targetname. This allows you to trigger one entity that is already named and shares the same name as other entities without triggering the rest.
This is achieved by applying a unique custom keyvalue to the desired entity(s) that will serve as an alias. This alias key can be checked using a trigger_condition being iterated across all same-named entities via trigger_entity_iterator. If the trigger_condition finds a match to the alias used, the trigger_condition triggers the activator (the aliased entity) resulting in the entity(s) with the alias key being triggered only, and non of the other entities that have the same name. To trigger the aliased entity(s), you need only target the iterator once everything is set up.

For demonstration you can do "trigger sprite" and "trigger alias_trigger" in console


"classname" "trigger_entity_iterator"
"targetname" "alias_trigger" // You target this to trigger your aliased entities
"triggerstate" "1"
"delay_between_triggers" "0.0"
"delay_between_runs" "0.5"
"name_filter" "sprite"
"target" "check_alias" // trigger_condition that checks for the alias
"classname" "trigger_condition"
"targetname" "check_alias"
"m_fCheckInterval" "0.1"
"target" "!activator"
"m_iszValueName" "$s_alias"// the alias key to check for
"m_iszCheckValue" "sprite_unique" // $s_alias's value to check for
"netname" "!activator" // this is triggering the matched entity

Categories (tags)


edit tags


Rate this prefab

0 / 5 (0 votes)

Comments & discussion

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License