Fatal Error: Could Not Open Mission\\TSTg_1flag

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
xwingguy

Fatal Error: Could Not Open Mission\\TSTg_1flag

Post by xwingguy »

When I first created my map I accidently got cw and gcw assualt but no one flag ctf. Soooo, I'm trying to add in my one flag ctf the hard way.

Here's my addme script:

Code: Select all

--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 = "TST%s_%s", era_g = 1, mode_assault_g = 1,mode_1flag_g  = 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("TST","TSTg_1flag",4)
AddDownloadableContent("TST","TSTg_Diet Dr. Pepper",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TST\\data\\_LVL_PC\\core.lvl")
Here's the mission REQ (name is TSTg_1flag)

Code: Select all

ucft
{
	REQN
	{
		"script"
		"TSTg_cmn"
		"TSTg_1flag"
	}
}

And here's my MRQ (name is TST_GCW-CTF. By the way I set GCW-Ships.lyr to always loaded so it's not mentioned here)

Code: Select all

ucft
{
	REQN
	{
		"congraph"
		"TST_GCW-CTF"
	}
	REQN
	{
		"world"
		"TST_GCW-ctf"
	}
}
Lastly, here's the script for TSTg_1flag (It's just the template right now.)

Code: Select all

--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPAX - Galactic Civil Wars Template  CTF File
--
ScriptCB_DoFile("ObjectiveOneFlagCTF")
ScriptCB_DoFile("TSTg_cmn")

myGameMode = "TST_GCW-CTF"

function SetupUnits()
    ReadDataFile("SIDE\\all.lvl",
        "all_inf_pilot",
        "all_fly_xwing_sc",
        "all_fly_ywing_sc",
        "all_fly_awing",
        "all_veh_remote_terminal")

     ReadDataFile("SIDE\\imp.lvl",
        "imp_inf_pilot",
        "imp_fly_tiefighter_sc",
        "imp_fly_tiebomber_sc",
        "imp_fly_tieinterceptor",
        "imp_veh_remote_terminal")
		
    ReadDataFile("SIDE\\tur.lvl",
		"tur_bldg_spa_all_beam",
		"tur_bldg_spa_all_recoilless",
		"tur_bldg_spa_all_chaingun",
		"tur_bldg_spa_imp_beam",
		"tur_bldg_spa_imp_recoilless",
		"tur_bldg_spa_imp_chaingun",
		"tur_bldg_chaingun_roof"
	)
end

myTeamConfig = {
	 all = {
		team = ALL,
		units = 32,
		reinforcements = -1,
		pilot    = { "all_inf_pilot",32},
	},

	imp = {
		team = IMP,
		units = 32,
		reinforcements = -1,
		pilot    = { "imp_inf_pilot",32},
	}
}

function myScriptInit()
	SetMemoryPoolSize("FlagItem", 1)
end	

---------------------------------------------------------------------------
-- FUNCTION:    ScriptPostLoad
-- PURPOSE:     This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES:       The name, 'ScriptPostLoad' is a chosen convention, and each
--              mission script must contain a version of this function, as
--              it is called from C to start the mission.
--------------------------------------------------------------------------- 
function ScriptPostLoad()
	
	ctf = ObjectiveOneFlagCTF:New{
		teamATT = IMP, teamDEF = ALL,
		textATT = "game.modes.1flag", textDEF = "game.modes.1flag2", flag = "cmn_flag", 
		homeRegion = "flaghome", captureRegionATT = "defhome", captureRegionDEF = "atthome",
		capRegionDummyObjectATT = "1flag_cis_marker", capRegionDummyObjectDEF = "1flag_rep_marker",
		multiplayerRules = true, hideCPs = true,
		AIGoalWeight = 0.0,
	}
	SoundEvent_SetupTeams( IMP, 'imp', ALL, 'all' )
	
    ctf:Start()

	SetupTurrets()
	
    AddAIGoal(ALL, "Deathmatch", 100)
    AddAIGoal(IMP, "Deathmatch", 100)
end
Sooo, what the heck did I mess up/leave out? Yes, I have tried clean munging.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

RE: Fatal Error: Could Not Open Mission\\TSTg_1flag

Post by Teancum »

Don't forget about the req in /common/mission. That'll do it every time. mission.req points to /common/mission, then each req there points to the scripts themselves.
xwingguy

RE: Fatal Error: Could Not Open Mission\\TSTg_1flag

Post by xwingguy »

Thanks. So much "paperwork" is involved in getting things to work.
Yocki

RE: Fatal Error: Could Not Open Mission\\TSTg_1flag

Post by Yocki »

i got this same error but with REPg_con... but the only thing i changed was addind new units and more units in field... i made the conquest mode with the easy way... so i dont know where is the problem...
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

RE: Fatal Error: Could Not Open Mission\\TSTg_1flag

Post by Teancum »

It's can't find it in one of the following locations

/addme/addme.lua
/common/mission.req
/common/mission/REPg_con.req
Post Reply