SaladFork's Guide to Having Fun with the Localization Files
Table of Contents
1. About this guide
- 1.1 Introduction (Why would I want to do this?)
- 1.2 Required Applications
2. Things you should know before starting
- 2.1 Variables - What are they?
- 2.2 Font Manipulators
3. Finding and opening the localization file
- 3.1 Finding and opening the localization file
4. Editting the localization file
- 4.1 Introduction
- 4.2 The Teamkill Message
- 4.3 Penalty Messages
- 4.4 Point Bonus Messages
- 4.5 Weapon Names
- 4.6 Award Messages
- 4.7 Control Point Status Messages
5. Final Notes
- 5.1 Localization Treasure Hunt
- 5.2 FAQ - Frequently Asked Questions
- 5.3 Disclaimer
- 5.4 Change Log
1.1 Introduction (Why would I want to do this?)
There are many reasons you may want to edit your localization settings. But before I get into that, let me explain exactly what they are, and why you shouldn't be too afraid of editting them.
This game was released all around the world. How does EA make sure that it will be understood in foreign contries, especially those that do not speak English as a main language? They created localization files. The game, instead of using plain strings to tell you what's going on, gets the information from variables stored inside these localization files.
There are different files for each language, so that all the game has to do is load the correct file with the correct values for the variables, and you've got a game in a completely different language.
Now, what's to stop you from telling BF2 that a language has been changed slightly? Absolutely nothing. By editting the localization files, we are able to modify these variables to make Battlefield 2 tell us pretty much anything we want, in any way we want.
Now, for some examples of this. We can modify the top scoreboard message that informs people of an ocurred teamkill so that it also includes the weapon used. Never again shall you wonder if it was an off-course bomb, or someone who was pissed at you and decided to knife you. You may also use it to change weapon names. Is there that one weapon, that when you're killed by it, you can never remember what it is? Well, now you can! For example, you can have it say something like =NAA=SaladFork [M203 - USMC Assault Grenade Launcher] You, or =NAA=SaladFork [M24 - USMC Sniper Rifle] You. The possibilities are ENDLESS.
Also, the following colors will be used throughout this guide:
Orange will represent the various sections found throughout this guide.
Blue will represent anything else that should draw your attention. Blue may also be used in addition with another color to provide contrast.
Green will represent a directory or a file name on your computer.
1.2 Required Applications
This tutorial assumes that you already own a copy of Battlefield 2. It also assumes that you have been patched up through patch 1.12. If not, please make sure to go and fulfill both of these needs now (in a legal manner, of course).
Other than that, all you're going to need is some sort of file browser (Windows Explorer works great), and a text editor (Notepad works fantastically).
2.1 Variables - What are they?
Before we begin, it will help you a lot to know what variables are, as they are used a lot in programs, like Battlefield 2.
Think of a variable as an unknown. Something that is always changing, and you can never be sure exactly what it is. For example, let's make up a variable and call it "#USERNAME#". For me, "#USERNAME#" would equal =NAA=SaladFork, for you, it would be your name. There is no true value for it, as it changes depending on the person it's referring to.
In localization, you are going to see variables like #PLAYERNAME1#, #AWARD#, and #TEAMNAME#.
This really isn't as difficult as you may think it is, and you'll see how simple it really is once we get into some actual editting later on.
2.2 Font Manipulators
You may also notice that the game changes the color of certain phrases inside the game. This can be seen clearly when you get those very helpful little overhead messages. Note how the key it is referring to is colored differently. When a commander gives you an order, notice how 'Page Up' and 'Page Down' are colored differently.
Think of the fact that a font is colored as a boolean. For those who don't know what a boolean is, it is simply means that it can be one of two things (a boolean can only be TRUE or FALSE). At any time, we can toggle the boolean so that it equals the other one (TRUE becomes FALSE, and FALSE becomes TRUE). By default, the boolean of "IS THE TEXT COLORED?" is FALSE, meaning the text is not colored. We then put it in the correct code, and that would change it to TRUE, and the text would become colored from then on. Put the code again later, and the text will go back to normal.
I am now going to introduce to you two different code built into BF2. Both of these codes begin with the '§' character, which tells the game a code is about to begin. The code consists of 4 characters (there's an exception, which I will get to shortly).
The code to change font color (to toggle the IS_IT_COLORED? boolean) is §Cxxxx. The purpose of xxxx is unknown, and changing it doesn't seem to matter too much. For the sake of practicality, let's do it like the game does, and use §C1001. So if my message was "Hello, SaladFork is my username.", and I wanted to make 'SaladFork' a different color, I'd use "Hello, §C1001SaladFork§1001 is my username." Or, if it's a variable... "Hello, §C1001#USERNAME#§C1001 is my username." Make sure you understand this before moving on.
The code to change font size is §Cxxxxx. Again, The purpose of xxxxx is unknown, except for the first x. The first x seems to control the size of the font. A 1 there would make tiny text, in comparison to the large text made with a 6 (maximum). So, using the above example, but with a big name, I would do "Hello, §30000SaladFork§00000 is my name". Changing it to size 0 will change it back to the default.
Remember that exception I mentioned earlier? Well, try and guess what the following would do: "Hello, §C§30000SaladFork§C§00000 is my name." That's right, it would make my name BIG and COLORED. Notice how the second color code terminated the first one. the first one is only §C, and all those extra x's are discarded when a second code is started.
3.1 Finding and opening the localization file
Okay, now that we know all that, let's get started! Open up Windows Explorer, or the file explorer of your choice, and find your Program Files folder (usually in C:\).
- Navigate to your Battlefield 2 folder. (Default: Program Files\EA Games\Battlefield 2\)
- Navigate into the Localization folder. (Default: \mods\bf2\Localization\)
- Navigate into the folder matching the language of your game (Most likely: \English\)
- Double click on English.utxt. If it asks you, tell it you will pick a program from a list. When the list appears, pick Notepad (or the text editor of your choice).
You should be able to find pretty much anything you want to edit by using the search feature (Default hotkey is CTRL-F). From here on out, you can edit pretty much anything you want in any way you want. Below I give some ideas on how to edit certain things that most of you will want to edit. I recommend you read through it and familiarize yourself with the process, even if you are not going to change those things.
The syntax of each line is pretty simple. First is the variable name, which the game uses, which SHOULD NOT BE CHANGED. Following that is two little boxes, then the variable value, and then another two boxes. In this guide, I am going to leave those boxes out, but make sure that your actual file includes these boxes (so don't just copy and paste).
4.2 The Teamkill Message
Search for the variable name HUD_HUD_KILLEDBY_TEAMKILLS. The value following it is the value that is shown in the top left of your screen whenever a teamkill is made. By default, the color is blue for a teammate, red for an enemy, or golden if it's a commander.
Again, remember that you can edit these to absolutely anything you want. You can make it say "#PLAYERNAME1#, the almightly, has decided to teamkill #PLAYERNAME2# with a #WEAPON#!". The following is what I did (don't forget the boxes before and after, which don't show up in my post).
§0#PLAYERNAME1# [§1Teamkills - #WEAPON#§0] #PLAYERNAME2#
Here's a screenshot of the output from that:
That wasn't too hard, was it? Go ahead and test it in single player. Remember to save the file first!
Extra Note: HUD_HUD_KILLEDBY_KILLS is the variable containing the usual kill message. You can edit that similarly if you wish.
4.3 Penalty Messages
Search for HUD_HUD_TEAM_DAMAGE_PLAYER and HUD_HUD_TEAM_DAMAGE_VEHICLE. These messages are pretty boring. Let's spice them up a bit. Again, remember you can change this to absolutely anything you want. Here's what I changed mine to:
For HUD_HUD_TEAM_DAMAGE_PLAYER: Team damage! (§C1001-2§C1001 penalty) FOR HUD_HUD_TEAM_DAMAGE_VEHICLE: Team vehicle damage! (§C1001-2§C1001 penalty)
Extra Note: Notice how I used color codes to make the value of the penalty stand out from the rest of the message. This shows you just how creative you can be with the localization file.
4.4 Point Bonus Messages
Search for HUD_HUD_REPLENISH_GOT_HEALING_POINT. Let's do something similar to the one above, where we tell the player how much he/she gets for completing this action.
You got a healing point! (§C1001+1§C1001 bonus)
Extra Note: This message, as well as a bunch of the ones below it, are messages given to you when you complete a teamwork action. The others ones can be editted in a similar way, if desired. Remember that revives, flag captures, and flag neutralizes give +2, while the rest give +1.
4.5 Weapon Names
As I said in the introduction, there might be a weapon or two you are not familiar with, and constantly forget what it is. What better way to remember than to add a friendly reminder to yourself. Remember that the weapon name is what replaces the #WEAPON# variable inside the kill(ed) messages.
Find KILLMESSAGE_WEAPON_m16a2. By default, the value is "M16A2". You can change this to anything you want. since I did not change any of these for myself, I'm going to leave it up to you. You should be able to figure it out from the above two examples.
Extra Note: m16a2 is only the first weapon. Scroll down and you will see a whole list of weapon variables that you can edit. If you have Special Forces and want to edit the names of the new weapons, you are going to have to edit the localization files in \mods\xpack\Localization\.
4.6 Award Messages
Those award messages are so plain and boring. Let's spruce them up a bit. I added color tags so that the name of the award given to me was a different color. I modified HUD_HUD_AWARDED, and HUD_HUD_MEDALS_BADGE_ARMOR (with all the ones below it. Here's an example of one such modification (HUD_HUD_MEDALS_BADGE_ARMOR):
You have received the §C1001#MEDAL#§C1001 armor badge.
Very similar to 4.6, I'm going to add some color to make it stand out more and make it a little more interesting. I've modified AUTO_RULES_welostacp, AUTO_RULES_welostacp_alt, AUTO_RULES_wecapturedacp, and AUTO_RULES_wecapturedacp_alt. Here's an example of one such modification (AUTO_RULES_wecaputredacp):
§0§C1001#PLAYERNAME#§1§C1001 captured the §C1001#CPNAME#§C1001 control point
5.1 Localization Treasure Hunt
If you look through the localization files, you will find many little things hidden inside that have been taken out of the game. For example, here are some (not all) of the things you may find:
WEAPON_NAME_wrench Wrench WEAPON_NAME_laserpainter Laser painter HUD_HUD_ASSIST_KILL_TARGETING You got a targeting assist! HUD_HELP_SQUAD_callForTarget You have received a call for a target HUD_HELP_SQUAD_recievedTarget Use Fire to shoot at laserpainted target HUD_HUD_RANGE_TO_TARGET_TEXT Range: #RANGE# HUD_HELP_WEAPON_HANDHELD_SIMRAD_CONTROLS_transmitTargetCoordinatesHold the §C1001Left Mouse Button§C1001 to §C1001Send§C1001 a Target's Coordinates to Aircraft AUTO_MOODGP_SL_targetlost Target lost AUTO_MOODGP_TM_targetlost Target lost HUD_SQUAD_requesttojoin May I join your squad? PLAYER_TACTICS_SL_retreat Fall back! PLAYER_TACTICS_SL_retreat_alt Drop back! Pull out! PLAYER_TACTICS_TM_retreat They're blowin' us away! Retreat! PLAYER_TACTICS_TM_retreat_alt We're getting wasted! Fall back! AUTO_RULES_losingcontrol Our position is under attack! AUTO_RULES_losingcontrol_alt Enemy is advancing COMMSL_SQUAD_newslassigned Squad leader assigned. Report in! COMMSL_SQUAD_newslassigned_altNew squad leader assigned COMMSL_SQUAD_assignedsl You have a squad. Now lead it! COMMSL_SQUAD_assignedsl_alt Congratulations on making squad leader COMMSL_SQUAD_squadneedsaleaderYour squad requires a new leader COMMSL_SQUAD_squadneedsaleader_altYou need a new leader to your squad PLAYER_SPOTTED_C_enemywbspottedEnemy wheelbarrow spotted! PLAYER_SPOTTED_SL_enemywbspottedEnemy wheelbarrow spotted! PLAYER_SPOTTED_TM_enemywbspottedEnemy wheelbarrow spotted! PLAYER_REPORTIN_SL_engineer Engineer requesting an objective! PLAYER_REPORTIN_SL_medic Medic requesting an objective! PLAYER_REPORTIN_SL_specops Specops requesting an objective! PLAYER_REPORTIN_SL_assault Assault rifleman requesting an objective! PLAYER_REPORTIN_SL_sniper Sniper, requesting an objective! PLAYER_REPORTIN_SL_antitank Anti-tank, requesting an objective! PLAYER_REPORTIN_SL_support Heavy support requesting an objective! PLAYER_REPORTIN_SL_support Heavy support requesting an objective! PLAYER_REPORTINVEHICLE_SL_tankI'm in a tank, requesting an objective! PLAYER_REPORTINVEHICLE_SL_fighterFighterpilot, requesting an objective! PLAYER_REPORTINVEHICLE_SL_bomberBomberpilot, requesting a target! PLAYER_REPORTINVEHICLE_SL_attackheliAttackhelo, requesting a target! PLAYER_REPORTINVEHICLE_SL_transportheliTransport helo, requesting an objective! PLAYER_REPORTINVEHICLE_SL_apc APC, requesting an objective! PLAYER_REPORTINVEHICLE_SL_jeepIn a jeep, requesting an objective! PLAYER_REPORTINVEHICLE_SL_antiairAA-vehicle, requesting an objective! PLAYER_REPORTIN_TM_engineer Grease Monkey here, anything broken? PLAYER_REPORTIN_TM_medic I'm a Medic, where do you want me? PLAYER_REPORTIN_TM_specops Specops requesting a target! PLAYER_REPORTIN_TM_assault Assault, requesting an objective! PLAYER_REPORTIN_TM_sniper Sniper, requesting an objective! PLAYER_REPORTIN_TM_antitank Anti-tank, requesting an objective! PLAYER_REPORTIN_TM_support Machinegunner requesting an objective! PLAYER_REPORTINVEHICLE_TM_tankI'm in a tank, requesting an objective! PLAYER_REPORTINVEHICLE_TM_fighterJet fighter, fangs out! PLAYER_REPORTINVEHICLE_TM_bomberJet bomber, requesting a target! PLAYER_REPORTINVEHICLE_TM_attackheliAttackhelo, requesting a target! PLAYER_REPORTINVEHICLE_TM_transportheliTransport helo, requesting an objective! PLAYER_REPORTINVEHICLE_TM_apc APC, requesting an objective! PLAYER_REPORTINVEHICLE_TM_jeepIn a jeep, requesting an objective! PLAYER_REPORTINVEHICLE_TM_antiairAA-vehicle, requesting an objective! PLAYER_REPORTIN_C_engineer I'm an engineer. PLAYER_REPORTIN_C_medic I'm a Medic PLAYER_REPORTIN_C_specops I'm Specops PLAYER_REPORTIN_C_assault I'm Assault PLAYER_REPORTIN_C_sniper I'm a sniper PLAYER_REPORTIN_C_antitank I'm anti-tank PLAYER_REPORTIN_C_support I'm a machinegunner PLAYER_REPORTINVEHICLE_C_tank I'm in a tank PLAYER_REPORTINVEHICLE_C_fighterI'm a fighterpilot PLAYER_REPORTINVEHICLE_C_bomberI'm a bomberpilot PLAYER_REPORTINVEHICLE_C_attackheliI'm in an attack helo PLAYER_REPORTINVEHICLE_C_transportheliI'm in a transport helo PLAYER_REPORTINVEHICLE_C_apc I'm in an APC PLAYER_REPORTINVEHICLE_C_jeep I'm in a jeep PLAYER_REPORTINVEHICLE_C_antiairI'm in a AA-vehicle PLAYER_REPORTINVEHICLE_C_bombshelterI'm in the hole
5.2 FAQ - Frequently Asked Questions
Originally posted by KilledBy#WEAPON#
Originally posted by TheyreWatchingYou
Originally posted by SuperShowOff
Originally posted by ICantFollowDirections
Originally posted by SuperNoob55
This guide was created and written completely by Elad Shahar (aka "SaladFork"). You may not redistribute any part of this guide without my consent. Claiming any part of this guide as your own is strictly prohibited.
This guide was written solely for TotalBF2. BF2RankedServers and TacticalGamer. If you wish to post this guide on your website and/or forums, you do not have to ask for my permission, but please either (a) quote this post, including my username, or (b) link to this thread.
The guide was created on November 30th, 2005.
I take no responsibility for any mistakes featured throughout this guide. If any of my data is faulty, I am sorry, and I would appreciate it if you pointed it out in a generous manner so that I may fix it.
Please note that the very original idea of this topic belonged to elmerfudd. Thanks!
Not including this italicized text, this is 3,904 words long, and contains 22,957 characters.