Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
How to combine several Radial Menu/Vocalizer mods
By Tendie
   
Award
Favorite
Favorited
Unfavorite
The reason vocalizer mods always interfere with one another
When you use multiple radial menu mods in Left 4 Dead 2, they get in each other's way because they all want to change the same thing: the radialmenu.txt file. This file controls what shows up in the radial menu(s) and where each option it's placed on the screen. So, if two mods try to change the radialmenu.txt file, they end up conflicting with each other and only one of them is loaded and active.

To fix this, you need to combine all the things you like from each mod into one big mod. This can be tricky because you need to know what you want and how to put it all together. But don't worry, I'll show you how in the next sections of the guide!
How do Radial Menus work and what is their code structure/syntax?
A radial menu mod only requires a couple files to be created at:
SteamAppsDirectory/Left4Dead2/left4dead2/addons/Addon Name/scripts

radialmenu.txt and key_act.lst.

The first one contains the names and parameters of all radial menus and the latter contains entries to bind your radial menus under
Options>Keyboard>Edit Keys/Buttons

radialmenu.txt

When you open a radialmenu.txt file you'll find something like this:
"RadialMenu" { //-------------------------------------------------------------- "Orders,Survivor,Alive" { "Center" { "command" "vocalize smartlook" "text" "#L4D_rosetta_look" } "North" { ... } "NorthEast" { ... } "East" { ... } "SouthEast" { ... } "South" { ... } "SouthWest" { ... } "West" { ... } "NorthWest" { ... } } //-------------------------------------------------------------- "QA,Survivor,Alive" { ... } //-------------------------------------------------------------- "Orders,Zombie,Alive" { "Center" { "command" "vocalize PlayerZombieTaunt" "label" "#L4D_rosetta_grrrr" } } ... }
The syntax in this file represents the following:
"RadialMenu"
{ ... }
encapsulates the entirety of the file contents, make sure all your radial menu definitions are inside the outermost set of curly braces!

//---...
Anything after // will be a comment (meaning it will not be included in the actual code running, this is a common practice in programming to write *comments* for reference/communication/explaination, it's also used for temporal removal of code), in this case the //-----... comment is present before each new radial menu by default to serve as a clear marker of where a new radial menu definition begins.

"Orders,Survivor,Alive"
This line defines 3 things: The name of the radial menu "Orders", while "Survivor/Zombie" and "Alive" control the context under which each radial menu should appear.

Below this, a set of curly braces
{ ... }
defines the start and end points of the radial menu definition.
Inside these curly braces, we can define any combination or all of the 9 available directions. Make sure no direction is repeated inside a radial menu!
"Center","North","NorthEast","East","SouthEast","South","SouthWest","West","NorthWest"
For each direction you define you should create another set of curly braces below it containing the following info:
"command" "your command"
"text" "Option name"
where "command" and "text" will always have these names, you must replace "your command" and "Option name" with the values you wish. The command you write will be executed when you select the option, which will show in the radial menu using the name you define in "Option name". For example, the following will send a team-only chat message that says "This is a test chat message from a radial menu"
"command" "say_team This is a test chat message from a radial menu"
"text" "Send test msg"

key_act.lst

You could skip this and bind your keys from the console like:
bind key "+mouse_menu Name"
But for convenience and accessibility, it's much more appropriate to include key binding definitions so these menus can be binded from the Keyboard options menu.

The vanilla kb_act.lst file looks like this:

"blank" "==========================" "blank" "#Valve_Movement_Title" "blank" "==========================" "+forward" "#Valve_Move_Forward" "+back" "#Valve_Move_Back" "+moveleft" "#Valve_Move_Left" "+moveright" "#Valve_Move_Right" "+speed" "#L4D_Walk" "+jump" "#Valve_Jump" "+duck" "#Valve_Duck" "blank" "==========================" "blank" "#Cstrike_Combat_Title" "blank" "==========================" ... "blank" "==========================" "blank" "#Valve_Communication_Title" "blank" "==========================" ...

The syntax of this file works as follows:
"blank" "==========================" "blank" "Section Title" "blank" "=========================="
encapsulates the title of a subsection inside "Options>Keyboard>Edit Keys/Buttons"

"action to execute" "Action name"
contains the desired action triggered when pressing the binded key and name to show for each action in the Edit Keys menu

The default radial menus are defined under the "#Valve_Communication_Title" section and their definitions are as follows:
"+mouse_menu Orders" "#L4D_orders" "+mouse_menu QA" "#L4D_questions"
Where +mouse_menu indicates we are activating a radial menu when that key is pressed, Orders/QA are the name of the desired menu, which matches their names in radialmenu.txt. The second parameter as mentioned previously contains their display name.

The default sections/entries have programmatic names which you can identify because they start with # (the actual value displayed will change based on the language of the game), you can add a section with whatever name you want to group the key bind entries for your menu(s) or just create the entries. For example the entries for my Left4Bots Radial Menu addon are defined as follows:

"blank" "==========================" "blank" "LEFT 4 BOTS RADIAL MENU" "blank" "==========================" "+mouse_menu Left4Bots" "Basic Commands" "+mouse_menu Left4Bots2" "Advanced Commands"
Fix
Ok, now you know how a radial menu is put together but you still need a few more concepts in order to combine several of them together.

You'll need to download the mod VPK using
steamworkshopdownloader(dot)io/
or a similar service (or find your desired mod inside
SteamAppsFolder/Left4Dead2/Left4Dead2/addons/workshop
but mods from the workshop folder always have their names be just a bunch of numbers [they include their preview image with the same name as the VPK so it's 100% possible to work from the workshop folder, albeit inconventient] so you might prefer to download it externally if you have lots of mods installed).
You also need to learn to work with a VPK file.

Any radial menu mod should have the same directory layout and contents when open in GCFScape:

scripts/kb_act.lst scripts/radialmenu.txt addonimage.png/jpg addoninfo.txt

Extract the contents of all mods to separate folders.

Create a new folder replicating the described file structure or duplicate the folder of one mod to use as a base for your combined radial menu.

Edit the base radialmenu.txt and modify/add/remove the radial menu definitions and their entries as needed by copying the definitions you need from the other radialmenu.txt files.

Edit the base key_act.lst and modify/add/remove the key binding definitions as needed making sure the names match those defined in the base radialmenu.txt file.

Test your mod
You can test with the files you created inside addons, they aren't required to be inside a VPK file to work, however you'll need to pack them into a vpk and do some more things if you want to upload your mods to the workshop but that's beyond the scope of this guide.
Don't be a D, give credit to other peoples' work
Give credit, ask for permission and all that jazz. Because of the way Valve handles modding in their engine, all mods have their source exposed, but that doesn't make it right to take other people's work and use it without permission or credits. While I'm completely fine with you modifying my mods and crediting me or not, others aren't. So always be sure to ask for permission before reuploading the work of others and give credit where credit is due.
1 Comments
22 Nov, 2023 @ 6:44pm 
bad guide, no picture book