Zh/VScript: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
No edit summary
(Update from the EN Ver. / 同步更新)
Line 1: Line 1:
{{LanguageBar|title = VScript}}
{{LanguageBar|title = VScript}}


本页面内容由[[User:Yakumo_koishi|Ellent]]翻译,基于先前[//steamcommunity.com/id/utagawashii/ Dazai Nerau]的版本参照英文原页面进行了更新. 欢迎任何人补充新内容或者修改其中的错误。
本页面内容最后由[[User:115steam|115steam]]翻译,基于先前[[User:Yakumo_koishi|Ellent]][//steamcommunity.com/id/utagawashii/ Dazai Nerau]的版本参照英文原页面进行了更新. 欢迎任何人补充新内容或者修改其中的错误。
最后修改时间(截止至本次编辑):2024.10.29
最后修改时间(截止至本次编辑):2025.2.24
----
----
__NOTOC__
__NOTOC__
'''VScript''',在{{l4d2|4}}中首次引入,在后来的更新中被移植回了{{tf2|4}},是一种用于脚本编程的虚拟机,它在{{source|4}}引擎和{{source2|4}}和外部脚本之间充当一个抽象的绑定层。根据{{astools|4.1}}我们可以推知,以下的脚本语言已经或者在不久的将来能够得到支持:
'''VScript''',在{{l4d2|4}}中首次引入,在后来的更新中被移植回了{{tf2|4}}(包括 [[TF2 branch|此游戏衍生的分支]]),是一种用于脚本编程的虚拟机,它在{{source|4}}引擎和{{source2|4}}和外部脚本之间充当一个抽象的绑定层。根据{{astools|4.1}}我们可以推知,以下的脚本语言已经或者在不久的将来能够得到支持:




* [[Squirrel]]
* [[Squirrel]] {{todo|参考翻译:松鼠脚本}}
* [[Wikipedia:Lua (programming language)|Lua]]
* [[Wikipedia:Lua (programming language)|Lua]]
* [[Wikipedia:GameMonkey Script|Gamemonkey]]
* [[Wikipedia:GameMonkey Script|Gamemonkey]]
Line 15: Line 15:
脚本文件放置于游戏目录内的 <code>scripts/vscripts/</code> 文件夹中。
脚本文件放置于游戏目录内的 <code>scripts/vscripts/</code> 文件夹中。


要了解如何使用 VScript,请参阅 {{L|VScript Fundamentals|VScript 基本原理}}{{zh-cn}}。
要了解如何使用 VScript,请参阅: {{L|VScript Fundamentals|VScript 基本原理}}{{zh-cn}} 。
 


==实现==
==实现==
Line 22: Line 23:
|style=padding-right:2em|
|style=padding-right:2em|
==={{L|Squirrel}} {{sq}}===
==={{L|Squirrel}} {{sq}}===
{{src13mp|4|nt=sdkshort|addtext={{nbsp}}(2025)}} ({{tf2}} {{css}} {{dods}} {{hl2dm}} {{hldms}})
:所有这些游戏均运行于 {{tf2}} 引擎分支,继承了非游戏专属功能,但未添加额外游戏专属功能。
:[[Source SDK Base 2013/Scripting/VScript Examples|脚本范例]]


{{tf2|4}}
{{tf2|4}}
:[[TF2 VScript Examples|脚本范例]]
::[[Team Fortress 2/Scripting/Script Functions|脚本API列表]]
:[[Team Fortress 2/Scripting/Script Functions|脚本API列表]]
::[[Team Fortress 2/Scripting/VScript Examples|脚本范例]]
::[[Counter-Strike: Source/Scripting/Game Events|游戏事件示例]]
 
:{{css|4}}
::[[Counter-Strike: Source/Scripting/VScript Examples|脚本范例]]
::[[Counter-Strike: Source/Scripting/Game Events|游戏事件示例]]
 
:{{dods|4}}
::[[Day of Defeat: Source/Scripting/Game Events|游戏事件示例]]
 
:{{hl2dm|4}}
::[[Half-Life 2: Deathmatch/Scripting/Game Events|游戏事件示例]]


{{l4d2|4}}
{{l4d2|4}}
Line 66: Line 82:
:[[Mapbase/Scripting|脚本编写]]
:[[Mapbase/Scripting|脚本编写]]
:[[Mapbase/Scripting/Script_Functions|脚本API列表]]
:[[Mapbase/Scripting/Script_Functions|脚本API列表]]
{{jbep3|4}}
:[[List of Jabroni Brawl: Episode 3 Script Functions|脚本API列表]]
|style=padding-right:2em|
|style=padding-right:2em|
===Lua {{lua}}===
===Lua {{lua}}===
Line 94: Line 113:


===Python===
===Python===
;{{Tf2|4}}
;{{sfm|4}}
;{{sfm|4}}
:{{L|SFM/Scripting_with_Python|脚本/操控}}
:{{L|SFM/Scripting_with_Python|脚本/操控}}
Line 101: Line 122:
*{{L|Entity_Scripts|实体脚本}}{{zh-cn}}
*{{L|Entity_Scripts|实体脚本}}{{zh-cn}}
*{{L|Logic_script|logic_script}}
*{{L|Logic_script|logic_script}}
*{{ent|script}}, {{ent|script_execute}} (控制台命令)


{{ACategory|VScript}}
{{ACategory|VScript}}
{{ACategory|Technical}}
{{ACategory|Technical}}
{{ACategory|Scripting}}
{{ACategory|Scripting}}

Revision as of 21:11, 23 February 2025

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)

本页面内容最后由115steam翻译,基于先前EllentDazai Nerau的版本参照英文原页面进行了更新. 欢迎任何人补充新内容或者修改其中的错误。 最后修改时间(截止至本次编辑):2025.2.24


VScript,在求生之路2 求生之路2中首次引入,在后来的更新中被移植回了军团要塞2 军团要塞2(包括 此游戏衍生的分支),是一种用于脚本编程的虚拟机,它在起源 起源引擎和起源2 起源2和外部脚本之间充当一个抽象的绑定层。根据Alien Swarm - SDK Alien Swarm - SDK我们可以推知,以下的脚本语言已经或者在不久的将来能够得到支持:


脚本文件放置于游戏目录内的 scripts/vscripts/ 文件夹中。

要了解如何使用 VScript,请参阅: VScript 基本原理(en)

Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|zh}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.


实现

Squirrel(en) Squirrel

起源2013 多人分支 SDK Base 2013 - MP (2025) (军团要塞2 反恐精英:起源 胜利之日:起源 半衰期2:死亡竞赛 半衰期死亡竞赛:起源)

所有这些游戏均运行于 军团要塞2 引擎分支,继承了非游戏专属功能,但未添加额外游戏专属功能。
脚本范例

军团要塞2 军团要塞2

脚本API列表
脚本范例
游戏事件示例
反恐精英:起源 反恐精英:起源
脚本范例
游戏事件示例
胜利之日:起源 胜利之日:起源
游戏事件示例
半衰期2:死亡竞赛 半衰期2:死亡竞赛
游戏事件示例

求生之路2 求生之路2

脚本介绍(en)
Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|zh}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
导演脚本(en)
Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|zh}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.
脚本范例(en)
脚本API列表(en)

异形丛生 异形丛生

传送门2 传送门2

脚本API列表(en)

传送门 2:社区特供版 传送门 2:社区特供版

Vscript相关文档位于其专用页面 Vscript API Reference

起源电影制作器 起源电影制作器

军团要塞2 的仅存在于 TF2 的 SFM 版本中。没有 TF2 或 SFM 特定的 API。不可用。

反恐精英:全球攻势 反恐精英:全球攻势

脚本API列表(en)
侦听游戏事件(en)
脚本范例(en)

Contagion Contagion

脚本API列表(en)

Nuclear Dawn Nuclear Dawn

脚本API列表(en)

Titanfall Titanfall

Alien Swarm: Reactive Drop Alien Swarm: Reactive Drop

脚本API列表(en)

Mapbase Mapbase (自定义版本)

脚本编写
脚本API列表

Jabroni Brawl: Episode 3 Jabroni Brawl: Episode 3

脚本API列表

Lua Lua

传送门2 传送门2 (仅限于客户端/用户界面)

Dota 2 Dota 2

脚本介绍(en)
脚本 API(en)

Garry's Mod Garry's Mod

官方教程

SteamVR Home SteamVR Home

脚本介绍(en)
脚本 API(en)
脚本化工具创建(en)
脚本化闪光灯工具教程(en)

半衰期:爱莉克斯 半衰期:爱莉克斯

脚本介绍(en)
脚本 API(en)
General 起源2 起源2
Source 2 Animation System VScript API(en)

Jabroni Brawl: Episode 3 Jabroni Brawl: Episode 3

脚本API列表

Python

军团要塞2 军团要塞2
起源电影制作器 起源电影制作器
脚本/操控(en)

推荐阅读

Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
Use {{Flag|zh}} instead.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.