Logic gate (Entity): Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		 Note:This is the internal order, which is used for the SetMode input. Note that they internally start from 0.
Note:This is the internal order, which is used for the SetMode input. Note that they internally start from 0.
		
	
| No edit summary | Le Glaconus (talk | contribs)   (formatting) | ||
| Line 1: | Line 1: | ||
| {{this is a|point entity|name=logic_gate|game=Strata Source}} This logic entity acts as a simple boolean value comparator with two inputs. When disabled, this entity will still accept inputs, but not fire outputs! | {{this is a|point entity|name=logic_gate|game=Strata Source}} This logic entity acts as a simple [[boolean]] value comparator with two inputs. When disabled, this entity will still accept inputs, but not fire outputs! | ||
| Supported comparison modes are: | == Keyvalues == | ||
| {{KV Targetname}} | |||
| {{KV|Start Disabled|intn=StartDisabled|boolean|If it should start disabled}} | |||
| {{KV|Comparison Mode|intn=mode|choices|The comparison mode to use. Supported comparison modes are : | |||
| # AND | # AND | ||
| # OR | # OR | ||
| Line 9: | Line 12: | ||
| # XOR | # XOR | ||
| # XNOR | # XNOR | ||
| {{note|This is the internal order, which is used for the SetMode input. Note that they internally start from 0.}} }} | |||
| ==Flags== | == Flags == | ||
| {{fl|1|Spawn A enabled}} | |||
| {{fl|2|Spawn B enabled}} | |||
| {{fl|4|Output on every input (even if result doesn't change)}} | |||
| ==Inputs== | == Inputs == | ||
| {{I|SetStateA|Sets the boolean state of the A value}} | {{I|SetStateA|Sets the boolean state of the A value}} | ||
| {{I|SetStateB|Sets the boolean state of the B value}} | {{I|SetStateB|Sets the boolean state of the B value}} | ||
| {{I|SetMode|Sets the comparison mode. Input the index of the comparison mode as seen above - 1 (Starting from 0)}} | {{I|SetMode|Sets the comparison mode. Input the index of the comparison mode as seen above - 1 (Starting from 0)}} | ||
| {{I|GetValue|When fired, the logic_gate will call its OutValue outputs, using the current result state as the parameter (0, 1). Similar to  | {{I|GetValue|When fired, the {{code|preset=1|logic_gate}} will call its {{code|preset=1|OutValue}} outputs, using the current result state as the parameter (0, 1). Similar to {{ent|math_counter}})}} | ||
| {{I EnableDisable}} | {{I EnableDisable}} | ||
| {{I Toggle}} | {{I Toggle}} | ||
| ==Outputs== | == Outputs == | ||
| {{O|OnResultTrue|Called when the state is true}} | {{O|OnResultTrue|Called when the state is true}} | ||
| {{O|OnResultFalse|Called when the result is false}} | {{O|OnResultFalse|Called when the result is false}} | ||
| {{O|OutValue|Called when GetValue is fired. Automatically fills the parameter with the current result state (0, 1). Similar to  | {{O|OutValue|Called when GetValue is fired. Automatically fills the parameter with the current result state (0, 1). Similar to {{ent|math_counter}}}} | ||
| == See also == | == See also == | ||
| * | *{{ent|math_counter}} | ||
| *[[ | *[[Logic gate]] | ||
Revision as of 11:15, 8 July 2025
logic_gate  is a   point entity  available in  Strata Source. This logic entity acts as a simple boolean value comparator with two inputs. When disabled, this entity will still accept inputs, but not fire outputs!
 Strata Source. This logic entity acts as a simple boolean value comparator with two inputs. When disabled, this entity will still accept inputs, but not fire outputs!
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentnameortarget).
 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>
- If it should start disabled
- Comparison Mode (mode) <choices>
- The comparison mode to use. Supported comparison modes are :
- AND
- OR
- NOT
- NAND
- NOR
- XOR
- XNOR
 Note:This is the internal order, which is used for the SetMode input. Note that they internally start from 0.
Note:This is the internal order, which is used for the SetMode input. Note that they internally start from 0.Flags
- Spawn A enabled : [1]
- Spawn B enabled : [2]
- Output on every input (even if result doesn't change) : [4]
Inputs
- SetStateA
- Sets the boolean state of the A value
- SetStateB
- Sets the boolean state of the B value
- SetMode
- Sets the comparison mode. Input the index of the comparison mode as seen above - 1 (Starting from 0)
- GetValue
- When fired, the logic_gatewill call itsOutValueoutputs, using the current result state as the parameter (0, 1). Similar to math_counter)
EnableDisable:
- Enable / Disable
- Enable/disable this entity from performing its task. It might also disappear from view.
Toggle:
- Toggle
- Toggle the enabled/disabled status of this entity.
Outputs
- OnResultTrue
- Called when the state is true
- OnResultFalse
- Called when the result is false
- OutValue
- Called when GetValue is fired. Automatically fills the parameter with the current result state (0, 1). Similar to math_counter