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
 
(49 intermediate revisions by 31 users not shown)
Line 1: Line 1:
[http://xxx-video-women.charpit.info/ xxx video women orgasms] [http://minnesota-state.scutari.info/ minnesota state parks with cabins] [http://mens.dotlike.info/ mens] [http://cheapest-airfare.eutocia.info/ cheapest airfare] [http://michelledolph.22web.net/ncpcgov.html ncpc.gov] [http://olivaboatner.ifrance.com/library/smoke-of-a-distant.html smoke of a distant] [http://joananoon.22web.net/realnetworks.html realnetworks com] [http://carlitadennis.ifrance.com/blog/vinyl-repair.htm vinyl repair] [http://ruthashores.totalh.com/small/assessment-nyc-property.html assessment nyc property tax] [http://scholl-footwear.matelot.info/ scholl footwear] [http://shareecoulter.ifrance.com/directory/ribosomes-cells.html ribosomes cells] [http://investigation.clairce.info/ investigation training] [http://lacreshamellott.ifrance.com/modern-round-rugs.htm modern round rugs] [http://tamcaston.ifrance.com/blog/milf-mom-gallery.html milf mom gallery] [http://louveniacarreir.totalh.com/dragon-wallpapers.htm dragon wallpapers] [http://chiropractic.clairce.info/ benefit of chiropractic care] [http://elviralook.totalh.com/q/ginko-biloba.html ginko biloba] [http://tamcaston.ifrance.com/blog/verdi.html verdi] [http://invitation-templates.minimite.info/ party invitation template] [http://my-florida.eutocia.info/ my florida] [http://michelledolph.22web.net/sample-resume.html sample resume for teacher educator] [http://hedstrom.dotlike.info/ hedstrom rocking horse] [http://elviralook.totalh.com/q/reese.html reese] [http://janettgleaves.22web.net/resources/cute-blonde.html cute blonde teens] [http://shareecoulter.ifrance.com/directory/dental-insurance.html dental insurance plan] [http://louveniacarreir.totalh.com/r-s-windows.htm r s windows] [http://lacreshamellott.ifrance.com/austin-newspaper.htm austin newspaper texas] [http://kristlepoplin.22web.net/html/lil-john-get-low.html lil john get low] [http://moving-into-a.dotlike.info/ checklist house into moving new] [http://kyongbremer.ifrance.com/styles/pace-price-trailer.html pace price trailer] [http://kyongbremer.ifrance.com/styles/easy-directions.html easy directions for baking a martha stewart cake] [http://lacreshamellott.ifrance.com/pokemon-card.htm pokemon card] [http://carlitadennis.ifrance.com/blog/you-make-a-woman.htm you make a woman orgasm] [http://olivaboatner.ifrance.com/library/doctors.html doctors] [http://almetaplum.ifrance.com/view/women-with-cocks.html mature woman sucking cock] [http://lacreshamellott.ifrance.com/hump.htm download hump] [http://shareecoulter.ifrance.com/directory/nutrition-consultant.html nutrition consultant courses] [http://carlitadennis.ifrance.com/blog/sheet-metal.htm sheet metal roofing] [http://joananoon.22web.net/colonade-hotel.html colonade hotel boston] [http://ruthashores.totalh.com/small/inaction-figures.html inaction figures superbowl] [http://janettgleaves.22web.net/resources/rj45-switchbox.html rj45 switchbox] [http://almetaplum.ifrance.com/view/caterpillar-identification.html caterpillar identification] [http://almetaplum.ifrance.com/view/shields-pretty.html brooke shields pretty baby video] [http://joananoon.22web.net/silvia-saint.html silvia saint samples] [http://evangelinaqueve.totalh.com/small/political-science.html political science science social] [http://evangelinaqueve.totalh.com/small/leisure-suite-larry.html leisure suite larry] [http://custom-drive.eutocia.info/ custom drive time maps] [http://almetaplum.ifrance.com/view/vindication-of.html vindication of the rights of women wollstonecraft] [http://shareecoulter.ifrance.com/directory/robert-deniro.html snl robert deniro terrorist] [http://janettgleaves.22web.net/resources/bass-tab.html bass tab] [http://kyongbremer.ifrance.com/styles/micheal-jackson.html micheal jackson mp3] [http://tamcaston.ifrance.com/blog/mary-mccunn.html mary mccunn] [http://louveniacarreir.totalh.com/flinstons.htm flinstons] [http://homes-for-sale-in.scutari.info/ chandler arizona home for sale] [http://free-ringtones-for.clairce.info/ free ringtones for my verizon cell phone] [http://almetaplum.ifrance.com/view/remodeling.html remodeling] [http://lacreshamellott.ifrance.com/illahee-junior.htm illahee junior high] [http://breannpeabody.totalh.com/emergency-management.htm emergency management] [http://lacreshamellott.ifrance.com/female-doctor.htm female doctor physical exam] [http://evangelinaqueve.totalh.com/small/canada-direct.html canada direct tiger] [http://almetaplum.ifrance.com/view/casino-slots.html casino slots] [http://kyongbremer.ifrance.com/styles/male-country.html country free male nude singer site] [http://royal-lepage-st.charpit.info/ albert lepage royal st] [http://kyongbremer.ifrance.com/styles/window-valances.html window valances] [http://michelledolph.22web.net/1984-corvette-picture.html 1984 corvette picture] [http://17thn-cerita.ednskies.info/ 17thn cerita seru] [http://lizakratz.22web.net/comments/scottish-grocer.html scottish grocer awards] [http://lizakratz.22web.net/comments/landscape-design.html landscape design] [http://modafinil.eutocia.info/ modafinil] [http://breannpeabody.totalh.com/1969-chevy-impala.htm 1969 chevy impala] [http://ruthashores.totalh.com/small/icy-tower.html icy tower] [http://houston-real.clairce.info/ houston mo real estate] [http://olivaboatner.ifrance.com/library/air-canada-vacations.html air canada vacation ca] [http://quick-divorce.scutari.info/ quick divorce] [http://tamcaston.ifrance.com/blog/wheeled-duffle-bags.html wheeled duffle bags] [http://michigan-drinking.eutocia.info/ michigan drinking laws] [http://medscapecom.charpit.info/ abstract medline medscape.com] [http://eastern-district.eutocia.info/ eastern district new york local rules] [http://kyongbremer.ifrance.com/styles/large-poster-board.html large poster board] [http://ruthashores.totalh.com/small/global-thermal.html global thermal nuclear war] [http://kristlepoplin.22web.net/html/blizzardcom.html blizzard.com] [http://joananoon.22web.net/dania.html dania] [http://joananoon.22web.net/intestinal-juice.html intestinal juice] [http://kyongbremer.ifrance.com/styles/scryed.html scryed] [http://lacreshamellott.ifrance.com/dsl-verizon.htm dsl verizon] [http://kyongbremer.ifrance.com/styles/the-story-of-the.html the story of the nutcracker ballet] [http://iron-man-competition.dotlike.info/ iron man competition] [http://hdr-fx1.poptone.info/ sony hdr fx1 camcorder] [http://vacuum-relief.charpit.info/ vacuum relief valve] [http://shareecoulter.ifrance.com/directory/sports-drinks.html best sports drink] [http://japanese-bizarre.clairce.info/ japanese bizarre sex art] [http://pamela-andeson.poptone.info/ pamela andeson] [http://lacreshamellott.ifrance.com/what-is-implicit.htm what is implicit declaration of function] [http://mommy-diapering.reprime.info/ mommy diapering adults] [http://68.dotlike.info/ 68] [http://some.scutari.info/ come get some] [http://ruthashores.totalh.com/small/magnet-physics.html magnet physics] [http://olivaboatner.ifrance.com/library/video-libraries.html video libraries] [http://joananoon.22web.net/bacterial-infection.html bacterial infection] [http://electronic-data.eutocia.info/ electronic data services]
{{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