[Tutorial] Fully Localized 3rd Side (Non-Local)

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

[Tutorial] Fully Localized 3rd Side (Non-Local)

Post by jedimoose32 »

If this has been posted somewhere else, or if it's already general knowledge, then I apologize. But I got really excited when I got this to work so I thought I'd share.

This will allow you to have a third side that is nicely localized with a real name, and randomized first/last names, same as the stock sides. I'm working on figuring out a way to extend this to a possible fourth side and beyond but it may not be possible.

Tired of seeing "Player killed Jawa" or "Civilian killed Player"? Do you want your local side to have proper names like Ben Pulastra or Rho 236? Then read on...

First, at the top of your map's .lua file, make sure you have a Team 3:

Code: Select all

	--  REP Attacking (attacker is always #1)
    REP = 1;
    CIS = 2;
    CIV = 3;
In your map's .lua file, scroll down to the part of function ScriptInit that says: " SetupTeams{ " and has all/imp or cis/rep laid out below (the part where you specify reinforcement count and unit classes). You may have noticed that this section (SetupTeams) always has two entries. A quick look at setup_teams.lua (not fully explained in this tutorial) shows that this does not have to be the case. So let's add a third one in underneath the two that are already there, using roughly the same format. Mine looks like this:
Hidden/Spoiler:
[code]
SetupTeams{
rep = {
team = REP,
units = 32,
reinforcements = -1,
soldier = { "rep_inf_ep3_rifleman",7, 25},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},
},
cis = {
team = CIS,
units = 32,
reinforcements = -1,
soldier = { "cis_inf_rifleman",7, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
}
neu = {
team = CIV,
units = 30,
reinforcements = -1,
soldier = { "civ_inf_civilian01",6, 8},
assault = { "civ_inf_civilian02",6,8},
engineer = { "civ_inf_civilian03",4,7},
sniper = { "civ_inf_civilian04",4,7},
},
}
[/code]
The name 'neu' is important, and here's why, from the Modtools documentation:
Battlefront2_scripting_system.doc wrote:The names “neutral”, “neu”, “alliance”, “all”, “empire”, “imp”, “republic”, “rep”, and “cis” map to pre-defined team identifiers; anything else maps to locals.
So basically the game will check the localization path common.sides.cis for the information on the 'cis'-named team in the table I showed above. Same goes for my custom 'neu' team setup. It'll search in common.sides.neu for the team's name and unit first/last names.

Notice that the side itself does not have to be called NEU or anything like that. Just the table entry needs to be called 'neu' so that the game is able to localize it (you'll notice my side name is actually CIV).

Anyway, next you need to run editlocalize.bat and go to common.sides. Create a new scope and name it 'neu' (without quotes, of course). Inside that scope, create the following keys:
  • name - value should be the name of the team, e.g. Aliens
  • name_m - can have the same value as 'name'
  • longname - value should be the full name of the team, e.g. Alien Hivemind
I believe the only one you really need is 'name' unless you're using this tutorial for a custom GC.
Also inside the 'neu' scope, create two scopes:
  • firstnames
  • lastnames
Inside either or both of these scopes you will put any number of keys named '01', '02', '03', etc. The value of each of these keys should be a first or last name (depending on whether you're editing in the 'firstnames' or 'lastname's scope :o ). If you populate the 'firstnames' scope but don't put any keys inside the 'lastnames' scope, then you will get something similar to the Republic names for your units, e.g. John 254 or Mr. 123. If you leave the 'firstnames' scope empty but put some key/values in 'lastnames' you'll get something like TK Smith, CT Jones, or JK Rowling.

The one last thing that you have to remember, which is borrowed from the standard Local sides procedure, is making sure you set the diplomacy of your third team. E.g.:

Code: Select all

	SetTeamAsFriend(1,3)
    SetTeamAsFriend(3,1)
    SetTeamAsEnemy(2,3)
    SetTeamAsEnemy(3,2)  
And that's it! Go munge Common and enjoy seeing all those beautiful, unique names flash across the corner of your screen as you mow down every last member of the third side you've just added!

I'll be doing some more research into this subject to see if I can rig the game to allow this process to apply to more than just the third side. :)
Post Reply