Logic script: Difference between revisions
Jump to navigation
Jump to search
(-removed toc and kept only the most relevant inputs and keyvalues for this entity) |
m (→KeyValues) |
||
Line 5: | Line 5: | ||
==KeyValues== | ==KeyValues== | ||
{{KV|EntityGroup[0]| | {{KV|start}} | ||
{{KV| | {{KV|new=1|Group00|toKey=Group15|target_destination|EntityGroup[0]|toPN=EntityGroup[15]|Entities to add in the EntityGroup array for the script.}} | ||
{{KV|[[Entity_Scripts#Thinker_Functions|Think function]] | {{KV|new=1|vscripts|scriptlist|Entity Scripts|since=L4D2|Space delimited list of [[VScript]] files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.}} | ||
{{KV|new=1|thinkfunction|string|[[Entity_Scripts#Thinker_Functions|Think function]]|since=L4D2|Name of the function within this entity's script that'll be called automatically every 100 milliseconds, or a user-defined interval if the function returns a number. Avoid [[expensive]] operations in this function, as it may cause performance problems.}} | |||
{{KV|end}} | |||
== Inputs == | == Inputs == |
Revision as of 12:23, 22 March 2023
![]() |
---|
CLogicScript |
Template:Entity It is also available in Team Fortress 2 and it 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
)
- 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
)
- 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. Template:ModernBugfixTemplate:ModernNote
- CallScriptFunction <string > (in all games since
) (also in
) !FGD
- Calls a VScript function defined in the scope of the receiving entity.
- TerminateScriptScope (only in
) !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