No announcement yet.

Having Fun with the Localization Files (v1.12)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Having Fun with the Localization Files (v1.12)

    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).

    4.1 Introduction
    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#
    (ignore the §0 and §1 codes. Just try and make sure that if it's in the original value, it would be safe to make sure it's in the new value.
    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:
    Team damage! (§C1001-2§C1001 penalty)
    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.
    4.7 Control Point Status Messages
    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_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_jeep I'm in a jeep
    PLAYER_REPORTINVEHICLE_C_antiairI'm in a AA-vehicle
    PLAYER_REPORTINVEHICLE_C_bombshelterI'm in the hole
    If you're ever bored and need something to do, looking through this file could prove quite interesting in the end!

    5.2 FAQ - Frequently Asked Questions
    Originally posted by KilledBy#WEAPON#
    I tried to change XXXX so that it included the variable XXXX, but when I tested it out in-game, it said the variable name, instead of replacing it with the value! What did I do wrong?
    When the localization file is called and a line is read, only the information needed is given to that. For example, the variable that contains the "You have killed" message does not know the value of the #WEAPON# variable. Unfortunately, that does sort of limit how creative you can be. However, there are some variables that may be passed through that you are unaware of! The only way to find out is to try it out and see what happens.
    Originally posted by TheyreWatchingYou
    I would love to follow your guide and make the changes in my localization file, but I'm afraid that PunkBuster will punish me for it. By changing the localization files, could I get in trouble with PunkBuster?
    This is a common fear. But I assure you that you have nothing to worry about. PunkBuster ignores the .utxt files found in the Localization folder. If it were to scan them, it would have to make to scan each and every language. Not to mention that these could be changed with any patch, a new language would be added, or a language may have changed. Long story short, no, you will not be punished or kicked, or anything of the sort.
    Originally posted by SuperShowOff
    Wow! I can't wait to go online and show off all my cool little text thingies in public game!
    Even if you modify the scoreboards, little text messages, and those sort of things, remember that they are CLIENT-SIDE ONLY. Everyone else will see it as their localization files tell them to see it. Too bad!
    Originally posted by ICantFollowDirections
    I followed your guide and copied it exactly as you had it, but it's not showing correctly on my BF2! Help!
    Make sure that you read this guide carefully. Chances are you removed one of those boxes from either the beginning or the end of a value, and messed up the string termination, thus causing problems.
    Originally posted by SuperNoob55
    Omg, will this ban me from punkbuster?
    Please make sure to read the thread in its entirety, along with this FAQ before replying to this post. If you reply to this post with a question that's already been answered, I get to point and laugh at you. Muahahahahaha.

    5.3 Disclaimer
    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.

    Last edited by SaladFork; 11-30-2005, 08:42 PM.

    |TG-9th| By Any Means!

    - [ Creator of the Battlefield 2 Localization Files ] -
    - [ Creator of the Battlefield 2142 Localization Files ] -

  • #2
    Re: Having Fun with the Localization Files (v1.12)

    Good lord. Very thorough treatment of the subject, salad. Nice job. +rep

    I really like the idea of having a 'plain language' description of what I was just killed by. Especially for Special Forces with all the new weapons (e.g. SCAR-L and SCAR-H).


    • #3
      Re: Having Fun with the Localization Files (v1.12)

      That enemy wheelbarrow is intriguing indeed. In a moment of total boredom, I once checked all the voiceover samples in the file, and noticed that the "Enemy wheelbarrow spotted!" voices are actually there (in all languages, even). Has anyone ever been able to accomplish the monumental task of spotting said enemy wheelbarrow on radio?

      Excellent guide, btw.
      <insert signature spam here>


      • #4
        Re: Having Fun with the Localization Files (v1.12)

        Originally posted by SaladFork
        I have not tested changing the common 'Go, Go, Go!', 'I need repairs!', and messages of that sort, and seeing if it would say them differently in game to others as well.
        It won't. Client-Side only, remember. Everyone has their own copy of the localization files, so it would have to be downloaded by the server, which is currently(and hopefully forever) impossible. I could see this permanent patch to the localization files: "GO LAWL I CHANGED UR MESSAGES!!!" in substitution for "Go, go, go!"
        |TG| aschmack


        • #5
          Re: Having Fun with the Localization Files (v1.12)

          Tried this and got kicked, message was about "We only allow unmodified content"

          And I forgot to backup the file

          EDIT - MY BAD, I opened it in a editor that I had been using for UNIX files so it saved as that and not DOS.


          • #6
            Re: Having Fun with the Localization Files (v1.12)

            Excellent post.

            3) Support game play in a near-simulation environment. Where the focus of play would not be solely on doing what it takes to win, but doing so utilizing real-world combat strategy and tactics rather than leveraging exploits provided to players by the design of the game engine.


            • #7
              Re: Having Fun with the Localization Files (v1.12)

              For those curious about some of the other things you can change, here are two more screenies:

              All images (other than the first one in the tutorial) taken on ranked bf2 servers.


              |TG-9th| By Any Means!

              - [ Creator of the Battlefield 2 Localization Files ] -
              - [ Creator of the Battlefield 2142 Localization Files ] -


              • #8
                Re: Having Fun with the Localization Files (v1.12)

                Originally posted by Tempus
                Excellent post.
                What the all mighty Tempus said.

                18th SF Operational Detachment Delta


                • #9
                  Re: Having Fun with the Localization Files (v1.12)

                  If any of you guys come up with something original, I'd love to see some screenshots of it, =D


                  |TG-9th| By Any Means!

                  - [ Creator of the Battlefield 2 Localization Files ] -
                  - [ Creator of the Battlefield 2142 Localization Files ] -


                  • #10
                    Re: Having Fun with the Localization Files (v1.12)

                    Awesome post Saladfork... An admin should sticky this.



                    • #11
                      Re: Having Fun with the Localization Files (v1.12)

                      wow, very informative and comprehensive (even a stoner understands it, see? :p) guide, cant wait to try that out when i get home
                      i tend to miss some msgs (like tk's when i run somebody over w/out noticing, and then get punished coz i didnt appologize :( )

                      is there any way to influence the color the messages appear in?

                      id give you +rep, if i knew how :D :D

                      edit: HA i figured it out, im so proud of myself

                      +rep :D


                      • #12
                        Re: Having Fun with the Localization Files (v1.12)

                        Nice guide. +rep.

                        Linkage duly made over on the -=[dMw]=- forum.


                        • #13
                          Re: Having Fun with the Localization Files (v1.12)

                          By popular request...

                          Download MY editted ENGLISH localization file (440kb) from:

                          (I would edit it into my original posts, but the timeframe for edit has passed. If one of the mods wouldn't mind...)


                          |TG-9th| By Any Means!

                          - [ Creator of the Battlefield 2 Localization Files ] -
                          - [ Creator of the Battlefield 2142 Localization Files ] -


                          • #14
                            Re: Having Fun with the Localization Files (v1.12)

                            :icon14: thanks salad!

                            Originally posted by vBulletin Message
                            You must spread some Reputation around before giving it to SaladFork again.


                            • #15
                              Re: Having Fun with the Localization Files (v1.12)

                              Some screenshots of what others have managed to do with this tutorial:

                              Credit: Signa, from TotalBF2

                              Credit: RingMasTeR, from TotalBF2

                              Credit: wolfi, from TotalBF2


                              |TG-9th| By Any Means!

                              - [ Creator of the Battlefield 2 Localization Files ] -
                              - [ Creator of the Battlefield 2142 Localization Files ] -




                              TeamSpeak 3 Server




                              Twitter Feed