Adding a New Game Mode Error [Solved]

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
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

Adding a New Game Mode Error [Solved]

Post by Slime615 »

hey people. I have been trying to create a new Game mode for one of my maps, called bounty Hunter, but at the moment for referenceing purposes it is called Survival. So the lua is called BHTc_surv.


Unfortuanatley, when I tried to test it, I get this in the error log:

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(1010)
Data in C:\Program Files\LucasArts\Star Wars Battlefront II\GameData\AddOn\BHT\Data\_lvl_pc\MISSION.lvl is not a binary UCF file.

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(1019)
Unable to find level chunk in MISSION.lvl


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(112)
OpenScript(BHTc_surv): script (f2655553) not found

Message Severity: 5
C:\Battlefront2\main\Battlefront2\Source\GameState.cpp(1283)
Could not open MISSION\BHTc_surv.lvl


And a FATAL CTD. I guess I have done something wrong when adding the the game mode, probabley in the addme, mission or common scripts. Can anyone help me out?
Last edited by Slime615 on Sun May 27, 2012 3:35 pm, edited 1 time in total.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Adding a New Game Mode Error

Post by AQT »

Assuming you added this mode to your addme.lua correctly (since you seem to be able to select it on the Instant Action screen), and you have a proper lua file for it for now, do you have a REQ file for it, and have you referenced this REQ file in your mission.req file? If so, then you either have messed up one of these or both of them and should post their contents, if you don't already recognize your mistakes.
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

Re: Adding a New Game Mode Error

Post by Slime615 »

Here you go. I do have a .req that is referenced in the mission.req as well.

here are the various .reqs and .luas you wanted. If you want to see any more, just ask. Do you want to see the BHTc_surv Lua as well? Just ask.


BHTc_surv.req:
Hidden/Spoiler:
ucft
{
REQN
{
"script"
"BHTc_surv"
}
}
mission.req:(I think the error might be here.)
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"
"BHTc_con"
"BHTc_surv"
}
}
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 = "BHT%s_%s", era_c = 1, mode_con_c = 1, mode_surv_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("BHT","BHTc_surv",4)
AddDownloadableContent("BHT","BHTc_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\BHT\\data\\_LVL_PC\\core.lvl")
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Adding a New Game Mode Error

Post by AQT »

Slime615 wrote:Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(112)
OpenScript(BHTc_surv): script (f2655553) not found
It says BHTc_surv.lua does not exist. Since you indeed did create it, in what directory is it located?
Slime615 wrote:Just ask.
It is your duty and responsibility as someone who is being helped to provide information related to the problems at hand, including the steps you took and the files you created/edited. If you believe the information is relevant (i.e. would most likely be asked for if not provided in the first place), then you should provide it. If you are unsure (also in how you did something), then you should probably provide it anyway.
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

Re: Adding a New Game Mode Error

Post by Slime615 »

This is the directory: F:\BF2_ModTools\data_BHT\Common\scripts\BHT

i can not possibly provide you with every single script, on the off chance it may be relevent. What I meant, was that if you required files that I had not mentioned, then you need only ask to see them. I see no problem in that was a concept :? .

This is the LUA I used:
Hidden/Spoiler:
LUA DELETED - ISSUE NOW SOLVED
There. I am not sure what else I can provide, but If you want to know anything else, then I can provide that infomation.
Last edited by Slime615 on Wed May 30, 2012 11:36 am, edited 1 time in total.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Adding a New Game Mode Error

Post by AQT »

You are completely certain that the lua and its REQ are named BHTc_surv? If so, that's everything I've got.
Slime615 wrote:i can not possibly provide you with every single script, on the off chance it may be relevent.
Sure you can... and it's quite possible. You named/referenced about four of them in your first post but did not post their contents... so I asked for them. Had you provided them in the first place, I or anyone else wouldn't need to ask for them. See?
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

Re: Adding a New Game Mode Error

Post by Slime615 »

I just checked all of the files - Yes - Its called that all of the time.... BHTc_surv....

EDIT: Dont know if this helps - but I got an errorr from the Munge Log as well:
Hidden/Spoiler:
F:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\BHT\BHTc_surv.lua:139: unexpected symbol near `-'
ERROR[scriptmunge scripts\BHT\BHTc_surv.lua]:Could not read input file.ERROR[scriptmunge scripts\BHT\BHTc_surv.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

ERROR[levelpack mission\BHTc_surv.req]:Expecting bracket, but none was found.
File : munged\pc\bhtc_surv.script.req(1)...

ucft <--
ERROR[levelpack mission\BHTc_surv.req]:Expecting bracket, but none was found.
File : munged\pc\bhtc_surv.script.req(1)...

ucft <--
[continuing]
2 Errors 0 Warnings

ERROR[levelpack mission.req]:Expecting bracket, but none was found.
File : munged\pc\bhtc_surv.lvl.req(1)...

ucft <--
ERROR[levelpack mission.req]:Expecting bracket, but none was found.
File : munged\pc\bhtc_surv.lvl.req(1)...

ucft <--
[continuing]
2 Errors 0 Warnings

WARNING[PC_modelmunge msh\boss.msh]:boss has 4963 vertices and NO COLLISION GEOMETRY (WILL BE SLOW)!
0 Errors 1 Warnings

WARNING[PC_modelmunge msh\bx_1st_commando.msh]:bx_1st_commando has 1714 vertices and NO COLLISION GEOMETRY (WILL BE SLOW)!
WARNING[PC_modelmunge msh\cis_inf_droidcommando.msh]:cis_inf_droidcommando has 4595 vertices and NO COLLISION GEOMETRY (WILL BE SLOW)!
WARNING[PC_modelmunge msh\cis_shotty.msh]:cis_shotty has 1025 vertices and NO COLLISION GEOMETRY (WILL BE SLOW)!
0 Errors 3 Warnings
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Adding a New Game Mode Error

Post by lucasfart »

It might be worth trying a manual clean. If you get UCFT errors, I always try cleaning and remunging, as I find it to often be a corruption error or something along those lines.

If your mission.lvl is corrupted, nothing's going to be read, is it? You'll probably find that conquest doesn't work either.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Adding a New Game Mode Error

Post by AQT »

BHTc_surv.lua wrote:

Code: Select all

-Friends
That line is invalid. It is line 139 in your lua, as pointed out by the munge log. In order to comment something out properly, you need use two hyphens (--). So you would then have:

Code: Select all

--Friends
As Ace would always say, don't even bother trying your map when you have munge errors. And munge errors are usually things you should mention right off the start if you don't know how to interpret them.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Adding a New Game Mode Error

Post by lucasfart »

That's one of those things that you always post. :P

The second lot of errors relating to your req would seem to suggest an error munging the .req; as I mentioned before, try a manual clean and munge, as well as what AQT said.
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

Re: Adding a New Game Mode Error

Post by Slime615 »

Well, Munge error, are useualy hard to interperate in my experience, but, I can understand most error logs complaints, so I have a habit of ignoreing them.... Thanks, will fix that now...

EDIT:
I did a manual clean, and have good news and Bad news.
Good news and bad news. The good news is the Map loads now, and does not CTD. The Bad newsw is that it does not give me any spawn points.... I get the spawn menu, but can't select any of the CPs (They don't even appear on the minimap) and so can't spawn... I just did a manual clean and munge, so I have no idea what the problem might be....
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Adding a New Game Mode Error

Post by AQT »

Now that the map actually loads, and you are still experiencing problems, it would be a good time to run the debug .exe and acquire a new error log. Then see for yourself first whether you can fix anything it says.
lucasfart wrote:That's one of those things that you always post. :P
No, you are mistaken. People tend to confuse me with Ace and vice versa. I believe it has to do with our names.
The second lot of errors relating to your req would seem to suggest an error munging the .req
Those errors all arose from that single mistake in his lua. The REQ doesn't munge properly because its lua doesn't munge properly, and so on and so forth. It's like a chain reaction of sorts. So doing the manual clean was unnecessary. Look at what you've gotten him into now!
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Adding a New Game Mode Error

Post by lucasfart »

AQT wrote:
lucasfart wrote:That's one of those things that you always post. :P
No, you are mistaken. People tend to confuse me with Ace and vice versa. I believe it has to do with our names.
Oops. That was actually aimed at Slime - i meant the bf2 munge log is one of those things you should always post. :P But I can see how you misread me. :)
AQT wrote:
lucasfart wrote:The second lot of errors relating to your req would seem to suggest an error munging the .req
Those errors all arose from that single mistake in his lua. The REQ doesn't munge properly because its lua doesn't munge properly, and so on and so forth. It's like a chain reaction of sorts. So doing the manual clean was unnecessary. Look at what you've gotten him into now!
Huh. I didn't know that. I always thought it was completely unrelated....
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

Re: Adding a New Game Mode Error

Post by Slime615 »

Okay, I still can't spawn on the Map, and the error log gives me this as an answer:
Hidden/Spoiler:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(829)
Unable to find level chunk CMD_conquest in C:\Program Files\LucasArts\Star Wars Battlefront II\GameData\AddOn\BHT\Data\_lvl_pc\BHT\BHT.lvl


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(1019)
Unable to find level chunk in dc:BHT\BHT.lvl


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Platform\PC\pcFirstPerson.cpp(69)
FirstPerson::LoadLVLFile: Could not open FPM\REP\rep.lvl

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Team.cpp(439)
level.BHT.locals not localized

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Team.cpp(439)
level.BHT.locals not localized

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Team.cpp(439)
level.BHT.locals not localized

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\Team.cpp(439)
level.BHT.locals not localized
ifs_sideselect_fnEnter(): Map does not support custom era teams
ifs_sideselect_fnEnter(): The award settings file exists
ifs_sideselect_fnEnter(): Starting to remove award effects...
ifs_sideselect_fnEnter(): Finished removing award effects.
ifs_sideselect_fnEnter(): Map does not support custom era teams
Anyone know what the problem is?
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Adding a New Game Mode Error

Post by Marth8880 »

BFront2.log wrote:Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(829)
Unable to find level chunk CMD_conquest in C:\Program Files\LucasArts\Star Wars Battlefront II\GameData\AddOn\BHT\Data\_lvl_pc\BHT\BHT.lvl


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(1019)
Unable to find level chunk in dc:BHT\BHT.lvl


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Platform\PC\pcFirstPerson.cpp(69)
FirstPerson::LoadLVLFile: Could not open FPM\REP\rep.lvl
Nope, clueless, no idea what the problem could possibly be.

Did you ever update your REQs and LDXs through Zero Editor?
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Adding a New Game Mode Error

Post by lucasfart »

Is there any particular reason why your conquest layer is called CMD_conquest instead of BHT_conquest?
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

Re: Adding a New Game Mode Error

Post by Slime615 »

@ lucasfart - Its because I imported the script from a seperate map - and forgot to change that. Thats fixed now.

@Marth8880 - I have used the ZE Application to modify it, but not changed the world.req in any way other than that.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Adding a New Game Mode Error

Post by lucasfart »

So you made sure it's always called BHT_Conquest, both in ZE and in your LUA?

And with the "importing", did you import just a lua, or a whole map?
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

Re: Adding a New Game Mode Error

Post by Slime615 »

Okay - Its working. As for the Importing - IO meant vause the lua came from a different map - and I forgot to change it to reflect the "new" map I was useing.

My Only problem Now is getting the local sides to appear - but thats a different issue entirley.

Thanks for all you help!
Post Reply