Page 1 of 1

Mappack help

Posted: Wed May 09, 2012 9:42 pm
by ARCTroopaNate
I'm trying to add a map to an existing project, I have added it in the mission folder the mission.req, the addme and put it's scripts in my mods scripts folder. I have put the new maps world1 folder in my worlds folder and I have created a folder in _BUILD for it. I've munged and tried many things and it's still not working. This is my first time doing this so it could be an error on my part. If it's a stupid error I apologize in advance.

Re: Mappack help

Posted: Thu May 10, 2012 1:34 am
by AQT
So it seems you have all the necessary .lua files and their corresponding .req files in the correct directories. You are using a single addme.lua file as well as a single mission.req file for both of these maps, then?

As for the map's world files, you need to move the entire three-character I.D. folder containing msh, odf, world1, etc. folders from data_***\Worlds to the same location but in the other project folder, similar to how there can multiple sides in the data_***\Sides.
ARCTroopaNate wrote:I have created a folder in _BUILD for it.
This folder is called _BUILD\Worlds\***, and it contains the two necessary munge and clean batch files?

Re: Mappack help

Posted: Thu May 10, 2012 7:03 am
by ARCTroopaNate
Yes, I have done all of that and it still does not work, I've tried to clean and manual clean and it's still not working.

Re: Mappack help

Posted: Thu May 10, 2012 10:12 am
by THEWULFMAN
Please post your addme.lua.

Re: Mappack help

Posted: Thu May 10, 2012 4:19 pm
by ARCTroopaNate
addme
Hidden/Spoiler:
--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end


ReadDataFile("..\\..\\addon\\BFE\\data\\_LVL_PC\\shell.lvl")
ReadDataFile("..\\..\\addon\\BFE\\data\\_LVL_PC\\common.lvl")
--insert totally new maps here:
sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "CHG%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

AddNewGameModes(
sp_missionselect_listbox_contents,
"kam1%s_%s",
{
era_e = 1,
era_b = 1,
mode_con_e = 1,
mode_con_b = 1,
change = {
era_e = { name="BFE Clone Wars" , icon2="cw_icon" },
era_b = { name="BFE Galactic Civil War", icon2="gcw_icon" },},})

AddNewGameModes(
mp_missionselect_listbox_contents,
"kam1%s_%s",
{
era_e = 1,
era_b = 1,
mode_con_e = 1,
mode_con_b = 1,
change = {
era_e = { name="BFE Clone Wars" , icon2="cw_icon" },
era_b = { name="BFE Galactic Civil War", icon2="gcw_icon" },},})

AddNewGameModes(
sp_missionselect_listbox_contents,
"kas2%s_%s",
{
era_e = 1,
era_b = 1,
mode_con_e = 1,
mode_con_b = 1,
change = {
era_e = { name="BFE Clone Wars" , icon2="cw_icon" },
era_b = { name="BFE Galactic Civil War", icon2="gcw_icon" },},})

AddNewGameModes(
mp_missionselect_listbox_contents,
"kas2%s_%s",
{
era_e = 1,
era_b = 1,
mode_con_e = 1,
mode_con_b = 1,
change = {
era_e = { name="BFE Clone Wars" , icon2="cw_icon" },
era_b = { name="BFE Galactic Civil War", icon2="gcw_icon" },},})

-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("kam1","kam1b_con",4)
AddDownloadableContent("kam1","kam1e_con",4)
AddDownloadableContent("kas2","kas2b_con",4)
AddDownloadableContent("kas2","kas2e_con",4)
AddDownloadableContent("CHG","CHGc_con",4)
AddDownloadableContent("CHG","CHGg_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\BFE\\data\\_LVL_PC\\core.lvl")
ReadDataFile("..\\..\\addon\\BFE\\data\\_LVL_PC\\CHG\\CHG.lvl")

Re: Mappack help

Posted: Fri May 11, 2012 1:03 am
by AQT
The addme.lua looks about right.
ARCTroopaNate wrote:Yes, I have done all of that and it still does not work
What doesn't work exactly? Have you edited the individual mission .lua files so that they read the map .lvl/layer from the correct directory in your addon folder?

Re: Mappack help

Posted: Fri May 11, 2012 4:25 pm
by ARCTroopaNate
Isn't it correct by default?

ReadDataFile("dc:CHG\\CHG.lvl", "CHG_gcwconq")

Is what I have for one of them, you have to change them?

Re: Mappack help

Posted: Fri May 11, 2012 5:04 pm
by AQT
If all of the world .lvl files are located in the _LVL_PC\CHG folder, then yes, you will obviously need to change the directory location. And how exactly are you adding another map to an existing project? Based on your addme.lua, it seems you are adding additional eras to two stock maps, as well as having the map that is created when you use VisualMunge for the first time. Also, what doesn't work exactly? You never answered that.

Re: Mappack help

Posted: Fri May 11, 2012 5:40 pm
by ARCTroopaNate
I put the world file for the map in my worlds folder. Added a folder for it in _BUILD/Worlds with the neccesary .bat files. I put in a new folder in data_BFE/Common/Scripts called CHG and put in the lua files for the map there. I added it in the addme by replacing the lines that munged the new projects map with the lines of my old map, mission.req. That's what I've done. Right now the map just does not show up in the instant action list. I also changed the directory in my lua scripts to dc:BFE instead of dc:CHG and it still does not work.

Re: Mappack help

Posted: Fri May 11, 2012 5:48 pm
by Marth8880
Have you checked the debug log?

Re: Mappack help

Posted: Fri May 11, 2012 7:18 pm
by THEWULFMAN
ARCTroopaNate wrote:I put in a new folder in data_BFE/Common/Scripts called CHG and put in the lua files for the map there.
You don't need to, nor should you do that. Just keep them all together in the same folder, specifically the BFE one that should still be there.
ARCTroopaNate wrote:Right now the map just does not show up in the instant action list.

Then you have an Addme problem somewhere. Regardless of whether your mission.req, your mission reqs, or your mission scripts are set up properly or not, the addme.script is solely responsible for a map showing up on the Instant Action menu.