How to make mission maps

Started by Radical_Pi, April 20, 2009, 02:10:27 PM

Previous topic - Next topic
That's more or less correct - I was planning on doing an advanced mission map tutorial about this but as with many of my projects lately, it's still incomplete.  I can explain to you the general idea though and why it is far cooler than a simple mission map (i.e. just loading in the assets of someone else's map).

- in a regular mission map you just load in a base map
- in an advanced mission map, you load in the base map but you also load in an "overlay" or "underlay" map which contains the extra map items you want to put onto the base map
- the overlay/underlay map is the same map, the name just refers to the order in which you load it relative to loading the base map. For example, if you load your map BEFORE the base map, I refer to it as an underlay map; if you load your map AFTER you've loaded the base map, I refer to this as an overlay map.  The distinction is important because the map that is loaded last by the SWBF1 engine will then have elements which are retained for the mission (like for example, the mini-map), overriding elements that were initially loaded (so hence the idea of "overlaying" on top of the previously-loaded map's assets).  For example, you load the base map last, so that you use the base map's mini-map.  But if you want to override the base map's normal mini-map and use your own mini-map which may be updated to include changes that you've made to the base map then you may want to load your map last (i.e. it is an overlay map)

- the key thing I realized a long time ago is that the LUA function, ReadDataFile(), is a generic function that looks at the data "type" in the header of the LVL and says "Okay, I'm reading in a map" and pipes all of the incoming data to some data structure for defining the world. For some reason, nobody ever realized that you can call this function twice (or more) on more than one map LVL and it will load in the additional map objects without purging any pre-existing world data already loaded.  In this way, I knew I could add new map objects (CPs, invisible collision blocks, vehicle spawners, etc) to a base map quite easily.
- that said, you cannot have more than one terrain (.ter) so the last-loaded map (either the base map, or overlay map) defines what that terrain will be.  If I recall, if the last-loaded map has no terrain associated with it, then I think the mission does then still use the terrain from the first loaded map.  Either that or it purges the whole thing and you have your units falling to their deaths due to the lack of any ground at all :)  I can't remember which, it's been 2 years since I experimented with it, so give it a try and remind me!
- the fact that you can load the assets from two (or more) maps into one world is FUN: in my very first experimental advanced mission map, I loaded both the Jedi Temple and Kamino into one world and the end result was a FLOODED Jedi Temple...  try it for yourself and be amazed!

- to create the overlay/underlay map, you start with a default map in ZE and just position your new map objects as though you were editing the base map (in most cases, you probably also want to delete the two CPs that are created by default).  This requires a bit of tedious guesswork since obviously you cannot load the base map into ZE to accurately position your new map objects.  However, to get accurate coordinates to use, what I do is run SPTEST and turn on the printplayercoords() so that as I run around, I can see the approximate x,y,z coords to use to put my objects at when I get back into ZE.  I also suggest you do a printscreen (which then gives you a pic of the location along with the x,y,z printed at the bottom of the pic).
- IMPORTANT: you need to use the negative of the Z-coordinate given to you by printplayercoords()... so if you see (100,25,52), then in ZE you must put your object at (100,25,-52) for it to show up.  Don't ask me why, but that's how it works and I just saved you a few days of headscratching by telling you guys that.

So that's the gist of it.  There are other quirks and perks that I will leave to you guys to discover... the main thing is that advanced mission maps give you the ability to "edit" a compiled map without having access to the original map project.  Obviously the most easy type of editing is that you can add new map elements to the base map, but I remember also figuring out a way to suppress (or "delete") something from a base map too - although I can't remember now how I did that, only that it was tedious (well, more tedious) to do.



Sweet! Thanks Nap, I never thought of doing that for a mission map..

December 25, 2010, 06:33:45 PM #17 Last Edit: March 27, 2011, 04:40:12 PM by Buckler
ReadDataFile("dc:..\\..\\..\\..\\Data\\_LVL_PC\\BES\\bes2.lvl")


is the command to load in a standard map

if you want to load a map from another mod map *that is already in addon* use
ReadDataFile("dc:..\\..\\..\\modidofmaptouse\\Data\\_LVL_PC\\modidofmaptouse\\modidofmaptouse.lvl")

if you want to load a side from another mod map *that is already in addon* use, for example, to read from
the mod map ewok01

ReadDataFile("dc:..\\..\\..\\ewok01\\Data\\_LVL_PC\\SIDE\\ewk.lvl",
        "all_end_music",
        "ewk_inf_basic")
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet