Munge Not Reading LUA [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

User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

RE: Re: Munge Not Reading LUA

Post by trainmaster611 »

I am however good a trouble shooting
Yeah and I'm good at shooting in BF2 :lol: Ok, cheesy joke :roll:

I guess at this point this is a bit of an embarrasing question...I don't know exactly what the Dofiles lines do so I wouldn't know what exactly I'm looking for... :?

Oh and in that link I posted, there are some steps to adding turrets to frigates that include stuff non-IBC_Diet Dr. Pepper LUA related. Should I be doing these other things to? :|
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

RE: Re: Munge Not Reading LUA

Post by FragMe! »

The Dofile do this, they are calls to other LUAs (these are examples not yours)

Code: Select all

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveSpaceAssault")
ScriptCB_DoFile("LinkedShields")
ScriptCB_DoFile("LinkedDestroyables")
ScriptCB_DoFile("LinkedTurrets")
these are all in the root of the script directory, the same directory where your world script directory and files are located. So it executes each in turn.

Yes you should follow the tut in the link xwingguy is really good at scripting and trying to follow what he has laid out would be your best bet to start.
I will try to help when and if I can.

(I shoot better ha ha)
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

RE: Re: Munge Not Reading LUA

Post by trainmaster611 »

Ok, I finished following Xwing's steps and changed my IBC_Diet Dr. Pepper LUA back to its original form (with all the turrets and pieces on one line except it uses "LinkedFrigateCIS" and has a seperate line for "LinkedFrigatCIS: Init () or whatever its called). I think we are finally getting somewhere :D
Opened logfile BFront2.log 2007-04-02 1242
ingame stream movies\crawl.mvs
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
num, Selection = 1 table: 03CA116C
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 1
EraSelection.subst = c era_c
EraSelection.subst = g era_g
play movie AB1 200 , 300 510 x 400

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment AB10.000000ly

EraSelection.subst = c era_c
EraSelection.subst = g era_g
num, Selection = 1 table: 03CA116C
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 20
EraSelection.subst = c era_c
play movie AB1 200 , 300 510 x 400

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment AB10.000000ly

bEra_CloneWar = 1 bEra_Galactic = 1
clonewar_visable = true galactic_visable = false
Adding map: IBCc_Diet Dr. Pepper idx: 1
this.CurButton = _map_add
cur_button = nil
this.CurButton = Launch
cur_button = nil
(none):0: attempt to call global `ScriptCB_Dofile' (a nil value)

Message Severity: 3
.\Source\LuaScript.cpp(435)
Script file ObjectiveSpaceAssault not found

Message Severity: 3
.\Source\LuaScript.cpp(435)
Script file LinkedShields not found

Message Severity: 3
.\Source\LuaScript.cpp(435)
Script file LinkedDestroyables not found
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Post by MercuryNoodles »

Ok, this is a question I hate to ask, but: you didn't happen to delete/rename/change-file-extension-of any files in data_IBC/Common/Scripts, did you? The log is saying it can't find these files, so I'm guessing one of these things happened to those files.
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Post by trainmaster611 »

Yeah I changed LinkedDestructables to LinkedFrigates because thats what Xwing's guide said. I didn't see anything important in there...it was just a short tutorial on making stuff destructable in the LUA or whatever :?

But I didn't change anything else :|
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Post by MercuryNoodles »

Go to your data_???\Common\Scripts folder and copy the LinkedDestroyables.lua file you will find there and paste it any other folder. (So we don't accidently overwrite LinkedDestroyables.)
Go back and fix things so this step is followed, then see what happens. You're supposed to have a new file based on LinkedDestroyables, rather than replacing it.
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Post by trainmaster611 »

Ok well I copied the LinkedDestroyables LUA over from another data_ABC/Common/Scripts folder (the contents were identicle) and put it in its corresponding position...but the BF2_log is still claiming that it couldn't find LinkedDestroyables, LinkedShields, and ObjectiveSpaceAssault even if they were all there :?
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Post by MercuryNoodles »

O_o Ok, this is officially getting a little over my head, now. Is there any difference between the names called and the actual filenames? This is the only thing I can think of at the moment.
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

RE: Re: Munge Not Reading LUA

Post by trainmaster611 »

I believe this problem has taken a bizzare twist. I created a new space world and copied the missing documents to data_IBC/Common/Scripts. I then edited the LUA. I think I understand what you all were saying in the beginning: the Munge won't read past a certain number of characters. Apparently, this number is 324 characters (thats the number of characters between the beginning of the line and the '2' in cis_turr_82). The Munge thought that the line ended there and that I forgot to put a bracket but it didn't bother to read the full line. I deleted all the characters between the bracket from "cis_turr_76" to "cis_turr_82". By coincidence the number of characters left was exactly 324 characters. When I munged, it no longer gave me any error about the LUA.

However, I am still receiving the Message Severity 3s in the BF2_Log saying the LinkedDestroyables, LinkedShields, and ObjectiveSpaceAssault are still missing :?

So I solved half the problem :) (I'm just gonna have to cut down on the number of turrets on my frigate :roll: )
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

RE: Re: Munge Not Reading LUA

Post by trainmaster611 »

Ok here's whats up.

First I created a new space world and copied over the "missing" documents (again) to data_IBC/Common/Scripts. Then I deleted my LinkedFrigate LUA. Then I copied the LinkedDestroyables LUA to My Documents and there I edited the contents and renamed it to LinkedFrigates just as Xwing specified.

I read what Xwing said about the mission.req. It turns out that I put that ScriptCB_DoFile("LinkedFrigate") thingy in the mission.req instead of "LinkedFrigate" (I knew that looked funny) :roll:

It seems I have solved all the problems but when I munge and do the BF2_Log, it still crashes :? And the log isn't showing me anything at all
Opened logfile BFront2.log 2007-04-04 1802
ingame stream movies\crawl.mvs
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
num, Selection = 1 table: 03CA116C
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 1
EraSelection.subst = c era_c
EraSelection.subst = g era_g
play movie AB1 200 , 300 510 x 400

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment AB10.000000ly

EraSelection.subst = c era_c
EraSelection.subst = g era_g
num, Selection = 1 table: 03CA116C
+++mission modes changed! ifs_mspc_MapList_layout.SelectedIdx = 20
EraSelection.subst = c era_c
play movie AB1 200 , 300 510 x 400

Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment AB10.000000ly

bEra_CloneWar = 1 bEra_Galactic = 1
clonewar_visable = true galactic_visable = false
Adding map: IBCc_Diet Dr. Pepper idx: 1
this.CurButton = _map_add
cur_button = nil
this.CurButton = Launch
cur_button = nil
(none):0: attempt to call global `ScriptCB_Dofile' (a nil value)
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Post by MercuryNoodles »

Have made a lot of changes to to your map before testing? If so, check those changes. Even the slightest syntax error can cause a crash.
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

RE: Re: Munge Not Reading LUA

Post by trainmaster611 »

bEra_CloneWar = 1 bEra_Galactic = 1
clonewar_visable = true galactic_visable = false
Adding map: IBCc_Diet Dr. Pepper idx: 1
this.CurButton = _map_add
cur_button = nil
this.CurButton = Launch
cur_button = nil
(none):0: attempt to call global `ScriptCB_Dofile' (a nil value)
This bolded line...might it have something to do with this line that I put in the cmn LUA file? :|
ScriptCB_Dofile("LinkedFrigate")
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

RE: Re: Munge Not Reading LUA

Post by FragMe! »

Maybe, the Dofile it can't find is one of the first two because the error was still there when you were getting the can't find errors for the scripts. Try commenting out the ScriptCB_Dofile(LinkedFrigate) in the cmn lua and see if the error goes away. If that doesn't change it try commenting out the first two dofiles lines in the IBCc_Diet Dr. Pepper.lua one at a time. It may most likely give you another error but you can see if the nil value one goes away.

Edit: Other thing that just came to mind is where is the linkedfrigate lua, in the common/script directory or in common/script/IBC directory?
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

RE: Re: Munge Not Reading LUA

Post by trainmaster611 »

Ok I have some big news:

1) I moved the LinkedFrigate LUA out of data_IBC/Common/Scripts and then munged -- no difference

2) So I moved the LinkedFrigate LUA back in and then opened the cmn LUA file and deleted the suspect DoFile(LinkedFrigate) line -- and the map works!

So now I'm wondering how I would get it to read both DoFile lines without crashing :?
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

RE: Re: Munge Not Reading LUA

Post by FragMe! »

Just for kicks what happens if you put the DofileLinkedFrigate line in the IBCc_Diet Dr. Pepper.lua right below the other ones?
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

RE: Re: Munge Not Reading LUA

Post by trainmaster611 »

Add that line to the _Diet Dr. Pepper LUA and it crashes again :?
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

RE: Re: Munge Not Reading LUA

Post by FragMe! »

Post the linkedfrigate lua then lets see if it has a error in it.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

RE: Re: Munge Not Reading LUA

Post by [RDH]Zerted »

Its ScriptCB_DoFile(), not ScriptCB_Dofile().
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

RE: Re: Munge Not Reading LUA

Post by FragMe! »

Don't I feel like a DoFus for not noticing that :D
Hopefully that is all that is stopping from taking over the world
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

RE: Re: Munge Not Reading LUA

Post by trainmaster611 »

No in the LUA, It has DoFile with a capital F. I was just trying to identify the line.

THe LinkedFrigate LUA? Its the exact same thing Xwing wrote :?
--
-- No longer Pandemic's, xwingguy wrote this code.
-- That means if you use this, you MUST include me in your credits.
--


-- Also this code assumes that your Frigate Turrets have no destroyed geometry
--------------------------------------------
LinkedFrigate =
{
TurretList = nil, --List of turret names that must be destroyed when the Frigate is destroyed
Frigate = nil, --Name of the frigate (duh)

New = function(self, o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end,


Init = function(self)

local DestroyFrigate = function(list)
for _, obj in ipairs(list) do
if IsObjectAlive(obj) then
KillObject(obj)
end
SetProperty( obj, "RespawnTime", 99999999)
SetProperty( obj, "Team", 0)
end
end
--init stuff (really dang simple actually)
OnObjectKillName(
function()
DestroyFrigate(self.TurretList)
end,
self.Frigate)

end,
}
Post Reply