Logic script: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 5: Line 5:
;EntityGroup[0-15] Group00-Group15 <code><[[targetname]]></code>
;EntityGroup[0-15] Group00-Group15 <code><[[targetname]]></code>
:<target_destination>  
:<target_destination>  
{{Note|The array can be extended beyond 15 entities. Simply add additional Group## keys with SmartEdit turned off.}}  
{{Note|The array can be extended beyond 16 entities. Simply add additional Group## keys with SmartEdit turned off.}}  
{{KV Targetname}}
{{KV Targetname}}



Revision as of 10:20, 7 March 2011

SquirrelTemplate: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>
Note.pngNote:The array can be extended beyond 16 entities. Simply add additional Group## keys with SmartEdit turned off.
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

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