Left 4 Dead 2/Scripting/Expanded Mutation System/Appendix: DirectorOptions

From Valve Developer Community
Jump to: navigation, search

The DirectorOptions Table

And yes, in a new mutation, you'll use SessionOptions to refer to this stuff, not DirectorOptions.

The Options Table

Check out the following, for the previous info about all the DirectorOptions Settings

https://developer.valvesoftware.com/wiki/L4D2_Vscripts#Director_options

There are also some new options provided in the extended mutation support. They will probably be documented on the page above eventually, but here are a few worth calling out.

  • Total<SpecialType> - if you want a panic wave with a specific # of a specific type of special
  • TotalSpecials - if you just want a given # of specials in a wave, but you don't care exactly which
  • PanicSpecialsOnly - the Panic should end when we finish with Specials, not wait for the MegaMob
  • SpawnSetRule/SpawnDirectionMask - see Spawning Infected
  • InfectedFlags - allows you to change sensory behavior for common infected. Values are:
    • INFECTED_FLAG_CANT_SEE_SURVIVORS
    • INFECTED_FLAG_CANT_HEAR_SURVIVORS
    • INFECTED_FLAG_CANT_FEEL_SURVIVORS

Example of how to OR all three flags so commons can't see, hear, or feel survivors touch them:

InfectedFlags = INFECTED_FLAG_CANT_SEE_SURVIVORS | INFECTED_FLAG_CANT_HEAR_SURVIVORS | INFECTED_FLAG_CANT_FEEL_SURVIVORS


These flags are set on spawn so if you set flags they will not apply to any infected that are currently in the world. In order to apply flags to already spawned infected you can use this function call:

  • ReapplyInfectedFlags( int, handle ): Apply Infected Flags. Applies to all common (spawned and unspawned) unless a handle to a specific infected is specified.

Warning: 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.

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.