Tutorial: How to create a working side in SWBF2!

Started by SW_elite, October 08, 2010, 02:55:36 AM

Previous topic - Next topic
October 08, 2010, 02:55:36 AM Last Edit: October 08, 2010, 06:04:39 AM by Jedikiller
Ok for the purpose of this tutorial, I will assume you have a functioning map in SWBF2 already. If not, then get cracking.
Now some of you may want to just edit a shipped side, but in this tut I’ll be teaching how to make a completely new one. It works pretty much the same way, except with a shipped side, your doing a lot more little patch work. Making small additions to get stuff working, but if you know the whole process, then you’ll know all the little things that are needed.
And… uhm Its just the way I’m doing so thar.

First decide what you want your side to be called, traditionally, they are something with only 3 characters, like ALL, IMP, or CIS, but this doesn’t have to be, you can name your side anything, I know of no limits.
So lets say, your making this for a super duper stormie trooper, you could name you side SDST... I suddenly find that anacronim annoying, so I won’t use it, the example side name will be: PMS >.> What?

Ok, so make a folder in Data_ABC/Sides, and name it PMS (IE whatever your side name is)
And then inside it, make a: effects, odf, msh, req, and MUNGED folders
(note that the MUNGED folder doesn’t need to be in caps, it just typically is.)
So it now looks like this:



Now go get the assets for your unit.
(make sure you only copy the original assets, and not modify them.)
This means get the all the TGAs, MSHs, weapon ODFs, and the unit’s ODF, that you want/need.

All MSHs and TGAs go in your sides msh folder, ODFs in the odf folder, etc.

If the unit you are changing is a Jedi, look in his sides MUNGED folder, and find grab all the files with his name on it, there should be one .anims, one .zaabin, and one .zafbin, move these into your sides MUNGED folder

Lets take another trip to the assets.
Go to Assets/Sides, and copy the common side to your Data_ABC/Sides.
If the tur side is in your Data_ABC/Sides, you can delete that, unless you plan on having turrets in your map at some point.

Ok, now to make the .reqs which stands for Required Files, every unit, vehicle, or hero (and even a few other things) in a side needs one, and then, the side itself needs one.
They are text files, and really easy to set up.

Ok first your unit(s) req.
Go into your side’s req folder, and make a text file, you should name it whatever then name of your unit is. So if your unit is called pms_inf_supr_tropr You should call the req file pms_inf_supr_tropr.req. Now its handy to look at a shipped .req, so you go do that, I’ll wait.






Done? Its really quite simple.
I suggest you just copy the text out of a shipped req, and paste it into your own and change the text about the unit. If you don’t understand, then you didn’t look.



That is a unit req, just copy it, and change the unit name to yours, req names must match that of the unit’s odf.
Save your new .req file, and that’s done.
Hit back, and go to your sides main directory, you remember, this place:



And make another text file, this will be the side’s req, give it the same name as your side, so it would be (in my example) pms.req.
Again, let’s look at a shipped side req.
Here is the imperial one:



Cluttered looking isn’t it?
Basically, it just lists all the units, vehicles, and heroes etc
So copy one of the shipped side reqs into yours, and delete all the little units and such in quotes Except The “lvl” thing at the top of the list, then add your unit in so it looks like this:



And save it.
Your side should now be a bit more something like this:



Just 2 things left

Go to Data_ABC/_BUILD/Sides and make a new folder for your side, this is where, the half munged side bits will go on their glorious metamorphosis into a .lvl file.
(if you don’t know what metamorphosis is, perhaps you’re to young to mod)

So, make a folder named PMS, then go to one of the other side folders in there, Data_ABC/_BUILD/Sides/ALL for example, and find two files called clean.bat and munge.bat, paste a copy of those two .bat files, into Data_ABC/_BUILD/Sides/PMS.

Last step adding your unit to the lua script.

Go to Data_ABC/Common/scripts/ABC there should be a bunch of files here, .lua and .bak.

The baks are just luas with their file extension changed, and are “backups” of the default luas.
You can delete these, I do.

Now you need to find the lua you want. The unit we’re talking about is a soldier, so lets put him in conquest.
Lua names start with your map name ABC then either a c for CW era, or g for GCW era.
And then the mode
con = Conquest
eli = Hero Assault
ctf = Capture the Flag
1flag = 1 Flag Capture the Flag

So lets put him in the GCW era, so find your ABCg_con.lua and open it, it’s a notepad file.

First scroll down and find this part.



This area of the lua loads a unit’s data into the game for use.
Again, we’re just going to kinda copy and paste a shipped bit.
Take the imp section, copy all of it and paste it again, in that section, change the lvl name from imp.lvl to pms.lvl, and put a dc: in front of SIDE, but before the parentheses, this dc: tells the lua that it is loading a custom file.

(if you where editing a shipped side, you would need to add a dc: to it’s load section too.)

And delete all the listed units, except for the top one, and change the name to your unit’s.
And close it off with a )
It should look a bit like this:



Now if you where adding more units, you would have to add comma’s like so:



Ok, now scroll down to the unit line up.
This bit:



Now if you could replace one of the normal unit’s with yours, but I’ll teach you how to add a new one, incase you don’t want to replace anyone, and hurt a trooper's feelings.

Under the SetHeroClass part, add this:

AddUnitClass(IMP, "pms_inf_supr_troopr",1,4)

This will add your unit under the Imperial side’s line up.

So now you’ve got this:



Good? Good.


Now we munge.
Go to: Data_ABC/_Build and click Modtools VisualMunge.exe.
Check the common box, and select your side from the drop down Sides menu.



Munge and go play, you are done.

Sourced from Gametoast. Originally created by Caleb1117. http://www.gametoast.com/forums/viewtopic.php?f=27&t=12729