Logic script: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| m (Mapbase) | m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.) | ||
| Line 5: | Line 5: | ||
| [[File:Logic_script_src2.png|left|Source 2 editor sprite]] | [[File:Logic_script_src2.png|left|Source 2 editor sprite]] | ||
| {{this is a| | {{this is a|point entity|name=logic_script|since=Left 4 Dead 2}} It is also available in {{tf2|4}} and {{mapbase|4}} and it is the container for [[VScript]]s. In Left 4 Dead 2, for example, this entity is used extensively for the logic in "carnival games" found in the Dark Carnival campaign, such as ''Peanut Gallery'', ''Strongman Contest'', ''Whack-a-Stach'', etc. | ||
| {{clr}} | {{clr}} | ||
Revision as of 17:51, 17 May 2024
|  Class hierarchy | 
|---|
| CLogicScript | 
logic_script  is a   point entity  available in all  Source games since
 Source games since  Left 4 Dead 2. It is also available in
 Left 4 Dead 2. It is also available in  Team Fortress 2 and
 Team Fortress 2 and  Mapbase and it is the container for VScripts. In Left 4 Dead 2, for example, this entity is used extensively for the logic in "carnival games" found in the Dark Carnival campaign, such as Peanut Gallery, Strongman Contest, Whack-a-Stach, etc.
 Mapbase and it is the container for VScripts. In Left 4 Dead 2, for example, this entity is used extensively for the logic in "carnival games" found in the Dark Carnival campaign, such as Peanut Gallery, Strongman Contest, Whack-a-Stach, etc.
KeyValues
- start ([todo internal name (i)])
- Group00 ([todo internal name (i)]) <targetname>
- EntityGroup[0]
- vscripts ([todo internal name (i)])  <scriptlist> (in all games since  ) )
- Entity Scripts
- thinkfunction ([todo internal name (i)])  <string> (in all games since  ) )
- Think function
- end ([todo internal name (i)])
Inputs
- RunScriptFile  <script> (in all games since  ) (also in ) (also in ) )
- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
- RunScriptCode  <string> (in all games since  ) (also in ) (also in ) )
- Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. 
- CallScriptFunction  <string> (in all games since  ) (also in ) (also in ) !FGD ) !FGD
- Calls a VScript function defined in the scope of the receiving entity.
- TerminateScriptScope   (only in  ) !FGD ) !FGD
- Destroys the script scope of the receving entity.
See also
External links
- It's the vscript'ing documentation FAQ! (Steam Forums)
- Scripting for Left 4 Dead 2 (Leeland.net) - Example uses of logic_script































