Zh/Left 4 Dead 2/Scripting/Director Scripts: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{otherlang2 |title=求生之路2 导演脚本 |noborder=true |en=L4D2_Vscripts }} {{toc-right}}{{sq}}{{l4d2}} '''Left 4 Dead 2 Director scripts''' are L4D2_Vscripts|vscri...")
 
mNo edit summary
 
(82 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{otherlang2
{{LanguageBar|title = 求生之路2 导演脚本}}
|title=求生之路2 导演脚本
|noborder=true
|en=L4D2_Vscripts
}}


{{Updatetranslation}}
{{toc-right}}{{sq}}{{l4d2}} '''求生之路2导演脚本''' 是主要用于影响人工智能导演系统(AI Director)的行为的 {{L|L4D2 Vscripts|脚本}}. 它们被广泛用于自定义结局和尸潮事件.


{{toc-right}}{{sq}}{{l4d2}} '''Left 4 Dead 2 Director scripts''' are [[L4D2_Vscripts|vscripts]] that are primarily used to influence the behavior of the AI Director. They are extensively used for custom finales and gauntlet events.  
本页面内容由[//steamcommunity.com/id/utagawashii/ Dazai Nerau]译自{{L|L4D2_Director_Scripts|英文版页面}}. 欢迎任何人补充新内容或者修改其中的错误.


== Usage ==
== 用法 ==


Director scripts are executed with inputs to the [[info_director]] entity. A [[#DirectorOptions|<code>DirectorOptions</code>]] table is used to give new temporary values for the variables the director uses for decision making. Additional commands can be accessed through the [[List_of_L4D2_Script_Functions#CDirector|<code>Director</code>]] object. Only one Director script can be running at a time.
执行导演脚本的方式是向 {{ent|info_director}} 实体进行输入(input). 一个[[#DirectorOptions|<code>导演设置</code>]]表用于给导演系统所使用的变量提供新的临时值. 其他额外的命令可以通过[[Left 4 Dead 2/Script Functions#CDirector|<code>Director</code>]]对象访问. {{Warning|'''一次只能同时执行一个导演脚本!'''}}


=== Inputs ===
=== 输入 ===
;<code>BeginScript <''script name''></code>
;<code>BeginScript <''script name''></code>
:Executes a generic Director script, for example for onslaught events or changing spawning behavior.
:执行一个普通的导演脚本, 比如为了onslaught事件而设计的脚本.
;<code>EndScript</code>
;<code>EndScript</code>
:Ends the running script and resets the Director options to the map specific values.
:停止执行脚本并重置导演系统设置中的变量值.
;<code>BeginScriptedPanicEvent <''script name''></code>
;<code>BeginScriptedPanicEvent <''script name''></code>
:Begins a Scripted Panic Event.
:执行一次脚本化的尸潮


{{note|Scripts used with <code>BeginScriptedPanicEvent</code> will not work if they are in a subdirectory, even though you can use subdirectories in other script contexts. They must reside under the vscripts folder, or they will simply act as a 1 stage 1 second delay.}}
{{note|如果脚本位于子目录中,则与<code>BeginScriptedPanicEvent</code>一起使用的脚本将无法工作,即使你能在其他脚本的上下文中使用子目录. 它们必须位于vscripts文件夹下,否则它们只会简单地以1个阶段1秒的延迟运作.}}


== 通用脚本与尸潮 ==
当导演系统执行<code>BeginScript</code>输入时,指定的脚本便会运行,直到新的脚本被执行。或者脚本也可通过<code>EndScript</code>输入来手动结束. 除非改变了导演设置,否则游戏模式照常运行。


== General scripts and Onslaughts ==
尸潮事件可以通过操纵感染者和特感的数量上限以及游戏节奏来实现。
Scripts launched with the <code>BeginScript</code> Director input run until a different script is launched, or the script is manually ended with the <code>EndScript</code> input. Unless new Director Options are set, the gameplay continues on as normally.


Onslaught events are created by manipulating the pacing and spawn limits of mobs and special infected.
<code>c2m4_barns_onslaught.nut</code> (附注释):
 
<code>c2m4_barns_onslaught.nut</code> (with annotations):
{{ScrollBox|<source lang=cpp>
{{ScrollBox|<source lang=cpp>
Msg("Initiating Onslaught\n");
Msg("Initiating Onslaught\n");


DirectorOptions <-
DirectorOptions <-  
{
{
// This turns off tanks and witches (when true).
//允许BOSS感染者 (false = 允许  ; true = 禁止)
ProhibitBosses = false
ProhibitBosses = false
        //锁定游戏节奏 (true = 锁定 ; false = 不锁定)
        //一般的地图没有必要锁定游戏节奏,除非你需要大量地无限制地刷尸潮,就像大灾变那样
//LockTempo = true
//LockTempo = true


// Sets the time between mob spawns. Mobs can only spawn when the pacing is in the BUILD_UP state.
// 设置感染者的产生时间间隔. 感染者只有在节奏处于BUILD_UP状态时才会产生.
MobSpawnMinTime = 1
MobSpawnMinTime = 1
MobSpawnMaxTime = 1
MobSpawnMaxTime = 1


// How many zombies are in each mob.
// 每波尸潮产生多少感染者.
MobMinSize = 30
MobMinSize = 30
MobMaxSize = 30
MobMaxSize = 30
MobMaxPending = 30
MobMaxPending = 30


// Modifies the length of the SUSTAIN_PEAK and RELAX states to shorten the time between mob spawns.
// 修改SUSTAIN_PEAK 和 RELAX 状态的时间长度以缩短感染者产生的时间间隔.
SustainPeakMinTime = 5
SustainPeakMinTime = 5
SustainPeakMaxTime = 10
SustainPeakMaxTime = 10
Line 56: Line 55:
RelaxMaxFlowTravel = 50
RelaxMaxFlowTravel = 50


//Special infected options
//特感设置
SpecialRespawnInterval = 1.0
SpecialRespawnInterval = 1.0
         SmokerLimit = 2
         SmokerLimit = 2
Line 64: Line 63:
         ChargerLimit = 1
         ChargerLimit = 1


// Valid spawn locations
// 有效产生区域
PreferredMobDirection = SPAWN_NO_PREFERENCE
PreferredMobDirection = SPAWN_NO_PREFERENCE
ZombieSpawnRange = 2000
ZombieSpawnRange = 2000
}
}


Director.ResetMobTimer() // Sets the mob spawn timer to 0.
Director.ResetMobTimer() // 将感染者产生计时器归零(只在节奏未锁定时有意义).
Director.PlayMegaMobWarningSounds() // Plays the incoming mob sound effect.
Director.PlayMegaMobWarningSounds() // 即将尸潮音效.
</source>}}
</source>}}


== 结局与脚本化的尸潮事件 ==
结局与脚本化的尸潮事件包含了数种被设置于<code>DirectorOptions</code>之中的不同的阶段.


== Finales and Scripted Panic Events ==
结局的导演脚本通常从 <code><''map name''>_finale.nut</code> 中被加载. 脚本化的尸潮事件则可以从 {{L|info_director}} 的 <code>BeginScriptedPanicEvent</code> 输入中被执行.  
Finales and Scripted Panic Events consist of a number of different kind of stages set in <code>DirectorOptions</code>.
{{bug|hidetested=1|当trigger_finale被设置成针对一个特定的脚本时, 它将失去作用.}}
 
The Director script for the finale is always loaded from <code><''map name''>_finale.nut</code>. Scripted panic events are launched from the [[info_director]] <code>BeginScriptedPanicEvent</code> input.  
{{bug|While the trigger_finale entity has an option to specify a script, it is non-functional.}}
 
 
A stage can be one of 4 types (other values will break the finale and go right to ESCAPE):
*PANIC - A panic event, the value is the number of waves of infected.
*TANK - Spawn a tank(s), the value is the number of tanks to spawn.
*DELAY - A delay, the value is the number of seconds to wait before proceeding to the next stage.
*SCRIPTED (also called ONSLAUGHT) - The value should be the name of a VScript to call or "" (which will do nothing), any bad value here will crash you to the desktop. Your script is responsible for sending an <code>EndCustomScriptedStage</code> input to the director (a goal of your choice, like a certain trigger volume, timer, random value, etc.). [[trigger_finale]] input <code>AdvanceFinaleState</code> may also work. Otherwise, the '''onslaught will not end.'''


阶段的类型有四种 (其他值会打断结局并使得玩家直接成功获救(ESCAPE)):
*PANIC - 尸潮, 数值是感染者的波数.
*TANK - 产生tank, 数值是产生tank的数量.
*DELAY - 间歇, 数值是进入下一阶段前等待的秒数.
*SCRIPTED (也叫ONSLAUGHT) - 数值是要调用的VScript的脚本名或者"" (这样设置的的话导演系统将不做任何行为), 如果在这里乱写的话你的游戏就会崩溃. 你的脚本会负责发送 <code>EndCustomScriptedStage</code> 输入给导演系统 (你选择的目标, 比如某个确切的触发量, 计时器, 随机值, 等等.). {{L|trigger_finale}} 输入 <code>AdvanceFinaleState</code> 应该也能工作. 否则, '''尸潮事件不会结束'''


An example custom finale script:
一个关于自定义结局脚本的例子:
{{ScrollBox|<source lang=cpp>
{{ScrollBox|<source lang=cpp>
ERROR <- -1
ERROR <- -1
Line 96: Line 92:
SCRIPTED <- 3  
SCRIPTED <- 3  


DirectorOptions <-
DirectorOptions <-  
{
{
//-----------------------------------------------------
//-----------------------------------------------------
A_CustomFinale_StageCount = 8 // Number of stages. Used for calculating the Versus score.
A_CustomFinale_StageCount = 8 // 阶段的数量. 用于计算对抗得分.
 
 
A_CustomFinale1 = PANIC
A_CustomFinale1 = PANIC
A_CustomFinaleValue1 = 2  // Two panic waves.
A_CustomFinaleValue1 = 2  // 两拨尸潮.
 
 
A_CustomFinale2 = DELAY
A_CustomFinale2 = DELAY
A_CustomFinaleValue2 = 12  // Delay for twelve seconds in addition to stage delay.
A_CustomFinaleValue2 = 12  // 延迟12秒进入下一阶段.
 
 
A_CustomFinale3 = TANK
A_CustomFinale3 = TANK
A_CustomFinaleValue3 = 3  // 3 tanks!
A_CustomFinaleValue3 = 3  // 3只tank!
 
 
A_CustomFinale4 = DELAY
A_CustomFinale4 = DELAY
A_CustomFinaleValue4 = 12 // Wait some more.
A_CustomFinaleValue4 = 12 // 等一段时间.
 
 
A_CustomFinale5 = SCRIPTED
A_CustomFinale5 = SCRIPTED
A_CustomFinaleValue5 = "my_scripted_stage.nut" // Run a custom scripted stage using a separate script.
A_CustomFinaleValue5 = "my_scripted_stage.nut" // 运行自定义脚本.
 
 
A_CustomFinale6 = DELAY
A_CustomFinale6 = DELAY
A_CustomFinaleValue6 = 15 // Wait 15 seconds.
A_CustomFinaleValue6 = 15 // 等它个15秒.
 
 
A_CustomFinale7 = TANK
A_CustomFinale7 = TANK
A_CustomFinaleValue7 = 1  // One more tank.
A_CustomFinaleValue7 = 1  // tank什么的可以再来一只.


A_CustomFinale8 = DELAY
A_CustomFinale8 = DELAY
A_CustomFinaleValue8 = 10 // Wait ten seconds ... rescue!
A_CustomFinaleValue8 = 10 // 再撑10秒 ... 获救!




Line 132: Line 128:
}
}


function OnBeginCustomFinaleStage( num, type ) // This function is run at the beginning of every stage.
function OnBeginCustomFinaleStage( num, type ) // 这个函数会在每个阶段开始时被调用.
{
{
       printl( "Beginning custom finale stage " + num + " of type " + type );
       printl( "Beginning custom finale stage " + num + " of type " + type );
       MapScript.DirectorOptions.CommonLimit <- num * 10 // Increase commons by 10 linearly with stages.
       MapScript.DirectorOptions.CommonLimit <- num * 10 // 随着阶段线性增加10个感染者.
}</source>}}
}</source>}}


 
== 智能的剧情性节奏(Adaptive Dramatic Pacing) ==
== Adaptive Dramatic Pacing ==
{{todo|Add info from [http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdf]}}
{{todo|Add info from [http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdf]}}


 
== 回调 ==
== Callbacks ==


*'''<code>void Update()</code>'''
*'''<code>void Update()</code>'''
:If you define an <code>Update()</code> function in your Director Script, it will run repeatedly much like a <code>Think()</code> function, but ONLY a finale via [[trigger_finale]] is triggered, if you have multiple scripts that are running that define it, they all will be called. The use of Update() is also found in the Bleed Out mutation (mutation3.nut), but needs further testing to see see if it behaves the same way like during a finale.
:如果在导演脚本中定义了<code>Update()</code>函数,它会像<code>Think()</code>函数一样重复运行,但只有在通过{{L|trigger_finale}}触发结局时才会运行。如果有多个运行中的脚本定义了它,它们都会被调用。Update()的使用也在"Bleed Out"突变模式(mutation3.nut)中被发现,但需要进一步测试以查看其行为是否与结局期间相同。


=== Finale Script specific ===
=== 结局脚本专属 ===


*'''<code>void OnBeginCustomFinaleStage(int ''num'', int ''type'')</code>'''
*'''<code>void OnBeginCustomFinaleStage(int ''num'', int ''type'')</code>'''
:If defined, will be called on every stage change with the number, and type, this is how you would change director options between stages (spawn directions, etc). <code>num</code> refers to the finale stage number passed by the director and <code>type</code> is the stage type (PANIC, TANK, etc.).
:如果定义了,将在每个阶段改变时被调用,带有阶段编号和类型,这是你在阶段之间更改导演选项(生成方向等)的方式。<code>num</code>指的是导演传递的结局阶段编号,<code>type</code>是阶段类型(PANIC, TANK等)。


*'''<code>function OnChangeFinaleMusic()</code>'''  
*'''<code>function OnChangeFinaleMusic()</code>'''  
:{{todo|confirm category/working}}
:{{todo|确认类别/工作}}


*'''<code>function OnChangeFinaleStage(?)</code>'''  
*'''<code>function OnChangeFinaleStage(?)</code>'''  
:{{todo|confirm category/working}}
:{{todo|确认类别/工作}}
 
== DirectorOptions ==
The <code>DirectorOptions</code> table is used for overriding various Director variables that govern among other things, infected spawning, finale stages and more.
 
{{note|In mode and map scripts, use the SessionOptions table to influence the director instead, or the MutationOptions/MapOptions tables for initial values. The DirectorOptions table can get overwritten or cleared by map events, and writing a new DirectorOptions on a finale will erase the finale script.}}
 
 
 
Information about some of the Director Options found in the [http://forums.steampowered.com/forums/showthread.php?t=1238461 Steam Forums].
 


:<strong style="color:#FF0000;">[[File:Warning.png|link=|alt=]] Warning:</strong> The Fields interact a lot
== 导演设置 ==
:For instance, SpecialRespawnInterval is "how long after a special of type X dies can we spawn another one." Setting this fairly high (the default) makes a lot of sense in a flow based movement. Whereas if you are building a mutation where you stay in a single place, or where you want a ton of boomers, keeping it set high means that whenever you kill a boomer there will be a long wait until the Director is allowed to spawn a new one. So you'd want to set this value very low if your mod wants to do that.
<code>DirectorOptions</code>表里的各种变量就是用来让你随便改的。


:This brings up the main point: often things don't work as expected, because the DirectorOptions have been set in ways that conflict, causing unexpected behaviors. You can set 3 variables to get what you want, but a 4th may default to something that thwarts you. So it is worth learning about all the options, because it is very easy to over-constrain the Director. When you see odd behavior, think about what other variables and settings might be interfering with your plans.  
{{note|在模式和地图脚本中, 应当使用SessionOptions表来影响导演系统, 或者用MutationOptions/MapOptions 表来初始化数值. DirectorOptions表可以被地图事件复写或者重设, 如果你在结局阶段写了一个新的DirectorOptions表则将会使得结局脚本失效.}}


更多关于导演设置的信息可以查阅[http://forums.steampowered.com/forums/showthread.php?t=1238461 Steam论坛].


:<strong style="color:#FF0000;">[[File:Warning.png|link=|alt=]] Warning:</strong> NEVER use the '''=''' operator when trying to influence the director. Use <-. The difference is semantics. If you use =, it will throw an error if the table slot isn't defined (like if a previous script didn't define it). <-, on the other hand, will create the variable if it does not exist.
{{Warning|鉴于该区域有太多的互动方式,你必须小心地进行设置,以确保设置符合你所需要的结果。同时,如果设置后的导演设置没有起到预期的效果,说明它们之间可能存在冲突。你需要确保你的逻辑无误或者设置一些机制来避免冲突。}}


{{Warning|绝对不要使用 '''{{=}}''' 操作符来控制Director. 请使用 '''<-'''. 它们的区别在于语义. 如果你用了{{=}}, 而该值又未声明,则会抛出错误. 而<-, 在另一方面, 能够顺便创建不存在的数值.}}


{{note|The default values are for reference of the values set elsewhere in-game, and do NOT mean that the DirectorOption is set by default.}}
{{note|默认值(Default values)只是给你提供参考,而并非意味着DirectorOption中的变量默认就是这些值.}}


=== General ===
=== 通用 ===


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>AddToSpawnTimer</code>  
|<code>AddToSpawnTimer</code>  
Line 216: Line 202:
|int
|int
|  
|  
|Percent chance (0-100) that cleared nav areas will get re-populated with wanderers.
|已经安全的nav区域重新填充感染者的百分比机会(0-100)
|-
|-
|<code>DisallowThreatType</code>  
|<code>DisallowThreatType</code>  
|int
|int
|  
|  
|Disallows boss types from being spawned in ''threat'' areas in coop mode. Valid flags are: <code>ZOMBIE_WITCH, ZOMBIE_TANK</code>
|禁止BOSS感染者在合作模式的''threat'' 区域中产生. 有效类型: <code>ZOMBIE_WITCH, ZOMBIE_TANK</code>
|-
|-
|<code>FallenSurvivorPotentialQuantity</code>  
|<code>FallenSurvivorPotentialQuantity</code>  
|int
|int
|  
|  
|How many fallen survivors can spawn in total.
|总共有多少倒地的幸存者能出生.
|-
|-
|<code>FallenSurvivorSpawnChance</code>  
|<code>FallenSurvivorSpawnChance</code>  
Line 236: Line 222:
|int
|int
|2500
|2500
|The maximum range common infected can spot survivors.
|感染者能识别人类的最大距离.
|-
|-
|<code>NearAcquireRange</code>  
|<code>NearAcquireRange</code>  
|int
|int
|200
|200
|The range where common infected can spot survivors in the least amount of time.
|感染者能识别人类的最近距离.
|-
|-
|<code>FarAcquireTime</code>  
|<code>FarAcquireTime</code>  
|float
|float
|5.0  
|5.0  
|The time it takes for an infected to acquire the survivor after spotting them at maximum range.
|感染者识别人类需要花费的最长时间
|-
|-
|<code>NearAcquireTime</code>  
|<code>NearAcquireTime</code>  
|float
|float
|0.5
|0.5
|The time it takes for an infected to acquire the survivor after spotting them at minimum range.
|感染者识别人类需要花费的最短时间
|-
|-
|<code>GasCansOnBacks</code>  
|<code>GasCansOnBacks</code>  
|bool
|bool
|  
|  
|Puts the Hard Rain diesel cans on the survivors backs.
|将Hard Rain的油罐放在生还者的背上
|-
|-
|<code>IgnoreNavThreatAreas</code>  
|<code>IgnoreNavThreatAreas</code>  
|bool
|bool
|  
|  
|Likely prevents bosses from spawning along the nav. {{todo|confirm category/working}}
|或许会阻止BOSS沿着nav产生. {{todo|确认类别/工作}}
|-
|-
|<code>InfectedFlags</code>  
|<code>InfectedFlags</code>  
|int
|int
|  
|  
|Applies flags to newly spawned infected. Valid flags are: <code>INFECTED_FLAG_CANT_SEE_SURVIVORS, INFECTED_FLAG_CANT_HEAR_SURVIVORS, INFECTED_FLAG_CANT_FEEL_SURVIVORS</code>
|赋予新产生的感染者一些标签,标签包括: <code>INFECTED_FLAG_CANT_SEE_SURVIVORS, INFECTED_FLAG_CANT_HEAR_SURVIVORS, INFECTED_FLAG_CANT_FEEL_SURVIVORS</code>
|-
|-
|<code>IntensityRelaxAllowWanderersThreshold</code>  
|<code>IntensityRelaxAllowWanderersThreshold</code>  
Line 276: Line 262:
|float
|float
|  
|  
|All survivors must be below this intensity before a Peak is allowed to switch to Relax (in addition to the normal peak timer)
|在允许Peak转换为Relax之前,所有幸存者必须低于此强度(除了正常的峰值计时器)
|-
|-
|<code>JournalString</code>  
|<code>JournalString</code>  
|string
|string
|
|
|{{todo|Used in holdout, seems to build some kind of table.}}
|{{todo|在抵抗模式中有用,似乎构建了某种表.}}
|-
|-
|<code>LockTempo</code>  
|<code>LockTempo</code>  
|bool
|bool
|false
|false
|The horde spawning pacing consists of:  BUILD_UP -> spawn horde -> SUSTAIN_PEAK -> RELAX -> BUILD_UP again. Setting  LockTempo = true removes the "SUSTAIN_PEAK -> RELAX -> BUILD_UP" bit making your hordes spawn constantly without a delay.
|尸潮产生的节奏是这样的:  BUILD_UP -> 产生尸潮 -> SUSTAIN_PEAK -> RELAX -> 再次 BUILD_UP . 设置LockTempo = true 会移除 "SUSTAIN_PEAK -> RELAX -> BUILD_UP" 使你的尸潮无延迟地直接产生.
|-
|-
|<code>MobRechargeRate</code>  
|<code>MobRechargeRate</code>  
|int
|int
|
|
|Guessing it's the speed at which a mob regenerates (i.e. next mob).
|应该是感染者再生后的速度之类的 (也就是下一只感染者).
|-
|-
|<code>MobSpawnMaxTime</code>  
|<code>MobSpawnMaxTime</code>  
|int
|int
|180-240
|180-240
|Maximum time in seconds between mob spawns. Default value depends on difficulty.
|两波尸潮产生的最大时间间隔(单位秒).默认值取决于难度.
|-
|-
|<code>MobSpawnMinTime</code>  
|<code>MobSpawnMinTime</code>  
|int
|int
|90-120
|90-120
|Minimum time in seconds between mob spawns. Default value depends on difficulty.
|两波尸潮产生的最小时间间隔(单位秒). 默认值取决于难度.
|-
|-
|<code>MusicDynamicMobScanStopSize</code>  
|<code>MusicDynamicMobScanStopSize</code>  
|int
|int
|
|
|When fewer than this many of a mob are in play, the mob music stops.
|当尸潮的感染者数量小于此数时,尸潮背景音乐停止
|-
|-
|<code>MusicDynamicMobSpawnSize</code>  
|<code>MusicDynamicMobSpawnSize</code>  
|int
|int
|25
|25
|Spawning a mob this large will play the mob music.
|当尸潮感染者数量大于此数时播放尸潮背景音乐
|-
|-
|<code>MusicDynamicMobStopSize</code>  
|<code>MusicDynamicMobStopSize</code>  
|int
|int
|
|
|When a mob gets to this size we think about stopping the mob music.
|当尸潮的感染者数量达到这个数值时停止播放音乐
|-
|-
|<code>NumReservedWanderers</code>  
|<code>NumReservedWanderers</code>  
|int
|int
|
|
|The number of wandering infected that cannot be despawned for mobs.
|不能因成为尸潮而消失的闲逛感染者的数量
|-
|-
|<code>NoMobSpawns</code>  
|<code>NoMobSpawns</code>  
|bool
|bool
|false
|false
|Prevents new mobs from spawning. Does not reset the timer, and already pending infected still spawn.
|防止产生新的尸潮. 并不重设计时器, 并且会暂挂已经出生的感染者.
|-
|-
|<code>PanicForever</code>  
|<code>PanicForever</code>  
|int
|int
|
|
|This seems to only work in gauntlets.
|只在夹击战中有效.
|-
|-
|<code>PausePanicWhenRelaxing</code>  
|<code>PausePanicWhenRelaxing</code>  
|bool
|bool
|
|
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|-
|-
|<code>PreferredMobDirection</code>  
|<code>PreferredMobDirection</code>  
|int
|int
|
|
|Valid flags are: <code>SPAWN_ABOVE_SURVIVORS, SPAWN_ANYWHERE, SPAWN_BEHIND_SURVIVORS, SPAWN_FAR_AWAY_FROM_SURVIVORS, SPAWN_IN_FRONT_OF_SURVIVORS, SPAWN_LARGE_VOLUME, SPAWN_NEAR_IT_VICTIM, SPAWN_NO_PREFERENCE</code>  
|{{note|这应该是感染者尸潮的产生方位}}有效标签: <code>SPAWN_ABOVE_SURVIVORS, SPAWN_ANYWHERE, SPAWN_BEHIND_SURVIVORS, SPAWN_FAR_AWAY_FROM_SURVIVORS, SPAWN_IN_FRONT_OF_SURVIVORS, SPAWN_LARGE_VOLUME, SPAWN_NEAR_IT_VICTIM, SPAWN_NO_PREFERENCE</code>  
{{note|<code>SPAWN_NEAR_IT_VICTIM</code> does not exist before a finale and will cause an error, so I'm assuming the director picks someone as IT when the finale starts. <code>SPAWN_LARGE_VOLUME</code> is what makes you be a mile away on DC finale.}}
{{note|<code>SPAWN_NEAR_IT_VICTIM</code> 在结局前不存在并且会导致出错, 所以我们可以猜测应该是导演系统在结局开始时选择了某人作为它(victim). <code>SPAWN_LARGE_VOLUME</code> 就是那个让你离DC(DC指的应该是死亡中心)的结局一英里远的东西.}}
|-
|-
|<code>PreferredMobPosition</code>  
|<code>PreferredMobPosition</code>  
|[[List_of_L4D2_Script_Functions#Vector|Vector]]
|[[Left 4 Dead 2/Script Functions#Vector|Vector]]
|
|
|{{todo|confirm category/working; used in dash}}
|{{todo|确认类别/工作; 在dash模式中被使用了}}
|-
|-
|<code>PreferredMobPositionRange</code>  
|<code>PreferredMobPositionRange</code>  
|int
|int
|
|
|{{todo|confirm category/working; used in dash}}
|{{todo|确认类别/工作; 在dash模式中被使用了}}
|-
|-
|<code>PreferredSpecialDirection</code>  
|<code>PreferredSpecialDirection</code>  
|int
|int
|
|
|{{note|The same values for <code>PreferredMobDirection</code> appear to work, BUT the following have also been seen, it is unknown if it's just redundancy.
|{{note|这应该是特感的产生方位}}{{note|与<code>PreferredMobDirection</code>同样适用于此,但它还多出了如下两个标签,目前尚不清楚这两个标签是不是多余的.
<code>SPAWN_SPECIALS_ANYWHERE, SPAWN_SPECIALS_IN_FRONT_OF_SURVIVORS</code>}}
<code>SPAWN_SPECIALS_ANYWHERE, SPAWN_SPECIALS_IN_FRONT_OF_SURVIVORS</code>}}
|-
|-
Line 363: Line 349:
|bool
|bool
|
|
|Prohibits tanks and witches from being spawned by the Director. Only functional in coop mode.
|禁止导演系统产生Witch和Tank. 只在合作模式中有效.
|-
|-
|<code>RelaxMaxFlowTravel</code>  
|<code>RelaxMaxFlowTravel</code>  
|float
|float
|
|
|How far the survivors can advance along the flow before transitioning from RELAX to BUILD_UP.
|在节奏从RELAX转换到BUILD_UP的期间生还者可以前进多远{{note|单位应该是英寸}}
|-
|-
|<code>RelaxMaxInterval</code>  
|<code>RelaxMaxInterval</code>  
|float
|float
|
|
|Maximum time to spend in the RELAX tempo.
|RELAX节奏持续的最大时间{{note|单位应该是秒}}
|-
|-
|<code>RelaxMinInterval</code>  
|<code>RelaxMinInterval</code>  
|float
|float
|
|
|Minimum time to spend in the RELAX tempo.
|RELAX节奏持续的最小时间{{note|单位应该是秒}}
|-
|-
|<code>ShouldAllowMobsWithTank</code>  
|<code>ShouldAllowMobsWithTank</code>  
|bool
|bool
|
|
|Whether to spawn mobs when a tank is in play. {{todo|confirm category/working; possibly finale specific}}
|尸潮是否能与Tank并存. {{todo|确认类别/工作; 可能是结局专属的功能}}
|-
|-
|<code>ShouldAllowSpecialsWithTank</code>  
|<code>ShouldAllowSpecialsWithTank</code>  
|bool
|bool
|
|
|Whether to spawn Special Infected when a tank is in play. {{todo|confirm category/working; possibly finale specific}}
|是否允许特感与Tank并存. {{todo|确认类别/工作; 可能是结局专属的功能}}
|-
|-
|<code>ShouldConstrainLargeVolumeSpawn</code>  
|<code>ShouldConstrainLargeVolumeSpawn</code>  
|bool
|bool
|
|
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|-
|-
|<code>ShouldIgnoreClearStateForSpawn</code>  
|<code>ShouldIgnoreClearStateForSpawn</code>  
|bool
|bool
|
|
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|-
|-
|<code>SpawnBehindSurvivorsDistance</code>  
|<code>SpawnBehindSurvivorsDistance</code>  
|  
|  
|  
|  
|Appears to require <code>PreferredSpecialDirection = SPAWN_BEHIND_SURVIVORS</code>  
|前提是<code>PreferredSpecialDirection = SPAWN_BEHIND_SURVIVORS</code>  
|-
|-
|<code>SpecialInfectedAssault</code>  
|<code>SpecialInfectedAssault</code>  
|
|
|
|
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|-
|-
|<code>SpecialInitialSpawnDelayMax</code>  
|<code>SpecialInitialSpawnDelayMax</code>  
Line 423: Line 409:
|float
|float
|
|
|Time in seconds before a Special Infected slot can respawn an infected.
|一个特感通道产生一个特感的冷却时间.
|-
|-
|<code>SurvivorMaxIncapacitatedCount</code>  
|<code>SurvivorMaxIncapacitatedCount</code>  
|int
|int
|
|
|Maximum amount of survivor incapacitating before dying.
|死前倒地的幸存者的最大数量.
|-
|-
|<code>SustainPeakMaxTime</code>  
|<code>SustainPeakMaxTime</code>  
|float
|float
|
|
|in minutes
|单位分钟
|-
|-
|<code>SustainPeakMinTime</code>  
|<code>SustainPeakMinTime</code>  
|float
|float
|
|
|in minutes
|单位分钟
|-
|-
|<code>TankHitDamageModifierCoop</code>  
|<code>TankHitDamageModifierCoop</code>  
|float
|float
|1.0
|1.0
|(mutation1.nut Last Man on Earth) {{todo|confirm category}}
|(mutation1.nut Last Man on Earth) {{todo|确认类别}}
|-
|-
|<code>TankRunSpawnDelay</code>  
|<code>TankRunSpawnDelay</code>  
|float
|float
|15
|15
|in seconds (mutation19.nut Taaannnkk!) {{todo|confirm category}}
|单位秒 (mutation19.nut Taaannnkk!) {{todo|确认类别}}
|-
|-
|<code>TempHealthDecayRate</code>  
|<code>TempHealthDecayRate</code>  
|float
|float
|0.27
|0.27
|0.27 is the <code>pain_pills_decay_rate</code> default, higher values equals quicker decay.
|0.27 <code>pain_pills_decay_rate</code> 默认的, 数值越高衰减越快.
|-
|-
|<code>WanderingZombieDensityModifier</code>  
|<code>WanderingZombieDensityModifier</code>  
|float
|float
|1.0
|1.0
|Multiplier for the amount of wandering infected.
|流浪感染者的乘数.
|-
|-
|<code>ZombieDiscardRange</code>  
|<code>ZombieDiscardRange</code>  
|int
|int
|
|
|{{todo|possibly range for despawning wanderers}}
|{{todo|可能是流浪感染者消失的范围}}
|-
|-
|<code>ZombieDontClear</code>  
|<code>ZombieDontClear</code>  
Line 473: Line 459:
|bool
|bool
|false
|false
|Allows zombies to spawn in in line-of-sight of survivors in fogged areas.
|允许感染者在处于雾区的幸存者的视线内产生.
|-
|-
|<code>ZombieSpawnRange</code>  
|<code>ZombieSpawnRange</code>  
|float
|float
|
|
|Maximum distance from the survivors that the infected can spawn.
|感染者最多可以从距离幸存者多远的地方产生.
|-
|-
|<code>ZombieTankHealth</code>  
|<code>ZombieTankHealth</code>  
|int
|int
|
|
|Sets the amount of health a tank spawns with.
|设置Tank的生命值.
|}
|}


==== Spawning limits ====
==== 限制出生 ====


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>BileMobSize</code>  
|<code>BileMobSize</code>  
| int
| int
|  
|  
|Number of commons that spawn when a bile bomb is thrown.  Appears to only work in finale. Found in Dead Center and The Sacrifice finales.
|胆汁瓶爆炸之后产生的感染者数量。似乎只在结局中有效。死亡中心和牺牲这两个地图中使用了这个变量。
|-
|-
|<code>BoomerLimit</code>  
|<code>BoomerLimit</code>  
| int
| int
| 1
| 1
|Maximum number of Boomers allowed to be in play simultaneously.
|最多允许多少Boomer同时存在.
|-
|-
|<code>ChargerLimit</code>  
|<code>ChargerLimit</code>  
|int
|int
| 1
| 1
|Maximum number of chargers allowed to be in play simultaneously.
|最多允许多少Charger同时存在.
|-
|-
|<code>CommonLimit</code>  
|<code>CommonLimit</code>  
|int
|int
|30
|30
|Maximum number of commons allowed to be in play simultaneously.
|最多允许多少感染者同时存在.
|-
|-
|<code>DominatorLimit</code>  
|<code>DominatorLimit</code>  
|int
|int
|  
|  
|Maximum number of Hunters, Smokers, Jockeys and Chargers allowed to be in play simultaneously. {{todo|confirm category/working}}
|最多允许多少Hunters, Smokers, Jockeys和 Chargers同时存在. {{todo|确认类别/工作}}
|-
|-
|<code>HunterLimit</code>  
|<code>HunterLimit</code>  
|int
|int
|1  
|1  
|Maximum number of Hunters allowed to be in play simultaneously.
|最多允许多少Hunter同时存在.
|-
|-
|<code>JockeyLimit</code>  
|<code>JockeyLimit</code>  
|int
|int
|1  
|1  
|Maximum number of Jockeys allowed to be in play simultaneously.
|最多允许多少Jockey同时存在.
|-
|-
|<code>MaxSpecials</code>  
|<code>MaxSpecials</code>  
|int
|int
|2
|2
|Maximum number of Director spawned Special Infected allowed to be in play simultaneously.
|导演系统最多允许多少种特感同时存在.
|-
|-
|<code>MegaMobSize</code>  
|<code>MegaMobSize</code>  
|int
|int
|
|
|The amount of total infected spawned during a panic event.
|一次尸潮最多产生多少感染者.{{note|优先级可能高于<code>MobMaxSize</code>}}
|-
|-
|<code>MobMaxPending</code>  
|<code>MobMaxPending</code>  
|int
|int
|
|
|How many infected can be left pending to spawn when the mob size is larger than <code>CommonLimit</code>.
|当尸潮的感染者数量超过<code>CommonLimit</code>时最多有多少感染者可以暂时等待生成.
|-
|-
|<code>MobMaxSize</code>  
|<code>MobMaxSize</code>  
|int
|int
|30
|30
|Maximum amount of infected that can spawn in a mob.
|一次尸潮最多产生多少感染者.
|-
|-
|<code>MobMinSize</code>  
|<code>MobMinSize</code>  
|int
|int
|10
|10
|Minimum amount of infected that can spawn in a mob.
|一次尸潮最少产生多少感染者.
|-
|-
|<code>MobSpawnSize</code>  
|<code>MobSpawnSize</code>  
|int
|int
|
|
|Static amount of infected in a mob. Likely overrides <code>MobMinSize</code> and <code>MobMinSize</code>.
|一次尸潮中感染者的静态数量. 优先级高于<code>MobMinSize</code> <code>MobMinSize</code>.
|-
|-
|<code>PreTankMobMax</code>  
|<code>PreTankMobMax</code>  
|int
|int
|
|
|{{todo|confirm category/working; possibly gauntlet finale specific}}
|{{todo|确认类别/工作; 可能是夹击战结局专属的功能}}
|-
|-
|<code>SmokerLimit</code>  
|<code>SmokerLimit</code>  
|bool
|int
|1
|1
|Maximum number of Smokers allowed to be in play simultaneously.
|最多允许多少Smoker同时存在.
|-
|-
|<code>SpitterLimit</code>  
|<code>SpitterLimit</code>  
|int
|int
|1
|1
|Maximum number of Spitters allowed to be in play simultaneously.
|最多允许多少Spitter同时存在.
|-
|-
|<code>TankLimit</code>  
|<code>TankLimit</code>  
|int
|int
|1
|1
|Maximum number of Tanks allowed to be in play simultaneously.
|最多允许多少Tank同时存在.
|-
|-
|<code>WitchLimit</code>  
|<code>WitchLimit</code>  
|int
|int
|1
|1
|Maximum number of Witches allowed to be in play simultaneously.1
|最多允许多少Witch同时存在.
|}
|}


=== EMS Stage Specific ===
=== EMS阶段专属 ===
{{todo}}
{{todo}}


'''See [[L4D2_EMS/Appendix:_Spawning_Infected]]'''
'''参见 {{L|L4D2_EMS/Appendix:_Spawning_Infected}}'''
 


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>PanicSpecialsOnly</code>  
|<code>PanicSpecialsOnly</code>  
|bool
|bool
|
|
|The Panic should end when we finish with Specials, not wait for the MegaMob.
|恐慌事件应在完成特感后结束,而不是等待大型尸潮。
|-
|-
|<code>PanicWavePauseMax</code>  
|<code>PanicWavePauseMax</code>  
|float
|float
|
|
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|-
|-
|<code>PanicWavePauseMin</code>  
|<code>PanicWavePauseMin</code>  
|float
|float
|
|
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|-
|-
|<code>ScriptedStageType</code>  
|<code>ScriptedStageType</code>  
|int
|int
|
|
|The type of stage to run next. See [[L4D2_EMS/StageTypeAppendix]] for a description of stage types.
|下一个要运行的阶段类型。参见{{L|L4D2_EMS/StageTypeAppendix}}了解阶段类型的描述。
|-
|-
|<code>ScriptedStageValue</code>  
|<code>ScriptedStageValue</code>  
|int
|int
|
|
|Dependant on the stage type.
|取决于阶段类型。
|-
|-
|<code>SpawnDirectionCount</code>  
|<code>SpawnDirectionCount</code>  
|
|
|
|
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|-
|-
|<code>SpawnDirectionMask</code>  
|<code>SpawnDirectionMask</code>  
|int
|int
|
|
|A bitfield (using <code>SPAWNDIR_N, _NE, _E</code>, etc) of directors to spawn from _relative to_ a map entity named <code>Compass</code> in your map. Designed for Survival-like game modes. See [[L4D2_EMS/Appendix:_Spawning_Infected]].
|一个位字段(使用<code>SPAWNDIR_N, _NE, _E</code>等)指定导演从相对于地图中名为<code>Compass</code>的实体的方向生成。专为类似生存模式的游戏模式设计。参见{{L|L4D2_EMS/Appendix:_Spawning_Infected}}。
|-
|-
|<code>SpawnSetPosition</code>  
|<code>SpawnSetPosition</code>  
|[[List_of_L4D2_Script_Functions#Vector|Vector]]
|[[Left 4 Dead 2/Script Functions#Vector|Vector]]
|
|
|The center point of the area infected can spawn in, when <code>SpawnSetRule</code> is set to <code>SPAWN_POSITIONAL</code>.
|<code>SpawnSetRule</code>设置为<code>SPAWN_POSITIONAL</code>时,感染者可以生成的区域中心点。
|-
|-
|<code>SpawnSetRadius</code>  
|<code>SpawnSetRadius</code>  
|int
|int
|
|
|How far from the center point infected can spawn, when <code>SpawnSetRule</code> is set to <code>SPAWN_POSITIONAL</code>.
|<code>SpawnSetRule</code>设置为<code>SPAWN_POSITIONAL</code>时,感染者可以从中心点生成多远。
|-
|-
|<code>SpawnSetRule</code>  
|<code>SpawnSetRule</code>  
|int
|int
|
|
|Overrides the mode of spawning used. Seems to be non-functional in finales. Valid flags are: <code>SPAWN_ANYWHERE, SPAWN_FINALE, SPAWN_BATTLEFIELD, SPAWN_SURVIVORS, SPAWN_POSITIONAL</code>
|覆盖使用的生成模式。似乎在结局中无效。有效标志有:<code>SPAWN_ANYWHERE, SPAWN_FINALE, SPAWN_BATTLEFIELD, SPAWN_SURVIVORS, SPAWN_POSITIONAL</code>
|-
|-
|<code>TotalBoomers</code>  
|<code>TotalBoomers</code>  
|int
|int
|
|
|Number of Boomers allowed in a wave.
|一波中允许的Boomer数量。
|-
|-
|<code>TotalChargers</code>  
|<code>TotalChargers</code>  
|int
|int
|
|
|Number of Chargers allowed in a wave.
|一波中允许的Charger数量。
|-
|-
|<code>TotalHunters</code>  
|<code>TotalHunters</code>  
|int
|int
|
|
|Number of Hunters allowed in a wave.
|一波中允许的Hunter数量。
|-
|-
|<code>TotalJockeys</code>  
|<code>TotalJockeys</code>  
|int
|int
|
|
|Number of Jockeys allowed in a wave.
|一波中允许的Jockey数量。
|-
|-
|<code>TotalSmokers</code>  
|<code>TotalSmokers</code>  
|int
|int
|
|
|Number of Smokers allowed in a wave.
|一波中允许的Smoker数量。
|-
|-
|<code>TotalSpecials</code>  
|<code>TotalSpecials</code>  
|int
|int
|
|
|Total number of Special Infected allowed in a wave.
|一波中允许的特感总数。
|-
|-
|<code>TotalSpitters</code>  
|<code>TotalSpitters</code>  
|int
|int
|
|
|Number of Spitters allowed in a wave.
|一波中允许的Spitter数量。
|}
|}


*'''function <code>void g_ModeScript::GetNextStage()</code> '''
*'''function <code>void g_ModeScript::GetNextStage()</code> '''
: Called by the director when it wants a new stage. It can be forced with <code>Director.ForceNextStage()</code>
: 当导演想要一个新阶段时调用。可以使用<code>Director.ForceNextStage()</code>强制调用。


=== Finale Specific/Related ===
=== 结局专属/相关 ===
A normal finale consists of X number of stages. Some variables in DirectorOptions can only be used during finales. Multiple staged events can be defined in the same script, with the Options starting with <code>A_, B_, C_ etc.</code>
通常一个结局会包含X个阶段. DirectorOptions中的一些变量只能用于结局阶段. 在脚本中也能定义多阶段结局, 只要在选项开头冠以<code>A_, B_, C_ 等等</code>即可


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>''A''_CustomFinale_StageCount</code>  
|<code>''A''_CustomFinale_StageCount</code>  
|int
|int
|
|
|Number of stages. Needs to be set for Versus scoring to function properly.
|阶段数量. 需要设置对抗得分才能正常运行.
|-
|-
|<code>''A''_CustomFinale''X''</code>  
|<code>''A''_CustomFinale''X''</code>  
|int
|int
|
|
|Stage type (enumerated PANIC, SCRIPTED (AKA ONSLAUGHT), DELAY, TANK), where X is the stage number. Also used in scripted panic events.
|阶段类型 (包含PANIC, SCRIPTED (AKA ONSLAUGHT), DELAY, TANK), X是阶段数. 也用于脚本化尸潮.
|-
|-
|<code>''A''_CustomFinaleValue''X''</code>  
|<code>''A''_CustomFinaleValue''X''</code>  
|*
|*
|
|
|Value depends on the stage type above. Also used in scripted panic events. Please see the example above.
|值取决于上面的阶段类型. 也用于脚本化尸潮. 请看上方的举例.
|-
|-
|<code>''A''_CustomFinaleMusic''X''</code>  
|<code>''A''_CustomFinaleMusic''X''</code>  
|string
|string
|
|
|[[Soundscript]] entry to play. For instance, <code>A_CustomFinaleMusic1 = "C2M5.BadManTank2"</code>. Note that c2m5_concert_finale.nut does not use this method and instead opted to use entities within the map instead. In the c2m5 script <code>A_CustomFinaleMusic4 = ""</code>, suggesting that no song is actually played automatically via script.
|{{L|Soundscript}} 引入游戏. 例如, <code>A_CustomFinaleMusic1 = "C2M5.BadManTank2"</code>. 注意 c2m5_concert_finale.nut 不使用此方法,而是选择使用地图中的实体. 在c2m5 的脚本中 <code>A_CustomFinaleMusic4 = ""</code>, 意味着实际上没有歌曲通过脚本自动播放.
|-
|-
|<code>EnforceFinaleNavSpawnRules</code>  
|<code>EnforceFinaleNavSpawnRules</code>  
|bool
|bool
|
|
|Possibly used to enforce the finale spawning behavior without running a finale. {{todo|confirm category/working}}
|可能用于强制执行结局出生行为但并不进入结局阶段。 {{todo|确认类别/工作}}
|-
|-
|<code>HordeEscapeCommonLimit</code>  
|<code>HordeEscapeCommonLimit</code>  
|
|
|
|
|Number of commons allowed in the escape stage.
|逃离阶段允许的感染者数量.
|-
|-
|<code>EscapeSpawnTanks</code>  
|<code>EscapeSpawnTanks</code>  
|bool
|bool
|
|
|Whether to spawn tanks in the escape sequence. {{todo|possibly EMS stage related}}
|是否在逃离阶段中产生Tank. {{todo|可能与EMS阶段有关}}
|-
|-
|<code>MinimumStageTime</code>  
|<code>MinimumStageTime</code>  
|int
|int
|
|
|The minimum amount of time a SCRIPTED stage is allowed to run before ending.
|在结束之前允许SCRIPTED阶段运行的最短时间.
|}
|}


 
=== 夹击战专属/相关 ===
=== Gauntlet Specific/Related ===
这些选项特定于夹击战结局。大多数可以在director_gauntlet.nut中找到。
These options are specific to Gauntlet finales. Most of these can be found in director_gauntlet.nut


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>CustomTankKiteDistance</code>  
|<code>CustomTankKiteDistance</code>  
|int
|int
|3000
|3000
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|}
|}




;'''Movement Bonus related options'''  
;'''移动奖励相关选项'''  
:The Movement Bonus successively increases the delay between hordes when the survivors are not making progress toward the Gauntlet goal. The Current Bonus value ticks down every second, allows a horde to spawn when it reaches 0. When a horde spawns the Current Bonus is reset to the Movement Bonus value. The Movement Bonus increases at set intervals, and is reset when the survivors cross the Movement Threshold, which is then incremented. Use <code>director_debug 1</code> to see the values.
:当幸存者在夹击战目标方面没有进展时,移动奖励会连续增加尸潮之间的延迟。当前奖励值每秒递减,当达到0时允许生成尸潮。当生成尸潮时,当前奖励重置为移动奖励值。移动奖励按设定的时间间隔增加,并在幸存者跨越移动阈值时重置,然后递增。使用<code>director_debug 1</code>查看这些值。


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>GauntletMovementThreshold</code>  
|<code>GauntletMovementThreshold</code>  
|float
|float
|
|
|The amount of flow units the survivors can advance before the Movement Bonus is reset.
|幸存者可以前进的流程单位数量,然后移动奖励重置。
|-
|-
|<code>GauntletMovementTimerLength</code>  
|<code>GauntletMovementTimerLength</code>  
|float
|float
|
|
|The interval between each Movement Bonus increase, in seconds.
|每次移动奖励增加之间的时间间隔,以秒为单位。
|-
|-
|<code>GauntletMovementBonus</code>  
|<code>GauntletMovementBonus</code>  
|float
|float
|
|
|The initial value, and the amount the movement Bonus increases each interval, in seconds.
|初始值,以及移动奖励每个时间间隔增加的数量,以秒为单位。
|-
|-
|<code>GauntletMovementBonusMax</code>  
|<code>GauntletMovementBonusMax</code>  
|float
|float
|
|
|The maximum value that the Movement Bonus can reach.
|移动奖励可以达到的最大值。
|}
|}


 
=== 对抗模式专属/相关 ===
=== Versus Specific ===


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>TankHitDamageModifierVersus</code>  
|<code>TankHitDamageModifierVersus</code>  
Line 800: Line 783:
|int
|int
|30
|30
|Maximum time in seconds until allowing player infected to respawn.
|允许玩家感染者重生前的最大时间(秒)。
|-
|-
|<code>ZombieGhostDelayMin</code>  
|<code>ZombieGhostDelayMin</code>  
|int
|int
|20
|20
|Minimum time in seconds until allowing player infected to respawn.
|允许玩家感染者重生前的最小时间(秒)。
|}
|}


 
=== 清道夫模式专属/相关 ===
=== Scavenge Specific/Related ===


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>ScavengeClusterBonusTime</code>  
|<code>ScavengeClusterBonusTime</code>  
|float
|float
|
|
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|-
|-
|<code>ScavengeRoundInitialTime</code>  
|<code>ScavengeRoundInitialTime</code>  
|float
|float
|
|
|{{todo|confirm category/working}}
|{{todo|确认类别/工作}}
|-
|-
|<code>ScavengeScoreBonusTime</code>  
|<code>ScavengeScoreBonusTime</code>  
|float
|float
|
|
|(used in mutation13.nut Follow the Liter)
|(用于 mutation13.nut Follow the Liter)
|}
|}


 
=== 生存模式专属/相关 ===
=== Survival Specific/Related ===


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>SurvivalSetupTime</code>  
|<code>SurvivalSetupTime</code>  
|float
|float
|
|
|(Used in mutation15.nut for Survival Versus with setup time of 90 seconds)
|(用于 mutation15.nut 的生存对抗模式,设置时间为90秒)
|}
|}


 
=== 突变模式专属/相关 ===
=== Mutation Specific/Related ===
其中一些值是全局值的突变特定值(cm_CommonLimit,cm_MaxSpecials等),因此如果您正在制作突变模式,请使用它们,以防任何地图脚本更改全局值。
Some of these values are mutation specific values of the global ones (cm_CommonLimit,cm_MaxSpecials, etc.), so use them if you are making a mutation, in case any map scripts are changing the global values.


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>cm_AggressiveSpecials</code>  
|<code>cm_AggressiveSpecials</code>  
Line 866: Line 846:
|bool
|bool
|true
|true
|Allows pills to be converted to health kits.
|允许药丸转换为医疗包。
|-
|-
|<code>cm_AllowSurvivorRescue</code>  
|<code>cm_AllowSurvivorRescue</code>  
Line 876: Line 856:
|bool
|bool
|false
|false
|Instantly revives a survivor when incapacitated by a Special Infected.
|当被特感击倒时立即复活幸存者。
|-
|-
|<code>cm_AutoSpawnInfectedGhosts</code>  
|<code>cm_AutoSpawnInfectedGhosts</code>  
Line 906: Line 886:
|int
|int
|false
|false
|Ends the escape when the first survivor reaches the escape vehicle.
|当第一个幸存者到达逃生载具时结束逃生。
|-
|-
|<code>cm_frustrationTimer</code>  
|<code>cm_frustrationTimer</code>  
Line 961: Line 941:
|
|
|
|
|Used for scavenge cans to spawn one-by-one.
|用于清道夫模式油桶逐个生成。
|-
|-
|<code>cm_SpecialRespawnInterval</code>  
|<code>cm_SpecialRespawnInterval</code>  
Line 986: Line 966:
|
|
|
|
|Used in Taaank! mutation (mutation19.nut).
|用于 Taaank! 突变模式 (mutation19.nut)
|-
|-
|<code>cm_TempHealthOnly</code>  
|<code>cm_TempHealthOnly</code>  
Line 1,009: Line 989:
|}
|}


 
=== 无用设置 ===
=== Defunct options ===
这些似乎不被导演读取。
These don't seem to be read by the director.


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Name
! 名称
! Type
! 类型
! Default value
! 默认值
! Description
! 描述
|-
|-
|<code>ActiveChallenge</code>  
|<code>ActiveChallenge</code>  
|bool
|bool
|false
|false
|Activates mutation mode. Seems to be obsolete with the EMS update.
|激活突变模式。似乎在EMS更新后已过时。
|-
|-
|<code>MegaMobMaxSize</code>  
|<code>MegaMobMaxSize</code>  
|int
|int
|
|
|Maximum amount of total infected spawned during a panic event. Doesn't work 2014.04.29
|恐慌事件期间生成的总感染者的最大数量。2014.04.29 不起作用。
|-
|-
|<code>MegaMobMinSize</code>  
|<code>MegaMobMinSize</code>  
|int
|int
|
|
|Minimum amount of total infected spawned during a panic event. Doesn't work 2014.04.29
|恐慌事件期间生成的总感染者的最小数量。2014.04.29 不起作用。
|}
|}


 
=== 钩子函数 ===  
=== Hook Functions ===  
这些函数被放置在DirectorOptions表中,并在地图加载时被调用。
These functions are placed in the DirectorOptions table, and get called at map load.


{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function
! 函数
! Signature
! 签名
! Description
! 描述
|-
|-
| <code>AllowWeaponSpawn</code>
| <code>AllowWeaponSpawn</code>
| <code>bool AllowWeaponSpawn(string ''classname'')</code>
| <code>bool AllowWeaponSpawn(string ''classname'')</code>
| Returns true or false if the given classname is allowed to spawn, used by several mutations.
| 返回给定类名是否允许生成,被多个突变模式使用。
|-
|-
| <code>ConvertWeaponSpawn</code>
| <code>ConvertWeaponSpawn</code>
| <code>string ConvertWeaponSpawn(string ''classname'')</code>
| <code>string ConvertWeaponSpawn(string ''classname'')</code>
| Converts a weapon spawn of given classname to another, used by several mutations.
| 将给定类名的武器生成转换为另一个,被多个突变模式使用。
|-
|-
| <code>ConvertZombieClass</code>
| <code>ConvertZombieClass</code>
| <code>int ConvertZombieClass(''infectedClass'')</code>
| <code>int ConvertZombieClass(''infectedClass'')</code>
| Converts one spawn into another, used by the Taaannnk!! mutation (mutation19.nut).
| 将一个生成转换为另一个,被 Taaannnk!! 突变模式使用 (mutation19.nut)
|-
|-
| <code>GetDefaultItem</code>
| <code>GetDefaultItem</code>
| <code>string GetDefaultItem(index)</code>
| <code>string GetDefaultItem(index)</code>
| Repeatedly called with incrementing indices. Return a string of a weapon name to make it a default item for survivors, or 0 to end the iteration.
| 使用递增索引重复调用。返回武器名称的字符串以使其成为幸存者的默认物品,或返回0以结束迭代。
|-
|-
| <code>ShouldAvoidItem</code>
| <code>ShouldAvoidItem</code>
| <code>bool ShouldAvoidItem(string ''classname'')</code>
| <code>bool ShouldAvoidItem(string ''classname'')</code>
| {{todo|Probably a bot related function or spawn related}}
| {{todo|可能是与机器人相关或生成相关的函数}}
|}
|}


== Enumerations ==
== 枚举 ==


*Director Enumerations {{note|These are (or some are) '''script specific''', hence the duplicate values.}}
*导演枚举 {{note|这些是(或部分是)'''脚本特定的''',因此有重复的值。}}
**ALLOW_BASH_ALL = 0
**ALLOW_BASH_ALL = 0
**ALLOW_BASH_NONE = 2
**ALLOW_BASH_NONE = 2
Line 1,225: Line 1,203:
**ZSPAWN_WITCHBRIDE = 11
**ZSPAWN_WITCHBRIDE = 11


== See also ==
== 推荐阅读 ==
*[[L4D2 Vscripts]]
*{{L|L4D2 Vscripts|求生之路2 脚本(VScripts)}}
*[[List of L4D2 Script Functions]]
*{{L|Left 4 Dead 2/Script Functions}}
*[[L4D2 Vscript Examples]]
*{{L|L4D2 Vscript Examples}}
*[[L4D2 EMS|Extended Mutation System]]
*{{L|L4D2 EMS|Extended Mutation System}}
*[[L4D2_Level_Design/Boss_Prohibition|L4D2 Level Design/Boss Prohibition]]
*{{L|L4D2_Level_Design/Boss_Prohibition|L4D2 Level Design/Boss Prohibition}}
*[[Trigger_finale|trigger_finale]]
*{{L|Trigger_finale|trigger_finale}}
*[[Info_director|info_director]]
*{{L|Info_director|info_director}}
*[[VScript|vscripts]]
*{{L|VScript|vscripts}}


[[Category:Left_4_Dead_2]]
{{ACategory|Left_4_Dead_2}}
[[Category:Scripting]]
{{ACategory|Scripting}}

Latest revision as of 22:26, 3 October 2025

English (en)中文 (zh)Translate (Translate)
Info content.png
This translated page needs to be updated.
You can help by updating the translation.
Also, please make sure the article complies with the alternate languages guide.(en)

Squirrel求生之路2 求生之路2导演脚本 是主要用于影响人工智能导演系统(AI Director)的行为的 脚本(en). 它们被广泛用于自定义结局和尸潮事件.

本页面内容由Dazai Nerau译自英文版页面(en). 欢迎任何人补充新内容或者修改其中的错误.

用法

执行导演脚本的方式是向 info_director 实体进行输入(input). 一个导演设置表用于给导演系统所使用的变量提供新的临时值. 其他额外的命令可以通过Director对象访问.

Warning.png警告:一次只能同时执行一个导演脚本!

输入

BeginScript <script name>
执行一个普通的导演脚本, 比如为了onslaught事件而设计的脚本.
EndScript
停止执行脚本并重置导演系统设置中的变量值.
BeginScriptedPanicEvent <script name>
执行一次脚本化的尸潮
Note.png注意:如果脚本位于子目录中,则与BeginScriptedPanicEvent一起使用的脚本将无法工作,即使你能在其他脚本的上下文中使用子目录. 它们必须位于vscripts文件夹下,否则它们只会简单地以1个阶段1秒的延迟运作.

通用脚本与尸潮

当导演系统执行BeginScript输入时,指定的脚本便会运行,直到新的脚本被执行。或者脚本也可通过EndScript输入来手动结束. 除非改变了导演设置,否则游戏模式照常运行。

尸潮事件可以通过操纵感染者和特感的数量上限以及游戏节奏来实现。

c2m4_barns_onslaught.nut (附注释):

Msg("Initiating Onslaught\n");

DirectorOptions <- 
{
	//允许BOSS感染者 (false = 允许  ; true = 禁止)
	ProhibitBosses = false
	
        //锁定游戏节奏 (true = 锁定 ; false = 不锁定)
        //一般的地图没有必要锁定游戏节奏,除非你需要大量地无限制地刷尸潮,就像大灾变那样
	//LockTempo = true

	// 设置感染者的产生时间间隔. 感染者只有在节奏处于BUILD_UP状态时才会产生.
	MobSpawnMinTime = 1
	MobSpawnMaxTime = 1

	// 每波尸潮产生多少感染者.
	MobMinSize = 30
	MobMaxSize = 30
	MobMaxPending = 30

	// 修改SUSTAIN_PEAK 和 RELAX 状态的时间长度以缩短感染者产生的时间间隔.
	SustainPeakMinTime = 5
	SustainPeakMaxTime = 10
	IntensityRelaxThreshold = 0.99
	RelaxMinInterval = 1
	RelaxMaxInterval = 5
	RelaxMaxFlowTravel = 50

	//特感设置
	SpecialRespawnInterval = 1.0
        SmokerLimit = 2
        JockeyLimit = 0
        BoomerLimit = 0
        HunterLimit = 2
        ChargerLimit = 1

	// 有效产生区域
	PreferredMobDirection = SPAWN_NO_PREFERENCE
	ZombieSpawnRange = 2000
}

Director.ResetMobTimer()		// 将感染者产生计时器归零(只在节奏未锁定时有意义).
Director.PlayMegaMobWarningSounds()	// 即将尸潮音效.

结局与脚本化的尸潮事件

结局与脚本化的尸潮事件包含了数种被设置于DirectorOptions之中的不同的阶段.

结局的导演脚本通常从 <map name>_finale.nut 中被加载. 脚本化的尸潮事件则可以从 info_director(en)BeginScriptedPanicEvent 输入中被执行.

Icon-Bug.png错误:当trigger_finale被设置成针对一个特定的脚本时, 它将失去作用.

阶段的类型有四种 (其他值会打断结局并使得玩家直接成功获救(ESCAPE)):

  • PANIC - 尸潮, 数值是感染者的波数.
  • TANK - 产生tank, 数值是产生tank的数量.
  • DELAY - 间歇, 数值是进入下一阶段前等待的秒数.
  • SCRIPTED (也叫ONSLAUGHT) - 数值是要调用的VScript的脚本名或者"" (这样设置的的话导演系统将不做任何行为), 如果在这里乱写的话你的游戏就会崩溃. 你的脚本会负责发送 EndCustomScriptedStage 输入给导演系统 (你选择的目标, 比如某个确切的触发量, 计时器, 随机值, 等等.). trigger_finale(en) 输入 AdvanceFinaleState 应该也能工作. 否则, 尸潮事件不会结束

一个关于自定义结局脚本的例子:

ERROR <- -1
PANIC <- 0
TANK <- 1
DELAY <- 2
SCRIPTED <- 3 

DirectorOptions <- 
{
	//-----------------------------------------------------
	 A_CustomFinale_StageCount = 8 // 阶段的数量. 用于计算对抗得分.
	 
	 A_CustomFinale1 = PANIC
	 A_CustomFinaleValue1 = 2   // 两拨尸潮.
	 
	 A_CustomFinale2 = DELAY
	 A_CustomFinaleValue2 = 12  // 延迟12秒进入下一阶段.
	 
	 A_CustomFinale3 = TANK
	 A_CustomFinaleValue3 = 3  // 3只tank!
	 
	 A_CustomFinale4 = DELAY
	 A_CustomFinaleValue4 = 12 // 等一段时间.
	 
	 A_CustomFinale5 = SCRIPTED
	 A_CustomFinaleValue5 = "my_scripted_stage.nut" // 运行自定义脚本.
	 
	 A_CustomFinale6 = DELAY
	 A_CustomFinaleValue6 = 15 // 等它个15秒.
	 
	 A_CustomFinale7 = TANK
	 A_CustomFinaleValue7 = 1  // tank什么的可以再来一只.

	 A_CustomFinale8 = DELAY
	 A_CustomFinaleValue8 = 10 // 再撑10秒 ... 获救!


	//-----------------------------------------------------

	 CommonLimit = 10
	 SpecialRespawnInterval = 25
}

function OnBeginCustomFinaleStage( num, type ) // 这个函数会在每个阶段开始时被调用.
{
      printl( "Beginning custom finale stage " + num + " of type " + type );
      MapScript.DirectorOptions.CommonLimit <- num * 10 // 随着阶段线性增加10个感染者.
}

智能的剧情性节奏(Adaptive Dramatic Pacing)

待完善: Add info from [1]

回调

  • void Update()
如果在导演脚本中定义了Update()函数,它会像Think()函数一样重复运行,但只有在通过trigger_finale(en)触发结局时才会运行。如果有多个运行中的脚本定义了它,它们都会被调用。Update()的使用也在"Bleed Out"突变模式(mutation3.nut)中被发现,但需要进一步测试以查看其行为是否与结局期间相同。

结局脚本专属

  • void OnBeginCustomFinaleStage(int num, int type)
如果定义了,将在每个阶段改变时被调用,带有阶段编号和类型,这是你在阶段之间更改导演选项(生成方向等)的方式。num指的是导演传递的结局阶段编号,type是阶段类型(PANIC, TANK等)。
  • function OnChangeFinaleMusic()
待完善: 确认类别/工作
  • function OnChangeFinaleStage(?)
待完善: 确认类别/工作

导演设置

DirectorOptions表里的各种变量就是用来让你随便改的。

Note.png注意:在模式和地图脚本中, 应当使用SessionOptions表来影响导演系统, 或者用MutationOptions/MapOptions 表来初始化数值. DirectorOptions表可以被地图事件复写或者重设, 如果你在结局阶段写了一个新的DirectorOptions表则将会使得结局脚本失效.

更多关于导演设置的信息可以查阅Steam论坛.

Warning.png警告:鉴于该区域有太多的互动方式,你必须小心地进行设置,以确保设置符合你所需要的结果。同时,如果设置后的导演设置没有起到预期的效果,说明它们之间可能存在冲突。你需要确保你的逻辑无误或者设置一些机制来避免冲突。
Warning.png警告:绝对不要使用 = 操作符来控制Director. 请使用 <-. 它们的区别在于语义. 如果你用了=, 而该值又未声明,则会抛出错误. 而<-, 在另一方面, 能够顺便创建不存在的数值.
Note.png注意:默认值(Default values)只是给你提供参考,而并非意味着DirectorOption中的变量默认就是这些值.

通用

名称 类型 默认值 描述
AddToSpawnTimer
AllowCrescendoEvents bool
AllowWitchesInCheckpoints bool
AlwaysAllowWanderers bool
BuildUpMinInterval
ClearedWandererRespawnChance int 已经安全的nav区域重新填充感染者的百分比机会(0-100)
DisallowThreatType int 禁止BOSS感染者在合作模式的threat 区域中产生. 有效类型: ZOMBIE_WITCH, ZOMBIE_TANK
FallenSurvivorPotentialQuantity int 总共有多少倒地的幸存者能出生.
FallenSurvivorSpawnChance float [0...1]
FarAcquireRange int 2500 感染者能识别人类的最大距离.
NearAcquireRange int 200 感染者能识别人类的最近距离.
FarAcquireTime float 5.0 感染者识别人类需要花费的最长时间
NearAcquireTime float 0.5 感染者识别人类需要花费的最短时间
GasCansOnBacks bool 将Hard Rain的油罐放在生还者的背上
IgnoreNavThreatAreas bool 或许会阻止BOSS沿着nav产生.
待完善: 确认类别/工作
InfectedFlags int 赋予新产生的感染者一些标签,标签包括: INFECTED_FLAG_CANT_SEE_SURVIVORS, INFECTED_FLAG_CANT_HEAR_SURVIVORS, INFECTED_FLAG_CANT_FEEL_SURVIVORS
IntensityRelaxAllowWanderersThreshold float
IntensityRelaxThreshold float 在允许Peak转换为Relax之前,所有幸存者必须低于此强度(除了正常的峰值计时器)
JournalString string
待完善: 在抵抗模式中有用,似乎构建了某种表.
LockTempo bool false 尸潮产生的节奏是这样的: BUILD_UP -> 产生尸潮 -> SUSTAIN_PEAK -> RELAX -> 再次 BUILD_UP . 设置LockTempo = true 会移除 "SUSTAIN_PEAK -> RELAX -> BUILD_UP" 使你的尸潮无延迟地直接产生.
MobRechargeRate int 应该是感染者再生后的速度之类的 (也就是下一只感染者).
MobSpawnMaxTime int 180-240 两波尸潮产生的最大时间间隔(单位秒).默认值取决于难度.
MobSpawnMinTime int 90-120 两波尸潮产生的最小时间间隔(单位秒). 默认值取决于难度.
MusicDynamicMobScanStopSize int 当尸潮的感染者数量小于此数时,尸潮背景音乐停止
MusicDynamicMobSpawnSize int 25 当尸潮感染者数量大于此数时播放尸潮背景音乐
MusicDynamicMobStopSize int 当尸潮的感染者数量达到这个数值时停止播放音乐
NumReservedWanderers int 不能因成为尸潮而消失的闲逛感染者的数量
NoMobSpawns bool false 防止产生新的尸潮. 并不重设计时器, 并且会暂挂已经出生的感染者.
PanicForever int 只在夹击战中有效.
PausePanicWhenRelaxing bool
待完善: 确认类别/工作
PreferredMobDirection int
Note.png注意:这应该是感染者尸潮的产生方位
有效标签: SPAWN_ABOVE_SURVIVORS, SPAWN_ANYWHERE, SPAWN_BEHIND_SURVIVORS, SPAWN_FAR_AWAY_FROM_SURVIVORS, SPAWN_IN_FRONT_OF_SURVIVORS, SPAWN_LARGE_VOLUME, SPAWN_NEAR_IT_VICTIM, SPAWN_NO_PREFERENCE
Note.png注意:SPAWN_NEAR_IT_VICTIM 在结局前不存在并且会导致出错, 所以我们可以猜测应该是导演系统在结局开始时选择了某人作为它(victim). SPAWN_LARGE_VOLUME 就是那个让你离DC(DC指的应该是死亡中心)的结局一英里远的东西.
PreferredMobPosition Vector
待完善: 确认类别/工作; 在dash模式中被使用了
PreferredMobPositionRange int
待完善: 确认类别/工作; 在dash模式中被使用了
PreferredSpecialDirection int
Note.png注意:这应该是特感的产生方位
Note.png注意:PreferredMobDirection同样适用于此,但它还多出了如下两个标签,目前尚不清楚这两个标签是不是多余的. SPAWN_SPECIALS_ANYWHERE, SPAWN_SPECIALS_IN_FRONT_OF_SURVIVORS
ProhibitBosses bool 禁止导演系统产生Witch和Tank. 只在合作模式中有效.
RelaxMaxFlowTravel float 在节奏从RELAX转换到BUILD_UP的期间生还者可以前进多远
Note.png注意:单位应该是英寸
RelaxMaxInterval float RELAX节奏持续的最大时间
Note.png注意:单位应该是秒
RelaxMinInterval float RELAX节奏持续的最小时间
Note.png注意:单位应该是秒
ShouldAllowMobsWithTank bool 尸潮是否能与Tank并存.
待完善: 确认类别/工作; 可能是结局专属的功能
ShouldAllowSpecialsWithTank bool 是否允许特感与Tank并存.
待完善: 确认类别/工作; 可能是结局专属的功能
ShouldConstrainLargeVolumeSpawn bool
待完善: 确认类别/工作
ShouldIgnoreClearStateForSpawn bool
待完善: 确认类别/工作
SpawnBehindSurvivorsDistance 前提是PreferredSpecialDirection = SPAWN_BEHIND_SURVIVORS
SpecialInfectedAssault
待完善: 确认类别/工作
SpecialInitialSpawnDelayMax float
SpecialInitialSpawnDelayMin float
SpecialRespawnInterval float 一个特感通道产生一个特感的冷却时间.
SurvivorMaxIncapacitatedCount int 死前倒地的幸存者的最大数量.
SustainPeakMaxTime float 单位分钟
SustainPeakMinTime float 单位分钟
TankHitDamageModifierCoop float 1.0 (mutation1.nut Last Man on Earth)
待完善: 确认类别
TankRunSpawnDelay float 15 单位秒 (mutation19.nut Taaannnkk!)
待完善: 确认类别
TempHealthDecayRate float 0.27 0.27 是 pain_pills_decay_rate 默认的, 数值越高衰减越快.
WanderingZombieDensityModifier float 1.0 流浪感染者的乘数.
ZombieDiscardRange int
待完善: 可能是流浪感染者消失的范围
ZombieDontClear
ZombieSpawnInFog bool false 允许感染者在处于雾区的幸存者的视线内产生.
ZombieSpawnRange float 感染者最多可以从距离幸存者多远的地方产生.
ZombieTankHealth int 设置Tank的生命值.

限制出生

名称 类型 默认值 描述
BileMobSize int 胆汁瓶爆炸之后产生的感染者数量。似乎只在结局中有效。死亡中心和牺牲这两个地图中使用了这个变量。
BoomerLimit int 1 最多允许多少Boomer同时存在.
ChargerLimit int 1 最多允许多少Charger同时存在.
CommonLimit int 30 最多允许多少感染者同时存在.
DominatorLimit int 最多允许多少Hunters, Smokers, Jockeys和 Chargers同时存在.
待完善: 确认类别/工作
HunterLimit int 1 最多允许多少Hunter同时存在.
JockeyLimit int 1 最多允许多少Jockey同时存在.
MaxSpecials int 2 导演系统最多允许多少种特感同时存在.
MegaMobSize int 一次尸潮最多产生多少感染者.
Note.png注意:优先级可能高于MobMaxSize
MobMaxPending int 当尸潮的感染者数量超过CommonLimit时最多有多少感染者可以暂时等待生成.
MobMaxSize int 30 一次尸潮最多产生多少感染者.
MobMinSize int 10 一次尸潮最少产生多少感染者.
MobSpawnSize int 一次尸潮中感染者的静态数量. 优先级高于MobMinSizeMobMinSize.
PreTankMobMax int
待完善: 确认类别/工作; 可能是夹击战结局专属的功能
SmokerLimit int 1 最多允许多少Smoker同时存在.
SpitterLimit int 1 最多允许多少Spitter同时存在.
TankLimit int 1 最多允许多少Tank同时存在.
WitchLimit int 1 最多允许多少Witch同时存在.

EMS阶段专属

[待完善]

参见 L4D2_EMS/Appendix:_Spawning_Infected(en)

名称 类型 默认值 描述
PanicSpecialsOnly bool 恐慌事件应在完成特感后结束,而不是等待大型尸潮。
PanicWavePauseMax float
待完善: 确认类别/工作
PanicWavePauseMin float
待完善: 确认类别/工作
ScriptedStageType int 下一个要运行的阶段类型。参见L4D2_EMS/StageTypeAppendix(en)了解阶段类型的描述。
ScriptedStageValue int 取决于阶段类型。
SpawnDirectionCount
待完善: 确认类别/工作
SpawnDirectionMask int 一个位字段(使用SPAWNDIR_N, _NE, _E等)指定导演从相对于地图中名为Compass的实体的方向生成。专为类似生存模式的游戏模式设计。参见L4D2_EMS/Appendix:_Spawning_Infected(en)
SpawnSetPosition Vector SpawnSetRule设置为SPAWN_POSITIONAL时,感染者可以生成的区域中心点。
SpawnSetRadius int SpawnSetRule设置为SPAWN_POSITIONAL时,感染者可以从中心点生成多远。
SpawnSetRule int 覆盖使用的生成模式。似乎在结局中无效。有效标志有:SPAWN_ANYWHERE, SPAWN_FINALE, SPAWN_BATTLEFIELD, SPAWN_SURVIVORS, SPAWN_POSITIONAL
TotalBoomers int 一波中允许的Boomer数量。
TotalChargers int 一波中允许的Charger数量。
TotalHunters int 一波中允许的Hunter数量。
TotalJockeys int 一波中允许的Jockey数量。
TotalSmokers int 一波中允许的Smoker数量。
TotalSpecials int 一波中允许的特感总数。
TotalSpitters int 一波中允许的Spitter数量。
  • function void g_ModeScript::GetNextStage()
当导演想要一个新阶段时调用。可以使用Director.ForceNextStage()强制调用。

结局专属/相关

通常一个结局会包含X个阶段. DirectorOptions中的一些变量只能用于结局阶段. 在脚本中也能定义多阶段结局, 只要在选项开头冠以A_, B_, C_ 等等即可

名称 类型 默认值 描述
A_CustomFinale_StageCount int 阶段数量. 需要设置对抗得分才能正常运行.
A_CustomFinaleX int 阶段类型 (包含PANIC, SCRIPTED (AKA ONSLAUGHT), DELAY, TANK), X是阶段数. 也用于脚本化尸潮.
A_CustomFinaleValueX * 值取决于上面的阶段类型. 也用于脚本化尸潮. 请看上方的举例.
A_CustomFinaleMusicX string Soundscript(en) 引入游戏. 例如, A_CustomFinaleMusic1 = "C2M5.BadManTank2". 注意 c2m5_concert_finale.nut 不使用此方法,而是选择使用地图中的实体. 在c2m5 的脚本中 A_CustomFinaleMusic4 = "", 意味着实际上没有歌曲通过脚本自动播放.
EnforceFinaleNavSpawnRules bool 可能用于强制执行结局出生行为但并不进入结局阶段。
待完善: 确认类别/工作
HordeEscapeCommonLimit 逃离阶段允许的感染者数量.
EscapeSpawnTanks bool 是否在逃离阶段中产生Tank.
待完善: 可能与EMS阶段有关
MinimumStageTime int 在结束之前允许SCRIPTED阶段运行的最短时间.

夹击战专属/相关

这些选项特定于夹击战结局。大多数可以在director_gauntlet.nut中找到。

名称 类型 默认值 描述
CustomTankKiteDistance int 3000
待完善: 确认类别/工作


移动奖励相关选项
当幸存者在夹击战目标方面没有进展时,移动奖励会连续增加尸潮之间的延迟。当前奖励值每秒递减,当达到0时允许生成尸潮。当生成尸潮时,当前奖励重置为移动奖励值。移动奖励按设定的时间间隔增加,并在幸存者跨越移动阈值时重置,然后递增。使用director_debug 1查看这些值。
名称 类型 默认值 描述
GauntletMovementThreshold float 幸存者可以前进的流程单位数量,然后移动奖励重置。
GauntletMovementTimerLength float 每次移动奖励增加之间的时间间隔,以秒为单位。
GauntletMovementBonus float 初始值,以及移动奖励每个时间间隔增加的数量,以秒为单位。
GauntletMovementBonusMax float 移动奖励可以达到的最大值。

对抗模式专属/相关

名称 类型 默认值 描述
TankHitDamageModifierVersus float 1.0
ZombieGhostDelayMax int 30 允许玩家感染者重生前的最大时间(秒)。
ZombieGhostDelayMin int 20 允许玩家感染者重生前的最小时间(秒)。

清道夫模式专属/相关

名称 类型 默认值 描述
ScavengeClusterBonusTime float
待完善: 确认类别/工作
ScavengeRoundInitialTime float
待完善: 确认类别/工作
ScavengeScoreBonusTime float (用于 mutation13.nut Follow the Liter)

生存模式专属/相关

名称 类型 默认值 描述
SurvivalSetupTime float (用于 mutation15.nut 的生存对抗模式,设置时间为90秒)

突变模式专属/相关

其中一些值是全局值的突变特定值(cm_CommonLimit,cm_MaxSpecials等),因此如果您正在制作突变模式,请使用它们,以防任何地图脚本更改全局值。

名称 类型 默认值 描述
cm_AggressiveSpecials bool true
cm_AllowPillConversion bool true 允许药丸转换为医疗包。
cm_AllowSurvivorRescue bool
cm_AutoReviveFromSpecialIncap bool false 当被特感击倒时立即复活幸存者。
cm_AutoSpawnInfectedGhosts bool
cm_BaseCommonAttackDamage
cm_BaseSpecialLimit int
cm_CommonLimit int
cm_DominatorLimit int
cm_FirstManOut int false 当第一个幸存者到达逃生载具时结束逃生。
cm_frustrationTimer
cm_HeadshotOnly
cm_HealingGnome
cm_InfiniteFuel (mutation7.nut Chainsaw Massacre)
cm_MaxSpecials
cm_NoRescueClosets
cm_NoSurvivorBots
cm_ProhibitBosses
cm_ShouldEscortHumanPlayers
cm_ShouldHurry
cm_SingleScavengeCluster 用于清道夫模式油桶逐个生成。
cm_SpecialRespawnInterval
cm_SpecialSlotCountdownTime
cm_SpecialsRetreatToCover
cm_TankLimit
cm_TankRun 用于 Taaank! 突变模式 (mutation19.nut)。
cm_TempHealthOnly
cm_VIPTarget
cm_WanderingZombieDensityModifier
cm_WitchLimit

无用设置

这些似乎不被导演读取。

名称 类型 默认值 描述
ActiveChallenge bool false 激活突变模式。似乎在EMS更新后已过时。
MegaMobMaxSize int 恐慌事件期间生成的总感染者的最大数量。2014.04.29 不起作用。
MegaMobMinSize int 恐慌事件期间生成的总感染者的最小数量。2014.04.29 不起作用。

钩子函数

这些函数被放置在DirectorOptions表中,并在地图加载时被调用。

函数 签名 描述
AllowWeaponSpawn bool AllowWeaponSpawn(string classname) 返回给定类名是否允许生成,被多个突变模式使用。
ConvertWeaponSpawn string ConvertWeaponSpawn(string classname) 将给定类名的武器生成转换为另一个,被多个突变模式使用。
ConvertZombieClass int ConvertZombieClass(infectedClass) 将一个生成转换为另一个,被 Taaannnk!! 突变模式使用 (mutation19.nut)。
GetDefaultItem string GetDefaultItem(index) 使用递增索引重复调用。返回武器名称的字符串以使其成为幸存者的默认物品,或返回0以结束迭代。
ShouldAvoidItem bool ShouldAvoidItem(string classname)
待完善: 可能是与机器人相关或生成相关的函数

枚举

  • 导演枚举
    Note.png注意:这些是(或部分是)脚本特定的,因此有重复的值。
    • ALLOW_BASH_ALL = 0
    • ALLOW_BASH_NONE = 2
    • ALLOW_BASH_PUSHONLY = 1
    • BOT_CANT_FEEL = 4
    • BOT_CANT_HEAR = 2
    • BOT_CANT_SEE = 1
    • BOT_CMD_ATTACK = 0
    • BOT_CMD_MOVE = 1
    • BOT_CMD_RESET = 3
    • BOT_CMD_RETREAT = 2
    • BOT_QUERY_NOTARGET = 1
    • DMG_BLAST = 64
    • DMG_BLAST_SURFACE = 134217728
    • DMG_BUCKSHOT = 536870912
    • DMG_BULLET = 2
    • DMG_BURN = 8
    • DMG_HEADSHOT = 1073741824
    • DMG_MELEE = 2097152
    • DMG_STUMBLE = 33554432
    • FINALE_CUSTOM_CLEAROUT = 11
    • FINALE_CUSTOM_DELAY = 10
    • FINALE_CUSTOM_PANIC = 7
    • FINALE_CUSTOM_SCRIPTED = 9
    • FINALE_CUSTOM_TANK = 8
    • FINALE_FINAL_BOSS = 5
    • FINALE_GAUNTLET_1 = 0
    • FINALE_GAUNTLET_2 = 3
    • FINALE_GAUNTLET_BOSS = 16
    • FINALE_GAUNTLET_BOSS_INCOMING = 15
    • FINALE_GAUNTLET_ESCAPE = 17
    • FINALE_GAUNTLET_HORDE = 13
    • FINALE_GAUNTLET_HORDE_BONUSTIME = 14
    • FINALE_GAUNTLET_START = 12
    • FINALE_HALFTIME_BOSS = 2
    • FINALE_HORDE_ATTACK_1 = 1
    • FINALE_HORDE_ATTACK_2 = 4
    • FINALE_HORDE_ESCAPE = 6
    • HUD_FAR_LEFT = 7
    • HUD_FAR_RIGHT = 8
    • HUD_FLAG_ALIGN_CENTER = 512
    • HUD_FLAG_ALIGN_LEFT = 256
    • HUD_FLAG_ALIGN_RIGHT = 768
    • HUD_FLAG_ALLOWNEGTIMER = 128
    • HUD_FLAG_AS_TIME = 16
    • HUD_FLAG_BEEP = 4
    • HUD_FLAG_BLINK = 8
    • HUD_FLAG_COUNTDOWN_WARN = 32
    • HUD_FLAG_NOBG = 64
    • HUD_FLAG_NOTVISIBLE = 16384
    • HUD_FLAG_POSTSTR = 2
    • HUD_FLAG_PRESTR = 1
    • HUD_FLAG_TEAM_INFECTED = 2048
    • HUD_FLAG_TEAM_MASK = 3072
    • HUD_FLAG_TEAM_SURVIVORS = 1024
    • HUD_LEFT_BOT = 1
    • HUD_LEFT_TOP = 0
    • HUD_MID_BOT = 3
    • HUD_MID_BOX = 9
    • HUD_MID_TOP = 2
    • HUD_RIGHT_BOT = 5
    • HUD_RIGHT_TOP = 4
    • HUD_SCORE_1 = 11
    • HUD_SCORE_2 = 12
    • HUD_SCORE_3 = 13
    • HUD_SCORE_4 = 14
    • HUD_SCORE_TITLE = 10
    • HUD_SPECIAL_COOLDOWN = 4
    • HUD_SPECIAL_MAPNAME = 6
    • HUD_SPECIAL_MODENAME = 7
    • HUD_SPECIAL_ROUNDTIME = 5
    • HUD_SPECIAL_TIMER0 = 0
    • HUD_SPECIAL_TIMER1 = 1
    • HUD_SPECIAL_TIMER2 = 2
    • HUD_SPECIAL_TIMER3 = 3
    • HUD_TICKER = 6
    • INFECTED_FLAG_CANT_FEEL_SURVIVORS = 32768
    • INFECTED_FLAG_CANT_HEAR_SURVIVORS = 16384
    • INFECTED_FLAG_CANT_SEE_SURVIVORS = 8192
    • IN_ATTACK = 1
    • IN_ATTACK2 = 2048
    • IN_BACK = 16
    • IN_CANCEL = 64
    • IN_DUCK = 4
    • IN_FORWARD = 8
    • IN_JUMP = 2
    • IN_LEFT = 512
    • IN_RELOAD = 8192
    • IN_RIGHT = 1024
    • IN_USE = 32
    • SCRIPTED_SPAWN_BATTLEFIELD = 2
    • SCRIPTED_SPAWN_FINALE = 0
    • SCRIPTED_SPAWN_POSITIONAL = 3
    • SCRIPTED_SPAWN_SURVIVORS = 1
    • SCRIPT_SHUTDOWN_EXIT_GAME = 4
    • SCRIPT_SHUTDOWN_LEVEL_TRANSITION = 3
    • SCRIPT_SHUTDOWN_MANUAL = 0
    • SCRIPT_SHUTDOWN_ROUND_RESTART = 1
    • SCRIPT_SHUTDOWN_TEAM_SWAP = 2
    • SPAWNDIR_E = 4
    • SPAWNDIR_N = 1
    • SPAWNDIR_NE = 2
    • SPAWNDIR_NW = 128
    • SPAWNDIR_S = 16
    • SPAWNDIR_SE = 8
    • SPAWNDIR_SW = 32
    • SPAWNDIR_W = 64
    • SPAWN_ABOVE_SURVIVORS = 6
    • SPAWN_ANYWHERE = 0
    • SPAWN_BATTLEFIELD = 2
    • SPAWN_BEHIND_SURVIVORS = 1
    • SPAWN_FAR_AWAY_FROM_SURVIVORS = 5
    • SPAWN_FINALE = 0
    • SPAWN_IN_FRONT_OF_SURVIVORS = 7
    • SPAWN_LARGE_VOLUME = 9
    • SPAWN_NEAR_IT_VICTIM = 2
    • SPAWN_NEAR_POSITION = 10
    • SPAWN_NO_PREFERENCE = -1
    • SPAWN_POSITIONAL = 3
    • SPAWN_SPECIALS_ANYWHERE = 4
    • SPAWN_SPECIALS_IN_FRONT_OF_SURVIVORS = 3
    • SPAWN_SURVIVORS = 1
    • SPAWN_VERSUS_FINALE_DISTANCE = 8
    • STAGE_CLEAROUT = 4
    • STAGE_DELAY = 2
    • STAGE_ESCAPE = 7
    • STAGE_NONE = 9
    • STAGE_PANIC = 0
    • STAGE_RESULTS = 8
    • STAGE_SETUP = 5
    • STAGE_TANK = 1
    • TIMER_COUNTDOWN = 2
    • TIMER_COUNTUP = 1
    • TIMER_DISABLE = 0
    • TIMER_SET = 4
    • TIMER_STOP = 3
    • TRACE_MASK_ALL = -1
    • TRACE_MASK_NPC_SOLID = 33701899
    • TRACE_MASK_PLAYER_SOLID = 33636363
    • TRACE_MASK_SHOT = 1174421507
    • TRACE_MASK_VISIBLE_AND_NPCS = 33579137
    • TRACE_MASK_VISION = 33579073
    • UPGRADE_EXPLOSIVE_AMMO = 1
    • UPGRADE_INCENDIARY_AMMO = 0
    • UPGRADE_LASER_SIGHT = 2
    • ZOMBIE_BOOMER = 2
    • ZOMBIE_CHARGER = 6
    • ZOMBIE_HUNTER = 3
    • ZOMBIE_JOCKEY = 5
    • ZOMBIE_NORMAL = 0
    • ZOMBIE_SMOKER = 1
    • ZOMBIE_SPITTER = 4
    • ZOMBIE_TANK = 8
    • ZOMBIE_WITCH = 7
    • ZSPAWN_MOB = 10
    • ZSPAWN_MUDMEN = 12
    • ZSPAWN_WITCHBRIDE = 11

推荐阅读