SWBFII Map Conversion Tutorial[WIP]

Started by SleepKiller, January 28, 2012, 11:07:11 PM

Previous topic - Next topic
January 28, 2012, 11:07:11 PM Last Edit: May 15, 2012, 03:05:54 PM by SleepKiller
Old outdated and porting SWBF2 maps in an unpredictable process. Kept here for archive purposes.
[spoiler]Okay, I'm going to start writing a Tutorial on how to convert SWBFII maps. This won't be complete for a few days probably. The sections will be put into spoilers so you keep your focus on the section your in. In some sections you'll see *** this is a place holder for the name of the world you want to convert.

Tools you need.
NotePad++ http://notepad-plus-plus.org/
xvi32 http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm
SWBF1 and 2 Modtools
SWBF2 Terrain Munger http://www.swbfgamers.com/index.php?topic=4130.0
Common Sense http://en.wikipedia.org/wiki/Common_sense
Paint.Net http://www.getpaint.net/

Things preferred.
SleepKiller Logic (Not required but it is advised you have this.)

Step 1. Convert the terrain.
[spoiler]This part is really easy. For starters decide what world you want to convert. Once you know this go into its assets folder in your copy of SWBFII Modtools. Select ***.ter press Ctrl + C leave this folder and navigate to where you extracted SWBFIITerrianMunger go into this and enter the folder terrain. Press Ctrl + V. Go back up into SWBFIITerrianMunger. Double click on Munge.

Okay Now leave this Window open, open a new one by clicking on My Computer in your start menu. Navigate to your BFBuilder folder. Open BFBuilder or BFBuilder Pro. Create a new projected called the world ID of the map your converting. I.e dag1, cor1. Now go into the newly created folder and go to the Worlds folder inside it you'll see a folder call *** enter this folder. Leave this Window up!

Go into a new Window now go to the same place we went to grab our terrain except go 1 folder level above this you should see these 5 folders

ODF
MSH
Munged
Effects
World1

Select all these and press Ctrl + C. (Now close this window.) Go back into the other window we recently minimized (Not the terrain one!) and press Ctrl + V. Great, now leave this Window open again. Make a new one and navigate to where you put XVi32 now open XVi32 (Close this Window now.) . Go back into the Window where we just copied the world data. Enter the World1 folder find ***.ter drag this file onto XVi32's Window it should open it up and look like this.

Now follow the instructions in this image.(Click on it to gain a better image.)

You should now have a file that looks like this, if so save and exit.

Okay now go back up to the folder that contains

ODF
MSH
Munged
Effects
World1

Once their go into Munged. Then go back to the Window we abandoned called SWBFIITerrianMunger go into the Munged folder in this one as well. Select ***.terrain and press Ctrl + C. Exit the Window. Now we should only have one Window still up, press Ctrl + V in this Window. Go back up into your projects base directory (This should have the Zero Editor EXE in. If it doesn't your in the wrong place!)

Okay now go into _BUILd_PC/Worlds/ from their Left Click on munge_world.bat and hit Edit With Notepad++

This may and probably will look like mumbo jumbo never fear! All you have to do is find this line
terrainmunge -sourcedir ..\..\..\Worlds\%1 -platformdir ..\..\..\_source_pc\Worlds\%1 -platform pc -inputfile !*.ter -outputdir munged\ -checkdate -continue
One you have found it simply type REM in front of it.
It should now look like this.
REM terrainmunge -sourcedir ..\..\..\Worlds\%1 -platformdir ..\..\..\_source_pc\Worlds\%1 -platform pc -inputfile !*.ter -outputdir munged\ -checkdate -continue

Congratulations you have just completed Step 1. It is not ready for munging yet, so don't try it!
[/spoiler]

Step 2. Make it Usable
[spoiler]Now if you where to munge this right now you'd get a crashing game. So we've got to hammer it into a state that isn;t going to crash. This part is simple and very important! First off Assuming we still have our World folder Window still up. In case you haven't caught on yet it is the one with

ODF
MSH
Munged
Effects
World1

in it.

Now go into World1, you'll see a lot of files here and which ones there are will vary World to World. But simply put we only need to worry about a few of these ;) Any file with a .lyr and .wld extension you need to open up in the same manor we did with the .bat file. And find this line in all of them. (The line does vary World To World Layer To Layer. But here is the basic format.
LightName("***.LGT");
Select and press back space over this line then save the file. Repeat this process for each of the .lyr and .wld files.

Now close Notepad++ and once your looking at the mass of world data files again. Go back up to your base project directory (The one with the Zero Editor Application in.) . Right click on config.ini (You won't see the .ini.) and click on Properties. Here is another picture follow the instructions in it. (Note depending on your OS the screen may look different. But the boxes will still be there.)

Once you've unchecked the box, hit Ok. (Note I'm not sure if this is essential on all Windows versions.
Now go and open config.ini in Notepad++
Look at the top four lines
startWindowed = 1
windowWidth = 1024
SkipLA = 1
windowHeight = 768

Change to your Monitors resolution if you want. Now got to the bottom of the file. And put this line there.
FlipModelX = 1
Save the file.

Now lets try opening this thing in ZeroEdit open up ZeroEdit it'll probably shoot you to the directory of the world you last opened with ZeroEdit, please go back up to your BFBuilder directory and from there into your project folder. Once there go to Worlds/***/World1 open up ***.wld. You may get some errors complaining about missing ODFs, ignore them we are about to remedy that very thing.

Now in this picture you'll see the magic red text pointing you towards a button. Press it.

Now you see the magical red text showing you the button to delete layers. Delete every layer that has the word sound in it. And delete every layer that is Called 1flag, TDM, Hunt, CTF, Campaign. (I think that is all of them.)
Now save the world. And exit Zero Edit.

Wow we're almost ready to munge! Exciting. There is one more thing in this step to do though.

Open up Notepad++ through the Start Menu or Edit With NotePad++. The point is open it.
In these pictures your going to move your mouse where I move my mouse okay?

Click here now.

Fill out this information form.

In Find What put tur_bldg_laser In Replace With put com_weap_gunturret Cool now this part is very important! Minimize NotePad++ Go back to the World directory the one where we can find

ODF
MSH
Munged
Effects
World1
Now see this picture

You notice the address bar just below the top of the Window double click on this in your Window and press Ctrl+C.
Go back to NotePad++ and double click in the Directory field in the form and press Ctrl+V. Now press Replace In Files.

Now that is the end of Step 2. You should now be able to munge and test it out in-game. (It may crash which is why Step.3 is on debugging it.) BTW, sorry bout the NotePad++ images being Thumbnails don't know what happened :(
[/spoiler]

Step 3. Debugging
[spoiler]If it didn't crash that is great! But you still have to read this step. Now in this part I can't offer much guidance on how to fix the errors since I don't know what you'll get. But I can give basic instructions to the concept. First off, we're going to go into the Assets folder of our BFBuilder folder in here you'll see an EXE call SPTest click on it and press Ctrl + C. Now go to where SWBF Is installed C:\Program Files (x86)\LucasArts\Star Wars Battlefront\GameData for 64-Bit users and C:\Program Files\LucasArts\Star Wars Battlefront\GameData for 32-Bit users. Once there press Ctrl + V. Now SPtest is installed and ready to do the hard work of debugging for you! Now open SPTest you'll see it runs just like the normal game but with no Multiplayer and a half the screen is green. Simply run your map in this and it'll produce a file called BFront.log it'll just appear as a text file though with no extension. (If your on Windows 7 it'll drop into Compatibility Files just go into them to retrieve it.)

Now you'll see a bunch of errors in the document. Most likely saying CP* is not localized for the stats page. Bla, bla, bla. Now anyones complaining about missing localizations/movies you can ignore. Now I'm going to have to let you figure out how to solve them since I don;t know every single error off the top of my head 9 do know how to solve most of them though.) So if your Unsure of what an error is and how to solve it. Post here with your BFront.log and I'll help you solve and add it to a list of errors and how to fix them.

Dealing dealing with missing ODF files - Sometimes you'll get an error saying that it can't find an ODF file for an object. This is simply fixed open NotePad++ and copy this into it.
[GameObjectClass]

ClassLabel = "prop"
GeometryName = ""


[Properties]

And save the file in your Worlds ODF directory as the name of the missing ODF.

As I think of more errors that sometimes pop up when converting a map. I'll post more explanations here on how to solve them.
[/spoiler]

Step 4. Fixing the collision.
[spoiler]Okay this bit is probably going to scare you a lot. But don't get discouraged now, if you successfully debugged the world and it is now running you are going good. This part is going to take you several Days to do (Depending on how much time you devote to it. When I was converting Tantive Iv I used invisible collision blocks I worked on it several hours each day for about a weak.) So don't get discouraged on some maps most of the Collision is OK and you have very little work for you to do yourself. But on others like Tantive 50% of the map is glitch filled and buggy. Don't fear unlike debugging I can give you loads of help and advice on this subject.

Okay first off let's say we're trying to convert the Jedi Temple right? So the collision blocks Pandemic has given us are way to big in most cases for the job. Don't panic! We're just going to make our own invisible collision. First step find a model in the stock assets that is right for the job. We need something that is thin for the walls and we need something that is tall and thin for the library pillars. (The stock invisible collision blocks do okay for the floor. In most cases.) Okay so I'm going to show you how to get that thin model for the walls. First off as I said find the model we want, nab2_prop_wall.msh happens to fulfilled this requirement nicely. Hm but we have a problem don't we.

Oh dear, what is this madness SleepKiller is talking! The model will show up and ruin the look of the map! Okay, okay hang in there for starters. Go into your BFBuilder directory from there go to Assets/Shipped Worlds/Naboo/MSH. Open a new Window and leave that last one up. So in the new Window go into your Projects base directory. (You should know by now but it is the one with Zero Editor in.) From there go Worlds/***/MSH. Go back into the old Window and find these two files

nab2_bldg_brick04.tga
nab2_bldg_brick04.tga.option

Select them and press Ctrl + C. Go into the other Window and press Ctrl + V. Now back into the other Window and find these to files

nab2_prop_wall.msh
nab2_prop_wall.msh.option

Once again press Ctrl + C on them and go into the other Window and press Ctrl + V again. Now select the four files we just copied over and press Ctrl + C on them. Go into the other Window and with it navigate to My Documents. Once there make a new folder called Collision Fixing, enter the newly made folder and press Ctrl + V. Okay on these four files we have in this window I want you to rename the nab in all of them to col. so they now look like

col2_prop_wall.msh
col2_prop_wall.msh.option
col2_bldg_brick04.tga
col2_bldg_brick04.tga.option

Excellent now open Paint.Net and go back into the window containing the files we just renamed. Drag col2_bldg_brick04.tga into the Paint.Net window it will ask you what you want to do with it open it. Now here is another follow my mouse picture series.












Now that we've done that exit Paint.Net leave the Window with

col2_prop_wall.msh
col2_prop_wall.msh.option
col2_bldg_brick04.tga
col2_bldg_brick04.tga.option

in up. Then open up XVi32 and drag col2_prop_wall.msh onto its window. Press Ctrl + F. In the Text String box type .tga. Now if you go up one line from where it sent you, you'll see 00 00 48 42 41 54 52 42 04 00 00 00 00
change this to 00 00 48 42 41 54 52 42 04 00 00 00 04. Now go to the very end of this line, click in the text view box now instead of the HEX View (The one that contains letters that make sense to you.) The last two letters you'll see on the line are na change these to co. Go down to the next line the first letter is b change this to l. Save the file now and exit Xvi32.

Now select the four files

col2_prop_wall.msh
col2_prop_wall.msh.option
col2_bldg_brick04.tga
col2_bldg_brick04.tga.option

And press Ctrl+X Find your way back to your projects World/***/MSH folder and press Ctrl + V. Cool, now go back up into ***. From there into ODF open any ODF with NotePad++ copy and paste this code into the ODF
[GameObjectClass]

ClassLabel = "prop"
GeometryName = "nab2_prop_wall.msh"


[Properties]

GeometryName = "col2_prop_wall"
FoleyFXGroup = "metal_foley"

Now save the ODF as com_inv_wall.odf (Go save it in Data***/Worlds/***/ODF/).

Okay I really can;t help you much with what comes next it is simple yet long work. Here is a basic outline of how to do it. We've made our special invisible collision for the World so we can place them in tight spots. See Appendix A for a list of invisible collision objects and where to find them.

I now presume you know roughly how to place objects in Zero Editor. If not go to your BFBuilder directory form there go into Documentation. And double click on Zeroedit read the web page that pops up through and through. (Sorry about not explaining this part more it is just a whole other thing completely.)

Now here is some tips to help make your Invisible Collision placing much more easy.


Now the process becomes test in-game. Find the spots with no collision, patch them up in the editor. Repeat it until your map is complete Be careful of placing too many objects though I'll be writing an Appendix on how to deal with this if you do. Until Step 5. !
[/spoiler]

Step 5. Fixing The Lighting. Not finished only just started, don't try reading it.
[spoiler]Now SWBF1 and SWBF2 have completely different lighting systems. This does not mean we can not convert the system into SWBF1's system. First off go into your World1 folder(You should be familiarized with it by now.) find ***.lgt and open it with NotePad++. Then find ***.sky also  open this with NotePad++. Close anything else you have in NotePad++ up. Leave NotePad++ up. Now open your Start Menu and go, All Programs/LucasArts/Star Wars Battlefront II/Mod tools/  and open Star Wars Battlefront II Mod Tools. It'll ask you to fill out some information regarding what you want to make your New World be just fill out the basic information. Conquest Gamemode some random stuff for the description and name. Create it.[/spoiler]

Appendix A
[spoiler]com_inv_col_8 - Data***/Common/ODF/
com_inv_col_16 - Data***/Common/ODF/
com_inv_col_32 - Data***/Common/ODF/
com_inv_col_64 - Data***/Common/ODF/
com_inv_wall -  Data***/Worlds/***/ODF/
[/spoiler]

Stand by for Step 5. :) What do you think of it so far? Is it understandable? Is it instructive? Please tell me.

Also if you find the Tutorial is not working for you let me know, the odds are I left out some curial piece of information. If I have I'll fix it A.S.A.P[/spoiler]

January 29, 2012, 01:11:15 AM #1 Last Edit: January 29, 2012, 08:35:57 PM by tirpider
I'm following so far. Really good.

I have 1 question, but I'll save it till class is over :)

-EDIT-

Ok, my question is regarding step one.

In the 2nd XVi32 screenshot, why are we removing the 'a' from that tga name? (fell_ter03_.tga)

Updated the tools you need be sure to grab the new one before diving into what has been started of Step 4.

PS. Could a Moderator or Admin move this topic into the appropriate forum?

hi SK,

I have moved the topic--as you would have noticed.

Can you recommend a SWBF2 map that's not too challenging to try this on?

I can work through your tutorial and note anything that I can't figure out.
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 January 29, 2012, 06:18:49 PM
hi SK,

I have moved the topic--as you would have noticed.

Can you recommend a SWBF2 map that's not too challenging to try this on?

I can work through your tutorial and note anything that I can't figure out.
Any map that is an open environment should be good. I'd recommend Kashyyk. However if you wanted to do one of the urban type maps I think the Jedi temple would be a good one.

When I was more ambitious, i wanted to try ZeroEditor and make a Kashyyyk map like the SWBF2 one :)

Is there a post somewhere that solves the issue on how to fix the lighting?

Quote from: tr1x on March 30, 2024, 04:48:29 PMIs there a post somewhere that solves the issue on how to fix the lighting?

Do not bump a topic, especially one that hasn't been active for 12 years. Please make a new thread.
In Progress:
--Phantom Menace Celebration Maps
--SWBFEA Demakes

Completed:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1