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

Logic case: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
 
(56 intermediate revisions by 35 users not shown)
Line 1: Line 1:
[http://porno.eskout.cn/spanking-personals.html spanking personals] [http://movies.eskout.cn/siesta-key-florida.html siesta key florida home rental] [http://playboy.eskout.cn/alissa-milano-nude.html alissa milano nude] [http://xxx.eskout.cn/multi-vitamins.html multi vitamins] [http://teen.eskout.cn/free-gay-sex.html free gay sex clips] [http://www.sklinnem.00me.com page] [http://hardcore.eskout.cn/erotic-review.html erotic review] [http://www.listclairecu.freehosting.net map] [http://home.graffiti.net/d-saltash/ page] [http://movies.eskout.cn/hardcore-latinas.html hardcore latinas] [http://sex.eskout.cn/asian-pic-post.html asian pic post] [http://sex.eskout.cn/girls-in-high-heels.html girls in high heels] [http://naked.eskout.cn/erotic-costumes.html erotic costumes] [http://incest.eskout.cn/petpound.html petpound] [http://xxx.eskout.cn/trolling-striped.html trolling striped bass] [http://hentai.eskout.cn/nude-cock.html nude cock] [http://anal.eskout.cn/medical-billing.html medical billing and coding degree] [http://playboy.eskout.cn/girls-boarding.html girls boarding schools] [http://porno.eskout.cn/broward-jail.html broward jail information] [http://hentai.eskout.cn/blue-ridge-georgia.html blue ridge georgia cabin rentals] [http://lesbian.eskout.cn/macked-babes.html macked babes] [http://women.eskout.cn/female-masterbation.html female masterbation mpeg clips] [http://www.shimes.00cd.com home] [http://fuck.eskout.cn/real-estate.html real estate scottsdale] [http://xxx.eskout.cn/athletic-trainer.html athletic trainer jobs] [http://porn.eskout.cn/mj-morning-show.html mj morning show] [http://www.cufreder.00video.com here] [http://girls.eskout.cn/gay-black-men-fucking.html gay black men fucking] [http://xxx.eskout.cn/housekeeper.html housekeeper] [http://girl.eskout.cn/sheboy.html sheboy] [http://teens.eskout.cn/naked-comics.html naked comics] [http://hardcore.eskout.cn/excel-tips.html excel tips] [http://sex.eskout.cn/scooter-racing.html scooter racing] [http://naked.eskout.cn/twistedlinks.html twistedlinks] [http://sex.eskout.cn/swiss-cheese.html swiss cheese] [http://hardcore.eskout.cn/brutal-sex.html brutal sex] [http://movies.eskout.cn/male-thong.html male thong] [http://porn.eskout.cn/child-care-software.html child care software] [http://www.janny07.tvheaven.com map] [http://hardcore.eskout.cn/preteen-anime.html preteen anime] [http://hardcore.eskout.cn/slippery-pussy.html slippery pussy] [http://women.eskout.cn/sexy-wedding.html sexy wedding dress] [http://hentai.eskout.cn/womens-swim-suits.html womens swim suits] [http://playboy.eskout.cn/website-developer.html website developer] [http://sex.eskout.cn/jl-audio.html jl audio] [http://girls.eskout.cn/nude-galleries.html nude galleries] [http://lesbian.eskout.cn/ftv-girls.html ftv girls] [http://lesbian.eskout.cn/dan-bern.html dan bern] [http://www.ginjoyce.s5.com map] [http://hentai.eskout.cn/sarah-lane-nude.html sarah lane nude] [http://lesbian.eskout.cn/ocean-breathes-salty.html ocean breathes salty] [http://www.vispektor.00author.com home] [http://anal.eskout.cn/free-phone-sex.html free phone sex] [http://porno.eskout.cn/csi-theme-song.html csi theme song] [http://nude.eskout.cn/real-estate.html real estate punta gorda] [http://blondes.eskout.cn/uncensored-rap-videos.html uncensored rap videos] [http://teen.eskout.cn/live-sex-show.html live sex show] [http://hardcore.eskout.cn/cute-backgrounds.html cute backgrounds] [http://girl.eskout.cn/sex-video-free.html sex video free] [http://blondes.eskout.cn/prescription.html prescription drug plan] [http://porn.eskout.cn/underage-teens.html underage teens nude] [http://anal.eskout.cn/cum-on-nipples.html cum on nipples] [http://www.listpmv.00cd.com page] [http://blondes.eskout.cn/anel-sex.html anel sex] [http://porno.eskout.cn/naughty-nati.html naughty nati] [http://teens.eskout.cn/ghetto-boys.html ghetto boys] [http://naked.eskout.cn/mulan-sex.html mulan sex] [http://girls.eskout.cn/occupational.html occupational therapist jobs] [http://blondes.eskout.cn/nude-spring-break.html nude spring break] [http://www.evvaz.htmlplanet.com home] [http://www.comz-ru.theshoppe.com here] [http://hentai.eskout.cn/foot-pain-relief.html foot pain relief] [http://girls.eskout.cn/prescription.html prescription pills shopping] [http://xxx.eskout.cn/cum-inside-me.html cum inside me] [http://xxx.eskout.cn/lolitas-boys.html lolitas boys] [http://blondes.eskout.cn/sexy-nuns.html sexy nuns] [http://women.eskout.cn/perfect-wife.html perfect wife] [http://fuck.eskout.cn/fotografie.html fotografie] [http://incest.eskout.cn/intrusion-detection.html intrusion detection software] [http://hardcore.eskout.cn/medical-billing.html medical billing and coding course] [http://lesbian.eskout.cn/train-horn.html train horn] [http://girl.eskout.cn/girls-hot.html girls hot] [http://porn.eskout.cn/hot-housewifes.html hot housewifes] [http://fuck.eskout.cn/groupie-love.html groupie love] [http://porn.eskout.cn/fist-sex.html fist sex] [http://anal.eskout.cn/viviana-gibelli.html viviana gibelli] [http://nude.eskout.cn/banana-girl.html banana girl] [http://lesbian.eskout.cn/piss-flaps.html piss flaps] [http://anal.eskout.cn/jenna-jameson-lesbian.html jenna jameson lesbian] [http://blondes.eskout.cn/popular-hairstyles.html popular hairstyles] [http://www.scpurcel.2itb.com map] [http://girl.eskout.cn/nude-pam-anderson.html nude pam anderson] [http://www.geocities.com/liodzed/ here] [http://porno.eskout.cn/naked-young-teens.html naked young teens] [http://girls.eskout.cn/real-virgins.html real virgins] [http://teen.eskout.cn/anime-69.html anime 69] [http://nude.eskout.cn/aphrodisiacs.html aphrodisiacs] [http://lesbian.eskout.cn/bls.html bls] [http://teen.eskout.cn/country-stampede.html country stampede] [http://incest.eskout.cn/anderson-sc-real.html anderson sc real estate]
{{LanguageBar}}
{{wrongtitle|title=logic_case}}
{{TabsBar|main=s2|base=logic_case}}
 
{{CD|CLogicCase|file1=logicentities.cpp}}
== Entity description ==
{{this is a|logical entity|name=logic_case|sprite=1}} It compares an input to up to 16 configured values, firing a corresponding output if there is a match (on <code>InValue</code>), or fires a random output (on <code>PickRandom</code>). Use [[logic_random_outputs]] for a weighted random output.
[[Image:logic_case.png|right]]
{{Important|This entity stores values ​​as '''strings''', so if you specify one of the case as "1.50", then when you try to compare [[float]] it will not match, because the float will be "1.5", and not "1.50".}}
 
Compares an input to up to 16 preset values. If the input value is the same as any of the preset values, an output corresponding to that value is fired.
 
For example: If ''Case01'' is set to <code>2</code> and ''Case02'' is set to <code>5</code>, and the input value is <code>5</code>, the ''OnCase02'' output will be fired.
 
This entity can also be used to select from a number of random targets via the ''PickRandom'' input. One of the ''OnCase'' outputs that is connected to another entity will be picked at random and fired.
 
{{note|This entity with not recognize float values ending in <code>0</code> (like <code>0.50</code> or <code>1.00</code>). Simply remove these.}}
 
* The ideal entity for randomized events.
* Use with [[logic_timer]] for extremely random events.


{{tip|Use with [[logic_timer]] for extremely random events.}}
__NOTOC__
== Keyvalues ==
== Keyvalues ==
* {{kv targetname}}
{{KV Targetname}}
 
{{KV|Case 01|to=Case 16|intn=Case01|intn2=Case16|string|The values to test against.}}
* '''Case''(01-16)'''''
: <string>


== Inputs ==
== Inputs ==
* {{i targetname}}
{{I|InValue|Compares the Input value converted to string to the case values, and fires the appropriate output, if any.|param=variant}}
 
{{I|PickRandom|param=void|Fires a random OnCase output with at least one connection.}}
* '''InValue <string>'''
{{I|PickRandomShuffle|param=void|Fires a random OnCase output with at least one connection, with no repeats until all cases have been picked, at which point the shuffle starts over.}}
: Compare the Input value to the case values, and fire the appropriate output, if any.
 
* '''PickRandom'''
: Fire a random OnCase output with at least one connection.
 
* '''{{ep1 add|PickRandomShuffle}}'''
: Fires a random OnCase output with at least one connection, with no repeats until all cases have been picked, at which point the shuffle starts over.


== Outputs ==
== Outputs ==
* {{o targetname}}
{{O|OnCase01|to=OnCase16|param=void|activator = activator of the input causing this|Fired when the input value equals the corresponding Case value.}}
 
{{O|OnDefault|param=variant|activator = activator of InValue input|Fired when the input value does not equal any of the Case values.}}
* '''OnCase''(01-16)'''''
{{O|OnUsed|param=variant|activator = activator of InValue input|Fired when an input value is received, regardless of whether it matches a case. Outputs the same parameter type as was inputted with InValue input (i.e. if it was float this output will be of type float, the same applies to OnDefault output in {{mapbase}})|only={{mapbase}}}}
: Fired when the input value equals the Case''(01-16)'' value. {{activator|activator}}
 
* '''OnDefault'''
: Fired when the input value does not equal any of the Case values. {{activator|activator}}


[[Category:Entities]]
== See Also ==
* {{ent|logic_timer}}
* {{ent|logic_relay}}
* {{ent|math_counter}}
[[Category:IO System]]

Latest revision as of 10:59, 8 May 2025

English (en)中文 (zh)Translate (Translate)
C++ Class hierarchy
CLogicCase
CLogicalEntity
CServerOnlyEntity
CBaseEntity
C++ logicentities.cpp
Logic case.png

logic_case is a logical entity available in all Source Source games. It compares an input to up to 16 configured values, firing a corresponding output if there is a match (on InValue), or fires a random output (on PickRandom). Use logic_random_outputs for a weighted random output.

Icon-Important.pngImportant:This entity stores values ​​as strings, so if you specify one of the case as "1.50", then when you try to compare float it will not match, because the float will be "1.5", and not "1.50".
Tip.pngTip:Use with logic_timer for extremely random events.

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

Case 01 (Case01) to Case 16 (Case16) <string>
The values to test against.

Inputs

InValue <variantRedirectInput/variant>
Compares the Input value converted to string to the case values, and fires the appropriate output, if any.
PickRandom <void>
Fires a random OnCase output with at least one connection.
PickRandomShuffle <void>
Fires a random OnCase output with at least one connection, with no repeats until all cases have been picked, at which point the shuffle starts over.

Outputs

OnCase01 to OnCase16 <void>
!activator = activator of the input causing this
!caller = this entity
Fired when the input value equals the corresponding Case value.
OnDefault <variantRedirectOutput/variant>
!activator = activator of InValue input
!caller = this entity
Fired when the input value does not equal any of the Case values.
OnUsed <variantRedirectOutput/variant> (only in Mapbase)
!activator = activator of InValue input
!caller = this entity
Fired when an input value is received, regardless of whether it matches a case. Outputs the same parameter type as was inputted with InValue input (i.e. if it was float this output will be of type float, the same applies to OnDefault output in Mapbase)

See Also