Page 1 of 1

Change ctf mod

Posted: Fri Jun 03, 2011 8:08 am
by DraK
Hi, I choose ctf2 flags for my map, but I would like to change to 1flag. My map is advanced, and I don't want to begin again :(

Is it possible?? If yes, how??

Re: Change ctf mod

Posted: Fri Jun 03, 2011 9:40 am
by FragMe!
From the FAQ, lots of good information there for questions just like this.


http://www.gametoast.com/forums/viewtop ... =27&t=3755

Re: Change ctf mod

Posted: Fri Jun 03, 2011 10:55 am
by DraK
I did it, but the new mod does not appear in the game :/

Re: Change ctf mod

Posted: Fri Jun 03, 2011 3:48 pm
by Marth8880
DraK wrote:I did it, but the new mod does not appear in the game :/
Did you adjust your addme.lua and mission.req files and did you add ABCc_1flag.req and/or ABCg_1flag.req (where ABC is your map's three-letter name) to your Mission folder?

Re: Change ctf mod

Posted: Fri Jun 03, 2011 5:43 pm
by DraK
I adjusted addme.lua and mission.req and the mode appears!! But I don't find ABCc1_flag.req and the map bug when I launch it: "Could not open MISSION/ABCc_1flag.lvl" :(

Re: Change ctf mod

Posted: Fri Jun 03, 2011 7:09 pm
by acryptozoo
DraK wrote:I adjusted addme.lua and mission.req and the mode appears!! But I don't find ABCc1_flag.req and the map bug when I launch it: "Could not open MISSION/ABCc_1flag.lvl" :(
post your addme.lua and mission.req
and
your ABCc1_flag.req should be
in your Data_ABC/common/mission folder

Re: Change ctf mod

Posted: Fri Jun 03, 2011 9:18 pm
by Marth8880
DraK wrote:I adjusted addme.lua and mission.req and the mode appears!! But I don't find ABCc1_flag.req and the map bug when I launch it: "Could not open MISSION/ABCc_1flag.lvl" :(
Make a copy of another map's REQ file for the mode - for example, kam1c_1flag.req - and rename it to ABCc_1flag and/or ABCg_1flag (again, replacing ABC with your map's three-letter name). Then open, it up, and change this part of the script:

Code: Select all

REQN
	{
		"script"
		"kam1c_1flag"
	}
}
to this:

Code: Select all

REQN
	{
		"script"
		"ABCc_1flag"
	}
}
(once again, changing ABC to your map's three-letter name :lol: )

Re: Change ctf mod

Posted: Sat Jun 04, 2011 5:17 am
by DraK
There is always the same problem :/

My addme.lua :
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




--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "TTB%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_1flag_g = 1, mode_1flag_c = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

-- 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("TTB","TTBg_con",4)
AddDownloadableContent("TTB","TTBc_con",4)
AddDownloadableContent("TTB","TTBg_1flag",4)
AddDownloadableContent("TTB","TTBc_1flag",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TTB\\data\\_LVL_PC\\core.lvl")
My mission.req :
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"ingame_movies"
}

REQN
{
"script"
"setup_teams"
"gametype_conquest"
"gametype_capture"
"Objective"
"MultiObjectiveContainer"
"ObjectiveCTF"
"ObjectiveAssault"
"ObjectiveSpaceAssault"
"ObjectiveConquest"
"ObjectiveTDM"
"ObjectiveOneFlagCTF"
"SoundEvent_ctf"
"ObjectiveGoto"
"LinkedShields"
"LinkedDestroyables"
"LinkedTurrets"
"Ambush"
"PlayMovieWithTransition"
}

REQN
{
"lvl"
"TTBg_con"
"TTBc_con"
"TTBg_1flag"
"TTBc_1flag"
}
}

Re: Change ctf mod

Posted: Sat Jun 04, 2011 3:54 pm
by Marth8880
DraK wrote:There is always the same problem :/

My addme.lua :
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




--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "TTB%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_1flag_g = 1, mode_1flag_c = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

-- 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("TTB","TTBg_con",4)
AddDownloadableContent("TTB","TTBc_con",4)
AddDownloadableContent("TTB","TTBg_1flag",4)
AddDownloadableContent("TTB","TTBc_1flag",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TTB\\data\\_LVL_PC\\core.lvl")
My mission.req :
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"ingame_movies"
}

REQN
{
"script"
"setup_teams"
"gametype_conquest"
"gametype_capture"
"Objective"
"MultiObjectiveContainer"
"ObjectiveCTF"
"ObjectiveAssault"
"ObjectiveSpaceAssault"
"ObjectiveConquest"
"ObjectiveTDM"
"ObjectiveOneFlagCTF"
"SoundEvent_ctf"
"ObjectiveGoto"
"LinkedShields"
"LinkedDestroyables"
"LinkedTurrets"
"Ambush"
"PlayMovieWithTransition"
}

REQN
{
"lvl"
"TTBg_con"
"TTBc_con"
"TTBg_1flag"
"TTBc_1flag"
}
}
Did you do what I just told you to do? You have your addme LUA and mission REQ set up properly but did you add TTBc_1flag.req and TTBg_1flag.req to your mission folder?

Re: Change ctf mod

Posted: Sat Jun 04, 2011 5:17 pm
by DraK
Yes, but it doesn't work :(

Re: Change ctf mod

Posted: Sat Jun 04, 2011 6:05 pm
by Marth8880
DraK wrote:Yes, but it doesn't work :(
What exactly did you do? Please explain in a step-by-step process.

Re: Change ctf mod

Posted: Sat Jun 04, 2011 6:17 pm
by DraK
Ok.
I did teancum's tutorial to add the mode 1flag to my map. Then I adjusted addme.lua and mission.req. In addition I changed kam1c_1flag & kam1g_1flag to TTBc_1flag & TTBg_1flag which I put in data_TTB/Common/mission.

Re: Change ctf mod

Posted: Sat Jun 04, 2011 6:31 pm
by DarthD.U.C.K.
for adding the general gamemode scripts, you should follow the adding hunt tutorial. the mission luas belong into the data_XXX\Common\scripts\XXX folder.

Re: Change ctf mod

Posted: Sat Jun 04, 2011 7:53 pm
by Marth8880
DraK wrote:Ok.
I did teancum's tutorial to add the mode 1flag to my map. Then I adjusted addme.lua and mission.req. In addition I changed kam1c_1flag & kam1g_1flag to TTBc_1flag & TTBg_1flag which I put in data_TTB/Common/mission.
Did you read what I posted yesterday?
Marth8880 wrote:...Then open [TTBc_1flag.req] up, and change this part of the script:

Code: Select all

REQN
	{
		"script"
		"kam1c_1flag"
	}
}
to this:

Code: Select all

REQN
	{
		"script"
		"TTBc_1flag"
	}
}
Then do the same thing with TTBg_1flag.req but instead changing the Kamino part to this:

Code: Select all

REQN
	{
		"script"
		"TTBg_1flag"
	}
}
In the end, your files should look like this:

TTBc_1flag.req

Code: Select all

ucft
{
	REQN
    	{

        "config"
        "cor_movies"	

    	}

	REQN
	{
		"script"
		"TTBc_1flag"
	}
}
TTBg_1flag.req

Code: Select all

ucft
{
	REQN
    	{

        "config"
        "cor_movies"	

    	}

	REQN
	{
		"script"
		"TTBg_1flag"
	}
}
Both files should be in your map's Common\mission\ folder.