Localization Questions

Started by SlipShot762, February 12, 2014, 04:45:10 PM

Previous topic - Next topic
Well I've gotten everything I wanted in my personal home lan mod to work, largely thanks to the efforts of all of you folks and the people at gametoast, in that your works and understanding are available to view on the various message boards, and I thank you.

The last step for me is to localize everything, and about that, I am wondering:

Is there an easy way to generate a core.lvl file with my localizations for a side replacement mod like this?

I've done my editlocalize. bat and munged, but the generated core.lvl file crashes the game on launch, at present I'm using the shipped core.lvl file and everything works fine but there is no localization.

I have 2 ideas here, one is to figure out a way to use battlebeks core.lvl tool (i think it's battlebeks anyway) I DL'd from this site (folder structure and exactly which files to use escapes me as the tool is for BF1); the other is hex editing.

So, I ask, is there a simple way to generate the core.lvl for a sides replacement mod like this, perhaps with the core.lvl tool, or do I have to hex?

And, if I must hex, am I restricted to renaming things the same number of character or less just as if I was hexing pistols into rifles?

Thanks in advance for any forthcoming enlightenment...

There are a couple of localization tools out there--no need to hex edit.

Here is a link to Sleepkillers, it is an advanced version of BB's

http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=364

I hope that helps!   :cheers:
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

Quote from: Buckler on February 12, 2014, 05:52:24 PM
There are a couple of localization tools out there--no need to hex edit.

Here is a link to Sleepkillers, it is an advanced version of BB's

http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=364

I hope that helps!   :cheers:
Wait, does that thing even work? I made it when I knew hardly anything about SWBF's internal workings. I've thought for a while it didn't.

Anyway, from what I know of SWBFII you can load up additional localization files and the game just merges them all together in memory. So what you want to do is relatively simple to accomplish. I'll try to write up how to do it tonight for you. (Assuming I don't get distracted by the very important business of TF2... Again.)

Oh, sorry, I didnt notice this was in the SWBF2 section  :blush:
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

Right the simplest way to do this in my mind would be to create a random map using the modtools, doesn't matter what the name is that isn't important. Localize everything you want to in this map folder. Once you've done that go into the Addme folder inside the map project folder. In there open up Addme.lua and get rid of all but the two lines at the bottom.

--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
   for i, mission in missionList do
      if mission.mapluafile == mapName then
         for flag, value in pairs(newFlags) do
            mission[flag] = value
         end
      end
   end
end




--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "***%s_%s", era_g = 1, mode_con_g = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier.  the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("***","***g_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys --Keep these lines
ReadDataFile("..\\..\\addon\\***\\data\\_LVL_PC\\core.lvl") --


Change that line into this and then save the file.

ReadDataFile("core2.lvl")

Now munge the project folder we created earlier. Then go back into the addme folder, this time however go into the munged folder inside it, select the file and press Ctrl and X to cut it. Now open up a new window and navigate to your SWBFII base directory. (It should have BattlefrontII.exe in it.) In here go into your Addon folder, once there create a new folder and call it any old three letters. Then go into the new folder and press Ctrl and V. Go back up to your SWBFII base directory then into Data/_LVL_PC. Switch back to the other window now and go into the _LVL_PC folder in the map project folder we created. In here rename core.lvl to core2.lvl, then cut it and go back into the other window. (The one with the games _LVL_PC open) and paste.

Start up the game and see if it worked now. If all went to plan the game should now be opening up core2.lvl and loading it's localization files. If you need any more help let me know.

Thank you so much!!   :D

I will give this a try....I'm taking this opportunity to deconstruct, refine, and recompile the whole project and will use your help as outlined here as a final step.

Again, thank you so much!!

This time around I'm going to try and remove the glow from mines too, something I failed at previously, and to spread out the class variation by map and gamemode rather than making everything available on every map.

(also must restore 3rd person view in AT/AT's and the ability for snipers to straffe while zoomed, something that working from the base of BFX assets had cause the loss of.

I'll let you know if it works....

Sadly, that didn't work, yet, I'm going to try it again after I make a few changes, if that doesn't work, I'll return to pester you some more :P

And I'm back to pester you some more :P

Well, that did not exactly work, and I've tried messing around with bamdur and battlebeks tools to no avail....

If anyone has an answer for this I'd be grateful to hear it.

Gonna try the general process again with some changes, see what I get...

February 27, 2014, 09:16:12 PM #8 Last Edit: February 28, 2014, 12:49:49 AM by -RepublicCommando-
Edit- Just realized this was SWBFII issue.. Darn it, all that writing for nothing.
I hear there is a munge fix for Vista and Windows seven with the BFII mod tools, maybe that will help? (it makes lots of changes to the munge batch files..)

Well, simply localizing and then pasting the core.lvl from the modtools project folder results in a crash, it is a stock-sides replacement mod if that matters.

Now following sleeperkiller's instructions i did make a separate project folder and localize in there, then got the bright idea to add the read data line to the mission lua for coruscant, which seemed to result in changing the weapon info in game into japanese but properly naming the clone assassin at least.

I'm still fiddling around with it at the moment.