[Tutorial] Fully Localized 3rd Side (Non-Local)
Posted: Fri Jul 10, 2015 5:02 am
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:
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:
The name 'neu' is important, and here's why, from the Modtools documentation:
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:
Also inside the 'neu' scope, create two scopes:
). 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.:
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.
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;Hidden/Spoiler:
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.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.
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
Also inside the 'neu' scope, create two scopes:
- firstnames
- lastnames
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) 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.