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
No edit summary
 
(53 intermediate revisions by 35 users not shown)
Line 1: Line 1:
[http://espied.servemp3.com/content/first-time-story.html first time story virgin] [http://trump.servemp3.com/html/corel-activation.html corel activation code] [http://aeson.servemp3.com/small/volume-of-a-sphere.html volume of a sphere] [http://espied.servemp3.com/content/solar-showers.html solar showers] [http://trump.servemp3.com/html/nordstroms.html nordstroms] [http://spying.servemp3.com/free-underage-sex.html free underage sex] [http://unsafe.servemp3.com/web/big-tits-cum.html big tits cum] [http://robbed.servemp3.com/small/coral-calcium.htm coral calcium] [http://boors.servemp3.com/blog/ocean-city-realestate.html ocean city realestate] [http://espied.servemp3.com/content/dark-side-of.html dark side of the moon] [http://potinz.servemp3.com/walmart.htm walmart] [http://unsafe.servemp3.com/web/oral-sex-toys.html oral sex toys] [http://surfguitar.servemp3.com/male-genital.html male genital exam] [http://trump.servemp3.com/html/lia-sophia-jewelry.html lia sophia jewelry] [http://unsafe.servemp3.com/web/los-angeles.html los angeles] [http://corner.servemp3.com/description/louis-vuitton-designer.html louis vuitton designer handbag] [http://corner.servemp3.com/description/law-mitchell.html law mitchell william] [http://espied.servemp3.com/content/used-mitsubishi.html used mitsubishi eclipse engines] [http://corner.servemp3.com/description/home-mortgages.html home mortgages] [http://robbed.servemp3.com/small/linda-hamilton-nude.htm linda hamilton nude] [http://boors.servemp3.com/blog/first-amendment.html first amendment] [http://boors.servemp3.com/blog/kelly-blue-book.html kelly blue book] [http://corner.servemp3.com/description/homeowner-insurance.html homeowner insurance] [http://robbed.servemp3.com/small/toronto-cd-store.htm toronto cd store] [http://corner.servemp3.com/description/hot-august-nights.html hot august nights] [http://spying.servemp3.com/flights.html flights] [http://trump.servemp3.com/html/pace-arrow-motor.html pace arrow motor home] [http://corner.servemp3.com/description/the-hatch-band.html the hatch band] [http://surfguitar.servemp3.com/shared-memory-service.html shared memory service not created yet] [http://surfguitar.servemp3.com/computer-memory.html computer memory] [http://spying.servemp3.com/lake-louise.html lake louise] [http://aeson.servemp3.com/small/accident-attorney.html accident attorney car island long] [http://robbed.servemp3.com/small/virtual-reality.htm virtual reality sex game] [http://espied.servemp3.com/content/table-appointment.html table appointment] [http://aeson.servemp3.com/small/kontraband.html kontraband] [http://robbed.servemp3.com/small/bobo.htm bobo] [http://espied.servemp3.com/content/prima-donna-bra.html prima donna bra] [http://potinz.servemp3.com/maine-county.htm maine county song] [http://surfguitar.servemp3.com/gay-male-porn.html gay male porn] [http://corner.servemp3.com/description/xfire.html xfire] [http://potinz.servemp3.com/white-plains.htm white plains drunk driving lawyer] [http://surfguitar.servemp3.com/ninja-gaiden.html ninja gaiden] [http://corner.servemp3.com/description/tinian-islands.html tinian islands] [http://robbed.servemp3.com/small/teen-asian-facial.htm teen asian facial] [http://corner.servemp3.com/description/xxx-interracial.html xxx interracial] [http://aeson.servemp3.com/small/she-sucks.html she sucks] [http://boors.servemp3.com/blog/girls-take-showers.html girls take showers] [http://boors.servemp3.com/blog/yellow-freight.html yellow freight] [http://unsafe.servemp3.com/web/bossandslave.html bossandslave] [http://surfguitar.servemp3.com/mature-phatforums.html mature phatforums] [http://corner.servemp3.com/description/bleeding-through.html bleeding through] [http://espied.servemp3.com/content/postcard-manufacturer.html postcard manufacturer] [http://trump.servemp3.com/html/print-greeting.html print greeting card] [http://surfguitar.servemp3.com/disney-clipart.html disney clipart] [http://boors.servemp3.com/blog/nail.html nail] [http://surfguitar.servemp3.com/spanking-porn.html spanking porn] [http://boors.servemp3.com/blog/club-pogo.html club pogo] [http://surfguitar.servemp3.com/la-quinta-tradition.html la quinta tradition] [http://robbed.servemp3.com/small/carmen-electra-topless.htm carmen electra topless] [http://corner.servemp3.com/description/war-bonds-during.html war bonds during wwii] [http://spying.servemp3.com/snowboard.html snowboard] [http://aeson.servemp3.com/small/suse.html suse] [http://corner.servemp3.com/description/bloodhound-virus.html bloodhound virus] [http://boors.servemp3.com/blog/without-omission.html without omission] [http://boors.servemp3.com/blog/text.html text] [http://spying.servemp3.com/one-touch-ultra.html one touch ultra] [http://unsafe.servemp3.com/web/nymphet.html nymphet] [http://trump.servemp3.com/html/lfo.html lfo] [http://aeson.servemp3.com/small/zenaida.html zenaida] [http://robbed.servemp3.com/small/las-vegas-female.htm las vegas female strippers] [http://corner.servemp3.com/description/s-w-auto.html s w auto] [http://corner.servemp3.com/description/jacks-mannequin.html jacks mannequin] [http://boors.servemp3.com/blog/house-moving.html house moving] [http://potinz.servemp3.com/highlights.htm highlights] [http://spying.servemp3.com/free-evangelion.html free evangelion hentai] [http://trump.servemp3.com/html/breann-mcgregor.html breann mcgregor] [http://espied.servemp3.com/content/haworth-office.html haworth office furniture] [http://spying.servemp3.com/its-a-girl-candy.html its a girl candy] [http://boors.servemp3.com/blog/playstation2-cheat.html playstation2 cheat codes websites] [http://aeson.servemp3.com/small/tabatha.html tabatha] [http://boors.servemp3.com/blog/teen-kissing.html teen kissing tips] [http://espied.servemp3.com/content/complications-gastric.html complications gastric bypass] [http://corner.servemp3.com/description/naked-older-women.html naked older women] [http://aeson.servemp3.com/small/birth-of-a-child.html birth of a child video] [http://boors.servemp3.com/blog/four-wheeler.html four wheeler] [http://potinz.servemp3.com/cleavage.htm cleavage] [http://spying.servemp3.com/ohh-ah.html ohh ah] [http://surfguitar.servemp3.com/final-fantasy.html final fantasy yuna nude] [http://spying.servemp3.com/dunks.html dunks] [http://espied.servemp3.com/content/rate.html rate] [http://surfguitar.servemp3.com/sphinx.html sphinx] [http://aeson.servemp3.com/small/adam-burton.html adam burton] [http://corner.servemp3.com/description/coleman-camper.html coleman camper pop up] [http://robbed.servemp3.com/small/lara-croft-hentai.htm lara croft hentai] [http://potinz.servemp3.com/fallen.htm fallen] [http://unsafe.servemp3.com/web/tickets-to-broadway.html tickets to broadway shows] [http://boors.servemp3.com/blog/mumbai-hotel-reservation.html mumbai hotel reservation] [http://boors.servemp3.com/blog/spanked-girls.html spanked girls] [http://boors.servemp3.com/blog/50cent-mp3.html 50cent mp3] [http://trump.servemp3.com/html/i-don-t-want-a-pickle.html i don t want a pickle]
{{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 <string>'''
: 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