Localization guidance

Started by SPS-barbarossa, February 24, 2026, 10:44:57 AM

Previous topic - Next topic
I have successfully added new weapons and classes to the game. Over the last 2 weeks I have been trying to figure out localization. I had little success finding info that showed me how to get it to work.

From the tutorials in understood that after creating a new project in BFbuilder, the localization can be done using the "Localize <modname>" button. This does open the multilanguage tool for me. Is it correct that initially there exist only the "level" and "weapons" scopes? And that the "weapons" scope only contains "snw" and "ewk" scopes? Is this correct or should it also be showing the scopes of the shipped sides in there?

Also, in what folder can the munged localization file be found? Or are they munged into the SIDE LVLs?

So BFBuilder only contains localization for addons, not the main game - these are contained the main game's core.lvl.  Mod maps you can add new scopes to be able to correctly localize using BFBuilder with no real changes.  If you want to overwrite the main game's core.lvl, you'll need something like this:
https://www.swbfgamers.com/index.php?action=downloads;sa=view;down=307 (Battlebelk Core.lvl Tool)

There is an alternative method which is kinda cool that was just discovered recently where you can create an addon core.lvl like you would for a mod, and then in your mission file you can insert something like this above your function ScriptInit call:
function ScriptPreInit()
    ReadDataFile("NEW\\coreaddition.lvl")
end

This would be most appropriate if:
  • You're trying to overwrite data in the stock core.lvl but want to keep most of it
  • You're not doing a traditional mod map
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Cool, so if I understand correctly I could do the localization in BFBuilder and then copy the files over to Battlebek's tool and have it combined into a new core.lvl for the game?

Regarding the new alternative method: I can write "ReadDataFile("NEW\\coreaddition.lvl")" line after "ReadDataFile("sound\\tat.lvl;tat1gcw");" and it will overwrite the games stock localisation? Assuming I made a folder inside _LVL_PC that is called "NEW" and contains coreaddition.lvl?

This alternative method would also allow me to load the core.LVL generated by BFBuilder without involving Battlebek's tool?

Correct, Battlebelk's tool will make a new replacement core.lvl for the entire game.

The correct place to put it is at the very top of the file, before ScriptInit, in a new function called "ScriptPreInit".  ScriptPreInit is a special function that was known about in BF2 but after some digging through the binary, it was determined that ScriptPreInit is also a valid function that is designed to be loaded before the main game files.  So what happens is ScriptPreInit is in your mission, it loads, and that coreaddition.lvl is loaded first.  The game then goes and loads all the normal stuff it uses (core/common/etc).  The base game behavior is that if an exact localization entry is found, just skip over it.  So normally you would not be able to overwrite the main game's core.lvl since it loads first.  PreInit can get you in before that and allow you to make "Rebel Soldier" into "Rebel Scum" using a much smaller addon file than replacing the main core.lvl.

Back to the question, yes, the way I have it structured is that it would go in the "NEW" folder in _LVL_PC, that is correct.

Finally, yep, you can just use BFBuilder's localization tools and the core.lvl generated from that to put in this "NEW" folder.

Let me know if you have any more questions
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Alright, then I am going to start tinkering with that. I will report back if there are more questions, until then, thanks for the support!