Multisource: Difference between revisions
Jump to navigation
Jump to search

(Why hasn't this been documented?) |
No edit summary |
||
(39 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar}} | ||
{{obsolete}} | {{TabsBar|main=gs|base=multisource}} | ||
{{obsolete|entity=1|replacement={{ent|logic_branch_listener}}}} | |||
{{ent not in fgd}} | {{ent not in fgd}} | ||
{{CD|CMultiSource|file1=logicentities.cpp}} | |||
{{ | {{this is a|logical entity|name=multisource|engine=Source|sprite=1}} | ||
Deprecated entity from GoldSrc, only used in Half Life: Source, deprecated by [[logic_branch_listener]] in Source. | |||
This entity is the only entity that can be used as a master. | This entity is the only entity that can be used as a [[master]]. | ||
(Entities that specify a master cannot be enabled unless their master is enabled.) | (Entities that specify a master cannot be enabled unless their master is enabled.) | ||
== Keyvalues == | == Keyvalues == | ||
{{KV Targetname}} | {{KV Targetname}} | ||
{{KV Global}} | {{KV|Global State Master|intn=globalstate|string|Fire outputs only if this global state is ON.}} | ||
== Inputs == | |||
{{I | == Inputs == | ||
{{I|Use|Multisource contains a list of all entities that are targeting it (i.e. {{mono|target}} keyvalue of an entity is set to [[targetname]] of the multisource) and a state ON/OFF for each entity in the list. If an entity from the list is caller of this input the state is toggled. If all states are ON then OnTrigger output is fired.}} | |||
:{{bug|If a caller of this input is not in the list, the game is supposed to print warning in console and ignore the input but instead it toggles the state of last entity in the list.{{code fix|Change the condition in {{mono|CMultiSource::Use()}} from {{code|1=i > m_iTotal}} to {{code|1=i >= m_iTotal}}. See [https://github.com/ValveSoftware/source-sdk-2013/pull/1250 GitHub PR].}}|tested=l4d2 and checked sdk2013 source code}} | |||
== Outputs == | == Outputs == | ||
{{O Targetname}} | {{O|OnTrigger|activator=activator of {{mono|Use}} input|When Use input is successful}} | ||
== Example == | |||
Example with 3 entities which target the multisource. All entities that target multisource must send the Use input to it and also be the caller. ([[Targetname#Those evaluated based on activator/caller|the caller]] is in rare cases not the entity from which the output originates ) | |||
<pre> | |||
{ | |||
"classname" "multisource" | |||
"targetname" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME" | |||
"OnTrigger" "door,Unlock,,," | |||
} | |||
{ | |||
"classname" "info_target" | |||
"targetname" "FireUser1_on_me_before_letting_you_proceed" | |||
"target" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME" | |||
"OnUser1" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME,Use,,,1" | |||
} | |||
{ | |||
"classname" "trigger_multiple" | |||
"targetname" "Touch_me_before_you_proceed" | |||
"target" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME" | |||
"OnStartTouch" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME,Use,,,1" | |||
} | |||
{ | |||
"classname" "func_button" | |||
"targetname" "Press_me_before_you_proceed" | |||
"target" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME" | |||
"OnPressed" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME,Use,,,1" | |||
} | |||
</pre> | |||
== FGD Code == | |||
<syntaxhighlight lang=js> | |||
@PointClass iconsprite("editor/multisource.vmt") base(Targetname) color(128 255 128) = multisource : "Multisource" | |||
[ | |||
target(target_destination) : "Target" | |||
globalstate(string) : "Global State Master" | |||
input Use(void) | |||
output OnTrigger(void) | |||
] | |||
</syntaxhighlight> | |||
== See also == | |||
* {{ent|multi_manager|engine=source}} |
Latest revision as of 13:39, 29 May 2025



This entity is obsolete. Its use is discouraged. It may only exist/function in older engine branches.
It has since been deprecated by: logic_branch_listener.
It has since been deprecated by: logic_branch_listener.
![]() |
---|
CMultiSource |
![]() |

multisource
is a logical entity available in all Source games.
Deprecated entity from GoldSrc, only used in Half Life: Source, deprecated by logic_branch_listener in Source.
This entity is the only entity that can be used as a master. (Entities that specify a master cannot be enabled unless their master is enabled.)
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Global State Master (globalstate) <string>
- Fire outputs only if this global state is ON.
Inputs
- Use
- Multisource contains a list of all entities that are targeting it (i.e. target keyvalue of an entity is set to targetname of the multisource) and a state ON/OFF for each entity in the list. If an entity from the list is caller of this input the state is toggled. If all states are ON then OnTrigger output is fired.
Bug:If a caller of this input is not in the list, the game is supposed to print warning in console and ignore the input but instead it toggles the state of last entity in the list.
(tested in: l4d2 and checked sdk2013 source code)Code Fix:Change the condition in CMultiSource::Use() from i > m_iTotal to i >= m_iTotal. See GitHub PR.
Outputs
- OnTrigger
- !activator = activator of Use input
!caller = this entity
When Use input is successful
Example
Example with 3 entities which target the multisource. All entities that target multisource must send the Use input to it and also be the caller. (the caller is in rare cases not the entity from which the output originates )
{ "classname" "multisource" "targetname" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME" "OnTrigger" "door,Unlock,,," } { "classname" "info_target" "targetname" "FireUser1_on_me_before_letting_you_proceed" "target" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME" "OnUser1" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME,Use,,,1" } { "classname" "trigger_multiple" "targetname" "Touch_me_before_you_proceed" "target" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME" "OnStartTouch" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME,Use,,,1" } { "classname" "func_button" "targetname" "Press_me_before_you_proceed" "target" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME" "OnPressed" "ALL_THAT_TARGET_ME_MUST_USE_ME_TO_TRIGGER_ME,Use,,,1" }
FGD Code
@PointClass iconsprite("editor/multisource.vmt") base(Targetname) color(128 255 128) = multisource : "Multisource"
[
target(target_destination) : "Target"
globalstate(string) : "Global State Master"
input Use(void)
output OnTrigger(void)
]