12-Jul-2023
The multisource entity is an only master-entity which starts disabled/locked and sets its state to be enabled/unlocked when all entities having the multisource entity as their target (or killtarget) gets triggered. It is hence also referred to as an 'AND-Gate'. The multisource can be used in multiple ways:
Keyvalues |
OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.
Name targetname : Set name of multisource so other entities can refer to it as their master or trigger it as one of required inputs to enable it. Every trigger use-type works uniformly. Should not be kill-targeted because it breaks it's functionality. When using a multisource as a master to lock another entity, this multisource's targetname value must be put in the master value for entity-to-be-locked in order for the multisource to lock it, ensuring that some other entity is set to target this multisource.
Target target : Entity to trigger in every instant after multisource has changed its state to be enabled. Trigger use-type is 'Toggle'.
Global State Master globalstate : If set, the multisource entity will read its initial state from the global state variable specified here on map load. See env_global for more information about this. You should not have any entities targeting this multisource entity when using this.
If a valid entity does not target a multisource that is being used as a master, or the targetting entity no longer exists, the multisource will not lock entities until something is able to target it.
If you change the target of an entity targeting a multisource entity, the multisource entity will automatically no longer expect input from it.
Note that entity takes only "targets" and "killtargets" keys into account, so other triggering inputs like "TriggerTarget" won't work. In that case use trigger_relay like a bridge between entity with atypical-triggering output and multisource.
Kill Target is count as a normal targetting in multisource, do not "kill target" this entity or it won't work expecting a kill input.