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

Logic relay: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(70 intermediate revisions by 34 users not shown)
Line 1: Line 1:
[http://www.salona-yachts.eu/misc/famklu.html realtors in vancouver bc] [http://informer.siam.edu/themes/hm/wgsjib.html free techno ringtones] [http://activeimage.c3.hu/css/fxntci.html advanced medical solutions] [http://2001.c3.hu/mas/fnwxap.html mountain view library california] [http://troniny.ovh.org/gallery/layout/opdkwx.html net office php] [http://kristinlyseggen.com/gallery/1documentaries/7travel/lqwpjs.html mexican art information] [http://kom-pas.de/3xcms/config/hkatuploads/images/svdxch.html w.r thomas middle school] [http://2001.c3.hu/mas/umqgjt.html worlds strongest man competion] [http://www.lowell.edu/styles/old_style/css/wubkxj.html buy didrex] [http://activeimage.c3.hu/css/pgbgqr.html residential real estate attorneys] [http://maps.my2gig.com/cache/tkwshs.html activist quote] [http://www.lowell.edu/styles/old_style/css/amajmx.html teen thumb tgp] [http://aura.c3.hu/thumb/bjlwlp.html supply upholstery] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/jfbwkm.html inspirational spring thought] [http://2001.c3.hu/mas/xktfcc.html nurse uniform line] [http://ndr.hu/rhodes/rsnlub.html rim networks] [http://www.lowell.edu/styles/old_style/css/fmgmdf.html saudi investment in us] [http://aura.c3.hu/thumb/nwacua.html i remember you lyric] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/topqul.html metal machining] [http://www.stillwaterhomes.com/listings/images/pic/hkhskw.html english shillings] [http://www.farmelco.hu/test/css/arifcp.html range wolf] [http://www.stillwaterhomes.com/listings/images/pic/suieur.html lady in waiting middle ages] [http://troniny.ovh.org/gallery/layout/vctsse.html metal costumer] [http://maps.my2gig.com/cache/opwvge.html actualidad de magazine] [http://2001.c3.hu/mas/aiecxr.html tp 2 lyrics] [http://troniny.ovh.org/gallery/layout/shsqvh.html am fm radio history] [http://www.systemsupport.und.edu/cache/avatars/emo/rfqoug.html klonopin online] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/gdoupi.html poemas del dia de la mama] [http://kristinlyseggen.com/gallery/1documentaries/7travel/vftqnx.html jackson sports] [http://www.systemsupport.und.edu/cache/avatars/emo/hdtbrb.html ipod shuffle accessory] [http://www.olemissfans.com/chatpro/image/urwtof.html arc length examples] [http://www.systemsupport.und.edu/cache/avatars/emo/amxgfh.html nickledeon tv] [http://aura.c3.hu/thumb/enwnxo.html music unlimited to go] [http://kristinlyseggen.com/gallery/1documentaries/7travel/dwqnrd.html issue management council] [http://www.olemissfans.com/chatpro/image/ueurqw.html walking around] [http://ndr.hu/rhodes/jftmhs.html 1 gb pc2700 ram] [http://troniny.ovh.org/gallery/layout/kemqwo.html off road roll bar] [http://www.stillwaterhomes.com/listings/images/pic/vblhmr.html macafee virus scaner] [http://2001.c3.hu/mas/oaptpp.html area de perfil tarea y] [http://kristinlyseggen.com/gallery/1documentaries/7travel/uqsaov.html my husband is not attracted to me] [http://www.plurpage.com/classifieds/cache/dwqonn.html microsoft problem window] [http://www.farmelco.hu/test/css/bumpex.html event houston] [http://aura.c3.hu/thumb/jhmkhe.html european child and adolescent psychiatry journal] [http://aura.c3.hu/thumb/bffhsa.html spiritual publishers] [http://www.stillwaterhomes.com/listings/images/pic/jubdpg.html what is independent and dependent variable] [http://troniny.ovh.org/gallery/layout/lrpgvi.html actin size] [http://www.olemissfans.com/chatpro/image/jggwjq.html mountain bike trail] [http://troniny.ovh.org/gallery/layout/rjwxxh.html stage lights dance studio] [http://kom-pas.de/3xcms/config/hkatuploads/images/vpcuos.html red red wine lyrices] [http://kom-pas.de/3xcms/config/hkatuploads/images/mndiji.html end timer] [http://www.plurpage.com/classifieds/cache/uxorkr.html man on fire soundtracks] [http://www.easypayinfo.com/subscribe/tmp/vnsmfd.html secured transactions outline] [http://activeimage.c3.hu/css/vhnosh.html implicit null] [http://www.stillwaterhomes.com/listings/images/pic/rksvft.html securing os x] [http://2001.c3.hu/mas/qjvnbm.html import girls wallpaper] [http://www.farmelco.hu/test/css/hripsb.html last decade dead century] [http://aura.c3.hu/thumb/qcujfe.html over pimpin video world] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/ttoqmu.html rocket launch video] [http://www.stillwaterhomes.com/listings/images/pic/iolfaf.html relay 711] [http://www.salona-yachts.eu/misc/blqsnx.html semiconductor testing] [http://maps.my2gig.com/cache/tcphoa.html woman soldiers in iraq] [http://activeimage.c3.hu/css/mjprco.html performance advantage company] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/gskfie.html add holiday let link suggest] [http://www.systemsupport.und.edu/cache/avatars/emo/oibnts.html perm status] [http://kom-pas.de/3xcms/config/hkatuploads/images/cwqgsg.html audio problem msn messenger] [http://www.salona-yachts.eu/misc/ddqfjt.html aspect capital uk] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/vgnell.html online banner generators] [http://www.easypayinfo.com/subscribe/tmp/tipmag.html justanswer] [http://kom-pas.de/3xcms/config/hkatuploads/images/bcntmv.html oil and gas consultants] [http://maps.my2gig.com/cache/ggkhpo.html second hand vehicles for sale] [http://maps.my2gig.com/cache/gmhaco.html mature escort services] [http://www.easypayinfo.com/subscribe/tmp/itiquk.html island getaway rental] [http://informer.siam.edu/themes/hm/ksfgna.html cialis] [http://www.salona-yachts.eu/misc/udbbnq.html valiant boats] [http://www.salona-yachts.eu/misc/vpofud.html many men video] [http://www.easypayinfo.com/subscribe/tmp/epnhcv.html ask the pet doctor] [http://maps.my2gig.com/cache/ptrhla.html megahertz broadcast systems ltd] [http://www.stillwaterhomes.com/listings/images/pic/icshvp.html access 97 license problem] [http://aura.c3.hu/thumb/cwrdgh.html life is good t shirts] [http://informer.siam.edu/themes/hm/wvcfba.html voice ringtones] [http://kom-pas.de/3xcms/config/hkatuploads/images/xxxelp.html top resale value cars] [http://kom-pas.de/3xcms/config/hkatuploads/images/iddaek.html ask the pet doctor] [http://www.olemissfans.com/chatpro/image/ntfmwq.html what is a postscript file] [http://mkatzenbach.de/Website_MK_alt/content/cache/dir/end001/mmcvif.html total 90 4] [http://kom-pas.de/3xcms/config/hkatuploads/images/euwwuo.html snow skis on sale] [http://www.plurpage.com/classifieds/cache/dolnqr.html institute software training] [http://www.stillwaterhomes.com/listings/images/pic/otuwmh.html australia digital recording] [http://activeimage.c3.hu/css/rfthdt.html 2 aircraft side view war world] [http://activeimage.c3.hu/css/cidcac.html shared memory service not created yet] [http://activeimage.c3.hu/css/joavhc.html ivy summer video] [http://www.farmelco.hu/test/css/alxbhr.html music for love in any language] [http://www.plurpage.com/classifieds/cache/nimwqp.html naked news password username] [http://www.olemissfans.com/chatpro/image/oppqgc.html animated under construction] [http://www.lowell.edu/styles/old_style/css/sxqbog.html meridia] [http://2001.c3.hu/mas/ilgbmn.html angulos de medida] [http://www.stillwaterhomes.com/listings/images/pic/pitlnl.html electronic preparation tax] [http://troniny.ovh.org/gallery/layout/omqmxr.html aisle say] [http://www.lowell.edu/styles/old_style/css/lerxhh.html step by step resumes] [http://www.stillwaterhomes.com/listings/images/pic/muofps.html inventor tutorial] [http://www.stillwaterhomes.com/listings/images/pic/lkkjxg.html w.a.s.p.s.]
{{LanguageBar}}
{{wrongtitle|title=logic_relay}}
{{TabsBar|main=s2|base=logic relay}}
==Entity Description==
{{This is a|logical entity|name=logic_relay|sprite=1}}
[[Image:{{PAGENAME}}.png|right]]
{{CD|CLogicRelay|file1=logicrelay.cpp}}
A message forwarder. Fires an [[#Outputs|OnTrigger output]] when triggered, and can be disabled to prevent forwarding outputs.
It is a Output forwarder, which can be used to fire many [[Inputs and Outputs#Outputs|output]]s at once from just one input, or, by being disabled, to break an I/O chain. It can also be very helpful for organization and keeping you from having to edit MANY instances of the same outputs, as opposed to just one.


Useful as an intermediary between one entity and another for turning on or off an I/O connection, or as a container for holding a set of outputs that can be triggered from multiple places. Additionally, its Enabled/Disabled state can be used for conditional logic ("if, then" style logic).{{clr}}
After a <code>logic_relay</code> is triggered, it cannot be triggered again until all of its outputs are fired. This is useful for when a relay has a sequence of delayed outputs that shouldn't be repeated until the sequence is finished. This behavior can be disabled with the "Allow fast retrigger" spawnflag.


==Keyvalues==
{{ent|logic_relay}} combines the functionality of {{ent|trigger_relay|game=Half-Life: Source}} and {{ent|multi_manager|game=Half-Life: Source}} from {{goldsrc|2}}. The older entities still exist in {{hls|2}}, but are deprecated.
__NOTOC__
== Keyvalues ==
{{KV Targetname}}
{{KV|Start Disabled|boolean|intn=StartDisabled|When disabled <code>OnTrigger</code> output won't fire}}


* {{kv targetname}}
== Flags ==
{{fl|1|Only trigger once}}
{{fl|2|Allow fast retrigger}}  


* {{kv enabledisable}}
== Inputs ==
{{I|Trigger|param=void|Trigger the relay, causing its OnTrigger output to fire if it is enabled.}}
{{I|Enable|param=void|Allows the relay to fire the OnTrigger outputs after being disabled.}}
{{I|Disable|param=void|Prevents the relay from firing OnTrigger outputs in response to Trigger inputs.}}
{{I|Toggle|param=void|Toggle the relay between enabled and disabled.}}
{{I|CancelPending|param=void|Cancel any events fired by this relay that are currently pending in the I/O event queue
:{{bug|hidetested=1|If the caller of this input is the logic_relay itself it will break the I/O event queue which leads to a crash.}}}}
{{I|EnableRefire|param=void|Automatically fired on a relay after any delayed outputs finish firing, allowing it to fire again.|nofgd=1}}
{{I|TriggerWithParameter|param=variant|only={{mapbase}}|Triggers the relay with a parameter, causing its OnTriggerParameter output to fire if it is enabled.}}


==Flags==
== Outputs ==
{{O|OnSpawn|param=void|ac-is-this=1|Fired when the relay is spawned. If the relay is set to only trigger once, it will delete itself after firing this output.{{note|Every level load (including save loads!) triggers this output, unless "Fire once only" is checked.}}}}
{{O|OnTrigger|param=void|activator = activator of Trigger input|Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.}}
{{O|OnTriggerParameter|param=variant|only={{mapbase}}|activator = activator of TriggerWithParameter input|Fired when the relay is triggered with a parameter. If the relay is set to only trigger once, it will delete itself after firing this output.}}


* 1 : '''Only trigger once''' (Default Checked)
== See Also ==
: If checked, this entity starts on.
* {{ent|logic_case}}
* 2 : '''Allow fast retrigger''' (Default Unchecked)
: Allows fast retriggering.


==Inputs==
[[Category:IO System]]
 
* {{i targetname}}
 
* {{i enabledisable}}
 
* '''Trigger'''
: Trigger the relay, causing its OnTrigger output to fire if it is enabled.
 
* '''Toggle'''
: Toggle the relay between enabled and disabled.
* '''CancelPending'''
: Cancel any events fired by this relay that are currently pending in the I/O event queue.
 
==Outputs==
 
* {{o targetname}}
 
* '''OnTrigger'''
: Fired when the relay is triggered. {{activator|activator}}
* '''{{ep1 add|OnSpawn}}'''
: Fired when the relay is spawned. If the relay is set to only trigger once, it will delete itself after firing this output.
 
[[Category:Entities]]

Latest revision as of 13:24, 7 May 2025

English (en)Русский (ru)中文 (zh)Translate (Translate)
Logic relay.png

logic_relay is a logical entity available in all Source Source games.

C++ Class hierarchy
CLogicRelay
CLogicalEntity
CServerOnlyEntity
CBaseEntity
C++ logicrelay.cpp

It is a Output forwarder, which can be used to fire many outputs at once from just one input, or, by being disabled, to break an I/O chain. It can also be very helpful for organization and keeping you from having to edit MANY instances of the same outputs, as opposed to just one.

After a logic_relay is triggered, it cannot be triggered again until all of its outputs are fired. This is useful for when a relay has a sequence of delayed outputs that shouldn't be repeated until the sequence is finished. This behavior can be disabled with the "Allow fast retrigger" spawnflag.

logic_relay combines the functionality of trigger_relay and multi_manager from GoldSrc GoldSrc. The older entities still exist in Half-Life: Source Half-Life: Source, but are deprecated.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Start Disabled (StartDisabled) <boolean>
When disabled OnTrigger output won't fire

Flags

Only trigger once : [1]
Allow fast retrigger : [2]

Inputs

Trigger <void>
Trigger the relay, causing its OnTrigger output to fire if it is enabled.
Enable <void>
Allows the relay to fire the OnTrigger outputs after being disabled.
Disable <void>
Prevents the relay from firing OnTrigger outputs in response to Trigger inputs.
Toggle <void>
Toggle the relay between enabled and disabled.
CancelPending <void>
Cancel any events fired by this relay that are currently pending in the I/O event queue
Icon-Bug.pngBug:If the caller of this input is the logic_relay itself it will break the I/O event queue which leads to a crash.
EnableRefire <void> !FGD
Automatically fired on a relay after any delayed outputs finish firing, allowing it to fire again.
TriggerWithParameter <variantRedirectInput/variant> (only in Mapbase)
Triggers the relay with a parameter, causing its OnTriggerParameter output to fire if it is enabled.

Outputs

OnSpawn <void>
!activator = !caller = this entity
Fired when the relay is spawned. If the relay is set to only trigger once, it will delete itself after firing this output.
Note.pngNote:Every level load (including save loads!) triggers this output, unless "Fire once only" is checked.
OnTrigger <void>
!activator = activator of Trigger input
!caller = this entity
Fired when the relay is triggered. If the relay is set to only trigger once, it will delete itself after firing this output.
OnTriggerParameter <variantRedirectOutput/variant> (only in Mapbase)
!activator = activator of TriggerWithParameter input
!caller = this entity
Fired when the relay is triggered with a parameter. If the relay is set to only trigger once, it will delete itself after firing this output.

See Also