Left 4 Dead 2

Left 4 Dead 2

135 ratings
Custom Mutations Tutorial
By Rayman1103 and 1 collaborators
Hello everyone. In this tutorial I’ll teach you how to create your own custom Mutations.

If you have any questions just ask, I'll be glad to assist you.

Now lets get started!
   
Award
Favorite
Favorited
Unfavorite
Getting Started
  • Step 1: Download this ZIP folder containing the templates you'll need in order to create your very own Mutations.[www.dropbox.com]

  • Step 2: Extract the Mutations folder to your desktop from within the Example Mutations ZIP file.

  • Step 3: Open the Mutations folder and you'll see two folders, "modes" and "scripts" and one file, "addoninfo.txt". The modes folder contains the mode data for your Mutations, while the scripts folder will contain scripts to tweak settings for your Mutations that can't be done in the mode files. The addoninfo.txt file is used to set a name for your mod, enter the author name and add a description for your mod.

  • Step 4: Now open the modes folder and you'll see two files, "testmutation1.txt" and "testmutation2.txt". These are here as examples, so you can easily use them as a template.

    Note: Each file can hold data for one mode only. Don't try to add multiple modes in the same file.

  • Step 5: Open testmutation1.txt. You'll see the modename is declared above the brackets. It has the same name as the text file.

    Note: I would recommend changing the name of the file and the modename within the file to something different when you're ready to release your Mutation. The text file and modename can differ, but I recommend keeping them the exact same to prevent any issues.

  • Step 6: Go back to the main directory of your Mutations folder, and open the scripts folder. You'll see another folder called "vscripts". This is where your VScripts would be placed to change additional settings in your Mutations. They're written in the Squirrel Scripting Language.

    Note: If you're unfamiliar with Squirrel, I recommend reading about it here.[www.squirrel-lang.org]

  • Step 7: Open the vscripts folder and you'll see two files, "testmutation1.nut" and "testmutation2.nut". Notice how the name of the nut file and modename are exactly the same? This is important to keep them the exact same, otherwise your VScript wont be read when the Mutation starts.

  • Step 8: Download decompiled vscripts here[www.dropbox.com]. They’re there for reference, do not place them in your vscripts folder.

  • Step 9: You can use a decompiled nut file. Copy/paste a nut file and place it in your vscripts folder. Now rename it to say, “testmutation1” (or whatever name your mode is). Now go inside the nut file and add the commands you want, or remove the commands you don‘t.

    Note: Make sure you keep the command, “ActiveChallenge = 1”, in the nuts.

  • Step 10: Go here for a list of Cvars to be used in the mode files.
    Go here for a list of VScript commands for the nut files.
    Also go here for information regarding the Extended Mutation System (EMS).

    Note: Not all Cvars will work. You'll have to test them.

  • Step 11: When you're done, or you want to test your Mutation. Download the Authoring Tools from Steam -> Libraries -> Tools -> Left 4 Dead 2 Authoring Tools. Then navigate to the bin folder and use the VPK creator. C:\Program Files (x86)\Steam\steamapps\common\left 4 dead 2\bin. Move the Mutations folder into the VPK program, and it'll create the VPK. Then place it in your addons folder and play your Mutation.

Here's a list of weapon commands for VScripts, to be used for the nut files.

"weapon_pistol", "weapon_pistol_magnum", "weapon_smg", "weapon_smg_silenced", "weapon_pumpshotgun", "weapon_shotgun_chrome", "weapon_hunting_rifle", "weapon_sniper_military", "weapon_rifle", "weapon_rifle_desert", "weapon_rifle_ak47", "weapon_autoshotgun", "weapon_shotgun_spas", "weapon_first_aid_kit", "weapon_defibrillator", "weapon_pain_pills", "weapon_adrenaline", "weapon_molotov", "weapon_pipe_bomb", "weapon_vomitjar", "weapon_gascan", "weapon_propanetank", "weapon_oxygentank", "weapon_melee", "weapon_chainsaw", "weapon_grenade_launcher", "weapon_rifle_m60", "weapon_gnome", "weapon_cola_bottles", "weapon_fireworkcrate", "weapon_upgradepack_incendiary", "weapon_upgradepack_explosive", "weapon_ammo_pack", "weapon_smg_mp5", "weapon_rifle_sg552", "weapon_sniper_awp", "weapon_sniper_scout", "weapon_knife", "ammo", "upgrade_item", //Laser Sights can only be removed
Here's a list of melee commands for VScripts, to be used for the nut files.

Note: The only melee weapon that will appear in all maps is the baseball_bat. The rest will only appear if the mission file for the Campaign allows them to spawn.

"fireaxe", "frying_pan", "machete", "crowbar", "cricket_bat", "tonfa", "katana", "electric_guitar", "knife", "golfclub", "baseball_bat",
Now good luck making your Mutations!
Testing Your Mutation
After you've created the .VPK file and placed it in your addons folder, launch L4D2. Once at the main-menu, open the developer console and type the following, "map mapname testmutation1". This will launch your Mutation, if it works correctly you should see the loading text say "Label" instead of "Joining a Campaign game." If you do not see the "Label" text, then there's either an error somewhere, or there's another mod that's conflicting with the mode file.

You'll also find your Mutation available in Mutation -> Change Mutation. All you need to do is create a lobby and host a Local Server to play it.
145 Comments
filler john 3 Aug @ 7:40am 
Yeah, if I remember correctly I just found another mutation with the code and used that. Problem is, I don't remember how it was called. But I may have a band-aid fix, because I did publish the mutation I was talking about, and it's on my workshop called "Dangerous Quartet". You can go ahead and steal the code if you want to, although you need to decompile the vpk file, but I'm pretty sure you know how to do that.
4skiNZ^XxblackguyxX 3 Aug @ 1:13am 
@I have hey, did you ever manage to do this? I'm trying to make an aliens modpack so I want to set it up so that zombies explode like boomers on death and do damage with the resulting bile, curious if you managed to get the bile to do damage in the first place.
filler john 22 Sep, 2024 @ 9:37am 
Hey, I want to make a Mutation about the original L4D1 Special Infected, and I wanted to make the Boomers do damage when they vomit/explode on you. Not an instakill but like 10 damage, since I'm planning on making so that there's no hordes, only SI. I know there's an "IT" command or something like that which makes the game know you're vomited, but I'm really not sure how to do it. Any ideas?
toyota_driver_99 11 May, 2024 @ 9:35am 
Hello! My plan is to create melee weapons only mutation. In this mutation all SMGs, shotguns, assault rifles and sniper rifles are removed. There are just pistols, desert eagle, melee weapons, chainsaws, vomitjars, pipebombs, molotovs, first aid kits, defibrillators, adrenaline shots and pain pills. How I can create this mutation?
vernous 25 Jun, 2023 @ 5:03am 
How do i repeat lets say 4 smokers every 1 min?
Jugger 17 Mar, 2023 @ 4:06pm 
How can i replace all medkits(even the ones in the safe rooms) with pills and remove defibrilators and laser sights? It's for a Versus mutation
Rayman1103  [author] 13 Mar, 2023 @ 7:58am 
@Reaverer - No worries, happy to help! I don't mind if you want to use some of my stuff as templates for your own.
Reaverer 10 Mar, 2023 @ 9:06pm 
Also, thanks for supporting this after all these years :) .
Reaverer 10 Mar, 2023 @ 9:05pm 
Thanks @Rayman1103! That did indeed fix the issue. Hey, by any chance are your mods open source? There are so many that would make for great starting points.
Rayman1103  [author] 20 Feb, 2023 @ 7:52am 
@Reaverer - You'll want to place your own vpks in the addons folder, not the workshop sub-folder. That could be why it's deleting the file, since there's no subscribed Workshop item that uses it.