To get people goin on creating SP missions I figured a tutorial on how to override the original ones is in order.
It may look like alot of work, but it's really not that complicated. Took about a day before everything worked flawless the first time, when I had to figure it out, but after you've done it once and understand what you have done it's much easier. :wink:
How To Override An Original SP Mission
Intro and Preparations:
In this tutorial I'll use my own recently finished mission mod and show what I needed to do to get the override to work. Before starting this tutorial you should have completed your work in the world.xml and your scripted mission.xml which you placed in custom_levelswork"your mod"script folder. After that you should have exported it from the map editor, I used the OGR Coop exporter option. We need to do this to generate the new lightmaps, AI graph and some other files. You'll also need to have the quick.bundle extracted, and over that extract the patch.bundle (this so the patch replaces all files updated in it), this as we'll need to get some files from it and edit slightly and also use as reference. I'll refer to these file locations as if you extracted the bundles into localbundle, and removed the data folder step like said in other tutorials.
Override:
Ok, now you're ready to override. First you have to decide which mission to override. In my case it was simple, I used an original map to create my mission on so I override that map, in this case "mission05". But I could just as easily used any of the other missions as you can override all files anyhow.
Folders:
After that is decided we can create the folder structure. In the local folder I created my own sub-folder, which we can call "my_mod". In that we need as few different sub-folders depending on how the mission is built. But we'll always need the "levels", "strings" and "textures" folders. Inside the "levels" folder we need to create the folder for the mission to override, in this case "mission05", and inside that there should also be a folder called "xml". Inside the "textures" folder we need to create one called "lightmaps", and once again inside that one specfic for the mission we'll override, "mission05", and inside that and "atlas0" folder. Some missions also use and "atlas1" folder, in which case you'll need that as well.
We now have a folder structure that looks like this:
local -> my_mod -> levels -> mission05 -> xml
local -> my_mod -> strings
local -> my_mod -> textures -> lightmaps -> mission05 -> atlas0
Strings Files:
Now it's time to start placing/editing the files needed.
Into localmy_modstrings you should copy the menu.xml found in the localbundlestrings folder. This is only needed to edit the name of the mission in the selection menues. Open it in any text/xml editor, search for "campaign_mission" and you'll find the section that sets the name for all the missions. Replace the string inside the quotes with the name you want to use for your mission. I named mine "Titan Skull", which gives me this line efter the editing:
Levels Files:
Next we'll go into the localmy_modlevelsmission05 folder. Into this we'll have to pu thte new AI graph, mission xml and diesel, texture scope and materials files.
You'll find that when you exported you mission in the map editor, it created a new folder structure inside custom_levels. In this you'll find all the files it put into the bundle created in the export, but in folders. Great! Now lets look for what we need. First find custom_levelswork_temp1datalevelscustom_levels"your mod".
Inside you'll find the AI graph, texture scope, materials, as well as diesel and xml mission files. Copy all these into the localmy_modlevelsmission05 folder.
Now rename the diesel and mission xml files to that of the mission you want to override, in my case "mission05.diesel" and "mission05.xml". Then open the mission xml file in your text/xml editor. In the first lines you'll find a few "load_scene" tags. Those we'll have to edit a little. Opened the real mission05.xml file and copy all the "load_scene" tags with their contents and replce all "load_scene" tags in you exported file with that.
Save mission.xml and exit editor. Make a copy of your edited mission.xml file and rename the new file the same as the original but with "_ni" at the end, like "mission05_ni.xml". This file is used if the server uses the "skip insertion" option in Coop. If you have a long insertion in your mission I suggest you redo that part of the script in this file to allow people to skip it, otherwise just keep it the same as the normal mission.xml.
The texture_scope.xml may also need to be edited. But we don't know that until we have tested the map in-game. If there are props missing textures (shows up as yellow and blue squares), the texture_scope.xml is missing some entries. If you're using an original map to build your mission on, you should add all the entires found in the original texture_scope.xml into your (make sure ther are no double entries though), or there may be problems with the environment itself.
That should be it in this folder.
Next we'll go into the localmy_modlevelsmission05xml folder.
Into this we again have to put a few files from you exported folder. Copying everything from you custom_levelswork_temp1datalevelscustom_levels"your mod"xml folder.
Open up the world.xml in your text/xml editor and replace the level_name on line 2, with that of the mission you override, level_name="titan_skull" turns to level_name="mission05". Save and exit editor. Make a copy of the world.xml and, like we did with the mission.xml, add "_ni" to it's name, "world_ni.xml". Like with the mission.xml, a special world.xml is used when checking the "skip insertion" box in Coop mode.
Lightmaps Files:
Finally we'll have to copy the lightmaps to the correct location. Go into custom_levelswork_temp1datatexturescustom_levels"your mod"lightmapsatlas0 and copy the files found there in localmy_modtextureslightmapsmission05atlas0.
Open the tdb_atlas_set.xml in your text/xml editor and edit the name entry on the first line. It should be the location you copied the file to, in this case "lightmaps/mission05/atlas0". Save and exit.
If you have an "atlas1" folder, repeat the same procedure for that one, but from custom_levelswork_temp1datatexturescustom_levels"your mod"lightmapsatlas1 to localmy_modtextureslightmapsmission05atlas1 of course.
That should be it for your basic mission.
Extra:
Now, if your using a string.xml file to store your strings used for objectives and messages, just pur that in localmy_modstrings and rename it after the mission you override, in this case "mission05.xml".
I also had edited the group_manager.xml file to create a new hostile group type. That has to be included for the mission to work. It should be placed in a new folder we don't currently have. So in the localmy_mod folder, create a folder called "lib" with a sub-folder called "manager" and inside that one called "xml". Copy your edited group_manager.xml file there, localmy_modlibmanagersxml.
This is the final list of files that I have inside my mod folder, which overrides mission05 with my custom one.
localmy_modlevelsmission05ai.gph
localmy_modlevelsmission05materials.xml
localmy_modlevelsmission05mission05.diesel
localmy_modlevelsmission05mission05.xml
localmy_modlevelsmission05mission05_ni.xml
localmy_modlevelsmission05texture_scope.xml
localmy_modlevelsmission05xmlambient_cubes.bin
localmy_modlevelsmission05xmlmassunit.bin
localmy_modlevelsmission05xmlworld.xml
localmy_modlevelsmission05xmlworld_ni.xml
localmy_modlevelsmission05xmlzones.xml
localmy_modlibmanagersxmlgroup_manager.xml
localmy_modstringsmenu.xml
localmy_modstringsmission05.xml
localmy_modtextureslightmapsmission05atlas0tdb_atlas_set.xml
localmy_modtextureslightmapsmission05atlas0atlas.dds
Note:
If you edit the group_manager.xml, you'll have to place it in localenglishlibmanagersxml for it to work in the map editor. The same logics goes for all other xml files you edit to use in the map editor. Place them in a mirror folder to where you found them in the localbundle structure, but inside localenglish instead.