Logic script: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Thunder4ik (talk | contribs) m (→Inputs: clean up, replaced: {{ModernNote| → {{note|) |
||
Line 18: | Line 18: | ||
== Inputs == | == Inputs == | ||
{{IO|RunScriptFile|Execute a [[VScript]] file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.|param=script|since={{l4d2}}|also={{tf2}}}} | {{IO|RunScriptFile|Execute a [[VScript]] file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.|param=script|since={{l4d2}}|also={{tf2}}}} | ||
{{IO|RunScriptCode|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. {{ModernBugfix|In Hammer, using string arguments will corrupt the [[VMF]] file's structure, making the file unviewable for the next Hammer session.|Remove the string argument manually with a text editor.}}{{ | {{IO|RunScriptCode|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. {{ModernBugfix|In Hammer, using string arguments will corrupt the [[VMF]] file's structure, making the file unviewable for the next Hammer session.|Remove the string argument manually with a text editor.}}{{note|{{tf2}} Backtick characters ` are replaced with quotation marks at runtime, allowing quotation marks to be used when normally not possible.}}|param=string|since={{l4d2}}|also={{tf2}}}} | ||
{{IO|CallScriptFunction|Calls a VScript function defined in the scope of the receiving entity.|param=string|since={{l4d2}}|also={{tf2}}|nofgd=1}} | {{IO|CallScriptFunction|Calls a VScript function defined in the scope of the receiving entity.|param=string|since={{l4d2}}|also={{tf2}}|nofgd=1}} | ||
{{IO|TerminateScriptScope|Destroys the script scope of the receving entity.|only={{tf2}}|nofgd=1}} | {{IO|TerminateScriptScope|Destroys the script scope of the receving entity.|only={{tf2}}|nofgd=1}} |
Revision as of 00:41, 4 January 2024
![]() |
---|
CLogicScript |
Template:Entity It is also available in Team Fortress 2 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
)
- 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:ModernBugfix
- 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