Tutorial: How to reduce file sizes in SWBF2!

Started by SW_elite, October 08, 2010, 02:59:04 AM

Previous topic - Next topic
October 08, 2010, 02:59:04 AM Last Edit: October 08, 2010, 06:06:24 AM by Jedikiller
I notice alot of maps with big huge 200mb sides with not much changed.
This should help you reduce that (if you understand it)

IF YOUR JUST EDITING SKINS (no odfs)

You going to make a 'skin side'. Make a new side and name it. In my example Im makeing 212nd legion skins, so ill call it "212nd". THen make a MSH and REQ folder in your side. In the msh folder, put all the skins you edited.

Next go to the REQ folder and make a new text file for each skin you edited. For example, if i edited the rep_inf_ep3trooper.tga id make a notepad file called "212_inf_ep3trooper" (it doesnt matter what you call it though). No open up the newly made file, and add the below.
Code:
ucft
{
      REQN
    {
     "texture"
     "skin name.tga"
    }
}

You might notice a snins req is different from a unit req
Another example is the clone sniper, which needs to parts in his req because he has 2 texures.
Code:
ucft
{
      REQN
    {
     "texture"
     "rep_inf_ep3sniper"
    }
       REQN
    {
     "texture"
     "rep_inf_ep3sniper_cape"
    }
}


Do this for each skin you edited.
Next open up the SIDE req file, in my case its called 212nd.req.
In it, add the names of all your req files. My req would look like this-
Code:
ucft
{
    REQN
    {
        "lvl"   
        "212_inf_ep3armoredpilot"
        "212_inf_ep3trooper"
        "212_inf_ep3_jettrooper"
        "212_inf_ep3_officer"       
        "212_inf_ep3_sniper"       
    }
}


Basically you've just made a 'skin' side. Lastly, to over-wright the shipped skins just load your skins in your maps LUA, just like you would units. But make sure you load the skins after all the other sides, or nothing is changed.
This is what is in my LUA.
Code:
   ReadDataFile("SIDE\\212nd.lvl",
                            "212_inf_ep3armoredpilot",
                            "212_inf_ep3_sniper",
                            "212_inf_ep3_officer",
                            "212_inf_ep3_jettrooper",
                            "212_inf_ep3trooper")





IF YOUR JUST EDITING ODFs

This was pointed out by another member. Basically you edit the shipped sides just as you normally would. After you do, add this line to any edited odf under [GameObjectClass]
Quote:
ClassParent = "name"


"name" being the original ODF. So if I edited the jet trooper ODF id put
Code:
ClassParent         = "rep_inf_ep3_jettrooper"

Just a note though, the edited ODFs name should be one other then the ClassParent = name. You can do this for weapons and vehicles too (unless im mistaken). Basically this gets rid of the need for msh's and tga's because the unit will get them from the class parent.
Then in your LUA load your side AND the side containing the Parent ODFs.

SO if i edited the jettrooper with this technique this is what LUA would look like.
Code:
    ReadDataFile("SIDE\\REP.lvl",
              "rep_inf_ep3_jettrooper")
    ReadDataFile("dc:SIDE\\REP.lvl",
              "new_inf_ep3_jettrooper")


A HINT on 1st person

In your custom sides you only need FPM of the weapons, unit and vehicle FPM is included the game data so you can delete it from your side.


Tutorial from GT. Originally by Syth. http://www.gametoast.com/forums/viewtopic.php?f=27&t=9593