logic_script
Jump to navigation
Jump to search
Template:L4d2 point It is an entity that acts as a container for VScript. For example, the entity is used extensively with vscripts for the logic in "carnival games" found in the Dark Carnival campaign--Peanut Gallery, Strongman Contest, Whack-a-Stach, etc.
KeyValues
- EntityGroup[0-15] Group00-Group15
<targetname>
- <target_destination>

- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
Additional KeyValues
These additional keys can to be added to the entity with SmartEdit turned off.
- vscripts
<string>
- Name(s) of script files that are executed after all entities have spawned. The location of the vscript, starting at scripts/vscripts. Example: carnival_games/gallery_copy_rotators\
- thinkfunction
<string>
- Name of a function in this entity's script scope which will be called automatically. In L4D2, this allows a function specified to be called every 100 milliseconds (ten times a second) for the duration of the script. You tell it which function to call by adding a thinkfunction key value in your logic_script, setting the value to the name of the function. Valve uses "Think" as the name of the function for their "carnival games". You don't want to do much in this function if it takes more than a 100 milliseconds as it may cause issues.
Inputs
Outputs
See also
External links
- It's the vscript'ing documentation FAQ! (Steam Forums)
- Tutorial - Writing a Mini Game - Tic Tac Toe - Part One (Steam Forums) - An excellent scripting example that uses logic_script to create a tic-tac-toe game with a difficult AI.