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

En tråd i 'Battlefield 2' startet av VeloViking, 29 Apr 2006.

Ble medlem:
20 Jul 2005
Innlegg:
1.164
Antall liker mottatt:
109
[SIZE= medium]SaladFork's Guide to Having Fun with the Localization Files
[/SIZE]

- 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

[SIZE= small]1.1 Introduction (Why would I want to do this?)[/SIZE]
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.

[SIZE= small]1.2 Required Applications[/SIZE]
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).

[SIZE= small]2.1 Variables - What are they?[/SIZE]
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.

[SIZE= small]2.2 Font Manipulators[/SIZE]
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 [SIZE= medium]BIG[/SIZE] 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.

[SIZE= small]3.1 Finding and opening the localization file[/SIZE]
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).
[SIZE= small]4.1 Introduction[/SIZE]
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).

[SIZE= small]4.2 The Teamkill Message[/SIZE]
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).
Code:
Kode:
[LEFT]Â§0#PLAYERNAME1# [Â§1Teamkills - #WEAPON#Â§0] #PLAYERNAME2#[/LEFT]

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

[SIZE= small]4.3 Penalty Messages[/SIZE]
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:
Code:
Kode:
[LEFT][B]For HUD_HUD_TEAM_DAMAGE_PLAYER:[/B]
Team damage! (Â§C1001-2Â§C1001 penalty)

[B]FOR HUD_HUD_TEAM_DAMAGE_VEHICLE:[/B]
Team vehicle damage! (Â§C1001-2Â§C1001 penalty)[/LEFT]

Screenshot:

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.

[SIZE= small]4.4 Point Bonus Messages[/SIZE]
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.
Code:
Kode:
[LEFT]You got a healing point! (Â§C1001+1Â§C1001 bonus)[/LEFT]


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.

[SIZE= small]4.5 Weapon Names[/SIZE]
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\\.

[SIZE= small]4.6 Award Messages[/SIZE]
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):
Code:
Kode:
[LEFT]You have received the Â§C1001#MEDAL#Â§C1001 armor badge.[/LEFT]

[SIZE= small]4.7 Control Point Status Messages[/SIZE]
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):
Code:
Kode:
[LEFT]Â§0Â§C1001#PLAYERNAME#Â§1Â§C1001 captured the Â§C1001#CPNAME#Â§C1001 control point[/LEFT]


[SIZE= small]5.1 Localization Treasure Hunt[/SIZE]
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:
Code:
Kode:
[LEFT]WEAPON_NAME_wrench            Wrench
WEAPON_NAME_laserpainter      Laser painter

HUD_HUD_ASSIST_KILL_TARGETING You got a targeting assist!
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_transmitTargetCoordinatesHold 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

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!

PLAYER_SPOTTED_C_enemywbspottedEnemy wheelbarrow spotted!
PLAYER_SPOTTED_SL_enemywbspottedEnemy wheelbarrow spotted!
PLAYER_SPOTTED_TM_enemywbspottedEnemy 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_tankI'm in a tank, requesting an objective!
PLAYER_REPORTINVEHICLE_SL_fighterFighterpilot, requesting an objective!
PLAYER_REPORTINVEHICLE_SL_bomberBomberpilot, requesting a target!
PLAYER_REPORTINVEHICLE_SL_attackheliAttackhelo, requesting a target!
PLAYER_REPORTINVEHICLE_SL_transportheliTransport helo, requesting an objective!
PLAYER_REPORTINVEHICLE_SL_apc APC, requesting an objective!
PLAYER_REPORTINVEHICLE_SL_jeepIn a jeep, requesting an objective!
PLAYER_REPORTINVEHICLE_SL_antiairAA-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_tankI'm in a tank, requesting an objective!
PLAYER_REPORTINVEHICLE_TM_fighterJet fighter, fangs out!
PLAYER_REPORTINVEHICLE_TM_bomberJet bomber, requesting a target!
PLAYER_REPORTINVEHICLE_TM_attackheliAttackhelo, requesting a target!
PLAYER_REPORTINVEHICLE_TM_transportheliTransport helo, requesting an objective!
PLAYER_REPORTINVEHICLE_TM_apc APC, requesting an objective!
PLAYER_REPORTINVEHICLE_TM_jeepIn a jeep, requesting an objective!
PLAYER_REPORTINVEHICLE_TM_antiairAA-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_fighterI'm a fighterpilot
PLAYER_REPORTINVEHICLE_C_bomberI'm a bomberpilot
PLAYER_REPORTINVEHICLE_C_attackheliI'm in an attack helo
PLAYER_REPORTINVEHICLE_C_transportheliI'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_antiairI'm in a AA-vehicle
PLAYER_REPORTINVEHICLE_C_bombshelterI'm in the hole[/LEFT]

If you're ever bored and need something to do, looking through this file could prove quite interesting in the end!

[SIZE= small]5.2 FAQ - Frequently Asked Questions[/SIZE]
Quote:
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.
Quote:
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.
Quote:
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!
Quote:
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.
Quote:
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.

[SIZE= small]5.3 Disclaimer[/SIZE]
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.

#############################################
The edited files by salad can be downloded here:
RapidShare.de
GamerNode.com
RealmCreators.com
#############################################

This is a guide from Tacticalgamer.com. Enjoy
[/html]

Ble medlem:
20 Jul 2005
Innlegg:
1.164
Antall liker mottatt:
109
I have found a set of the best looking modified utxt files there is out there...
This is how they look like:

../../e107_files/public/1146385051_1_FT280_screen061_.jpg