Difference between revisions of "L4D2 EMS:zh-cn"

From Valve Developer Community
Jump to: navigation, search
Line 11: Line 11:
== BETA 版 ==
== BETA 版 ==
本文及其他有关教程描述了在'''Left 4 Dead 2 Beta'''中发现但尚未被广泛公布的特色内容. Valve随时可能主动地或者因响应Beta版测试者的反馈而改进这些特色内容, 导致它们产生本文作者无法预测的变化.
本文及其他有关教程描述了在'''Left 4 Dead 2 Beta'''中发现但尚未被广泛公布的功能. Valve随时可能主动地或者因响应Beta版测试者的反馈而改进这些功能, 导致它们产生本文作者无法预测的变化.
== The Mutation System just got better! ==
== 突变系统变得更好了! ==
This release of '''Left4Dead2''' features a vastly improved system for authoring game Mutations. We call it the '''Expanded Mutation System (EMS)'''. The previous version of the Mutation system allowed users to create new Mutations by making minor alterations to existing game rules and Director variables. The '''EMS''' provides new tools that make it possible to build Mutations that are far more interesting and complex than previously possible. The most powerful new feature is a deep integration of the Squirrel scripting language. Mutation authors can now write their own Squirrel scripts to:
这次发布的'''Left4Dead2'''版本对于编写突变模式的功能进行了很大的改进. 我们姑且称之为'''扩展突变系统(EMS)'''好了. 早期的突变系统允许玩家通过对现有游戏规则和导演系统变量进行较小的改动的方式来创建新的突变模式. '''EMS'''提供了新的手段来使得制作较以往更为有趣与复杂的突变模式成为了可能. 最强大的新功能是对Squirrel脚本语言的深度集成, 从今以后突变模式的作者可以把他们自己的Squirrel脚本写成:
*Direct the flow and pacing of the Director
*Direct the flow and pacing of the Director

Revision as of 22:22, 5 January 2020


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

注: 英文版页面已被锁定, 无法添加多语言链接, 希望有权限者协助添加.


本文及其他有关教程描述了在Left 4 Dead 2 Beta中发现但尚未被广泛公布的功能. Valve随时可能主动地或者因响应Beta版测试者的反馈而改进这些功能, 导致它们产生本文作者无法预测的变化.


这次发布的Left4Dead2版本对于编写突变模式的功能进行了很大的改进. 我们姑且称之为扩展突变系统(EMS)好了. 早期的突变系统允许玩家通过对现有游戏规则和导演系统变量进行较小的改动的方式来创建新的突变模式. 而EMS提供了新的手段来使得制作较以往更为有趣与复杂的突变模式成为了可能. 最强大的新功能是对Squirrel脚本语言的深度集成, 从今以后突变模式的作者可以把他们自己的Squirrel脚本写成:

  • Direct the flow and pacing of the Director
  • Spawn and control entities
  • Augment existing entity behavior
  • Attach script code to any game event
  • Set up "slowpoll" tick functions to do periodic rules/status updates
  • Display a HUD with strings and variables that update based on gameplay
  • Add or remove entities from existing maps for easy re-use
  • And just like on TV: much, much more!

The Expanded Mutation System is now flexible enough to support the creation of Mutations that rival all-new game modes in complexity.

The Squirrel Scripting Language

In the EMS, Mutation scripts are written in the Squirrel scripting language, which bears similarities to both C and Lua. You'll need to understand Squirrel in order to write your own game Mutation scripts.

The official Squirrel Language home page contains Squirrel language downloads, documentation and a community discussion board. It's a great place to start if you are not familiar with Squirrel.

At the very least, you should understand that the file extension for Squirrel script code is .nut - so anywhere we talk about a file ending in .nut we are discussing a file that contains Squirrel script code. Hilarity ensues.


Even this fancy new system comes with constraints. Some game features and data are still outside of the domain of the Mutation system. This is still a system for creating different flavors of gameplay within the Left 4 Dead 2 universe, not a tool for making other games. For example:

  • There are no features to support the creation of new weapons or characters
  • Navigation meshes for each map are precomputed and cannot be changed at runtime
  • Some types of props and objects are 'baked into' existing maps and cannot be altered or removed


As a Mutation author you probably want to start by thinking of a fairly simple experience you want to create. Once you have that, you can start investigating what is possible and mapping it to your idea. There is a lot you can do, but there are also plenty of implicit rules and limits within the engine and tools that may thwart you. In its current state, the Expanded Mutation System is a tool about working within the structure and limitations.

On the other hand, if you have an idea that wasn't possible to realize with the previous Mutation system, the Expanded Mutation System may just provide the features you've been waiting for!