How to make mission maps

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

Previous topic - Next topic
April 20, 2009, 02:10:27 PM Last Edit: April 20, 2009, 03:41:33 PM by The_Pi
Alright, lets get going on the task of making mission maps in 7 Steps or less

Step 1: Create a New Map

Well, here's a simple task. Open up BFBuilder (Pro) and create a new map. Do the normal naming and era selection. Click Create and you're done

Step 2: Import Sides

First of all, if you are using a pre-existing mod, skip to step 4

Well, go through "BFBuilder Pro->Sides->Import Retail Side" then import whatever side you want to mod. Click OK then you are done

Step 3: Mod Away[/u]

Ask someone else how to do this. You shouldn't even be reading this if you don't know how to mod. shoo

Step 4: LUA editing[/u]

Now, this is the real important part of this guide. In your mod folder, go to Common\Scripts\*Mod Name here*. There is either 1 or 2 lua scripts in here, depending on what you selected in the first step. open up one of the LUA files in your favorite text editor. For simplicity, I'll use the simple modding route. In the BFBuilder folder, go to Assets\Mission LUA Samples\*Map you want to mission-ize*. In here will be a couple of LUA files. Ones with _h are the campaign scripts. If the name has a or i at the end, it's GCW. r or c is CW. Pick the script you want, copy the whole thing and put it in the other LUA file you should have open.

Now, go into the newly changed LUA file, and go down to the area where it says ReadDataFile("SIDE\\all.lvl", or something similar. Add dc: before the SIDE\\all.lvl so it ends up looking like ReadDataFile("dc:SIDE\\all.lvl", then repeat for the second command similar to that (should be directly below that one). Be sure to save the file!

Now, for the more technically-minded, the dc: prefix tells SWBF to start in the mod folder and not the core game file folder. This can be used on any ReadDataFile command. If you were to skip the copy part, you could go down to the Level Stats area and change the ReadDataFile there to not have dc:, making it use the original map. That line is what truly makes it a mission map, but the copy method changes it for us.

Congratulations, you're got the hardest part done!

Step 5: Munge

Do I really need to explain this?

Step 6: A little bit of LVL

This step only applies to those who are using a pre-existing mod

Now, from the BFBuilder folder, go to AddOn\*Your mod name*\Data\_lvl_pc and create a new folder called Side. Copy the mod lvls into that folder.

Step 7: Pre-Release Cleaning (Optional)

After you test your mission map a bit, and are ready to release it, here's a small thing to make the file a bit smaller. From the BFBuilder folder, go to AddOn\*Your mod name*\Data\_lvl_pc and delete everything from this folder except for core.lvl, mission.lvl, and the Side folder. Now you can compress and release the mod from the BFBuilder\AddOn folder!

Step 8: PLAY IT!!!!!!!!!

And you are now FINISHED!

Appendix:

To load another mod map (example being a few of Napseeker's maps), simply change the World ReadDataFile in the LUA to
QuoteReadDataFile("dc:../../MODID/Data/_LVL_PC/MODID/MODOID.lvl")
of course changing MODID to the id of the second mod. Make sure people know about this requirement when you distribute the map. -- ggctuk

Got additions to this guide? Post em here and I'll add them

Well, I guess this is goodbye. Feel free to post here with any questions you have.

Viruses are like the New York Lottery. "Hey, you never know"

nice one! Saved me some typing!

For anyone that didnt get it... the 'dc:' bit just tells the game to use the files in the map directory (*Mod Name here*\Data\_lvl_pc\Side) instead of the ones shipped with the game!

A definite sticky IMO.  Thanks for writing this up too - hopefully other people will take advantage of this tutorial and experiment with some new missions.  I want to add that this is actually a different approach from how I do my own mission maps but if it works, that's what matters.

I think people should actually post their questions to this thread so everyone can benefit from any explanations.  There are also still more interesting places you can go with mission maps beyond just side modding pre-existing maps, but it requires a lot more work and experimentation.

How to get one working with a mod map though... I believe, following the DC: suffix, it should go something like:

ReadDataFile("dc:../../MODID/Data/_LVL_PC/MODID/MODOID.lvl")
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)
--Endor: Imperial Base

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

yeah that should be right

Changed the last bit to say post here

Also Added an appendix for misc comments from others. I'll add them when I can. ggctuk got the first one.

Viruses are like the New York Lottery. "Hey, you never know"

Stick with a pin, Thanks Pi Man for posting this.
QuoteSow the wind and reap the whirlwind
Through the rain and through the shine
Only something with a meaning can stand the test of time

This is great. I'll give it a try when I've finished the sides mod.
There are a few custom maps that my sides won't work on, so this will solve that problem.
... I was majorly bummed when I discovered that I couldn't use the sides on Endor Confrontation.

Hiya guys,
Can someone tell me how to mission-ize a custom map?
Do I need the assets for that map? Or do I just work within the map itself. If so, how do I do it?
Thanks in advance!

If you're talking about AddOn map missionizing, look at the code near the bottom of my post. Just replace MODID with the name of the mod

Viruses are like the New York Lottery. "Hey, you never know"

Oh! I see.
Thanks Pi. :)

..Edited to add:

This doesn't work. This is not correct....
ReadDataFile("dc:../../MODID/Data/_LVL_PC/MODID/MODOID.lvl")

The slashes are backwards. And even when I change the slashes to the way they are supposed to be, ie.
ReadDataFile("dc:..\..\MODID\Data\_LVL_PC\MODID\MODOID.lvl")
It still doesn't work.

Can someone check and see exactly what it is supposed to read. Ive tried about ten possible variations. This should be easy.
I'm trying to missionize EC. So I would guess it should read, ReadDataFile("dc:..\..\EC\Data\_LVL_PC\EC\EC.lvl") ?
But that doesn't work either.
Total confusion at this point and it really should be simple.

Perhaps it's two slashes? IE dc:..\\..\\..\\corus1\\_lvl_pc\\corus1\\corus1.lvl ?

Edit: I was correct - it's two slashes. I got a mission map for the Death Star interior up and running.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)
--Endor: Imperial Base

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


So here's the code you use:

ReadDataFile("dc:..\\..\\..\\modID\\data\\_lvl_pc\\ModID\\ModID.lvl")
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)
--Endor: Imperial Base

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

I notice in some maps, Napseeker has added extra CPs, collision etc (take the Death Star EvE mission maps). It seems he loads two levels, one with the extra CPs and planning, the other being the original map.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)
--Endor: Imperial Base

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

I guess what he did is create a world that was just a layer file and load it into the game, which would make it work

Viruses are like the New York Lottery. "Hey, you never know"