Strange Munge Error

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
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 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: Owning people in SWBF2
Contact:

Strange Munge Error

Post by Par3210 »

Hello. I got this error munging:
Hidden/Spoiler:
C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\WW2\WW2g_ctf.lua:186: <eof> expected near `end'
ERROR[scriptmunge scripts\WW2\WW2g_ctf.lua]:Could not read input file.ERROR[scriptmunge scripts\WW2\WW2g_ctf.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

ERROR[levelpack shell.req]:Input file shell.req does not exist. [continuing]
1 Errors 0 Warnings
I'm sure it's to do with my campaign lua (ctf) where I haven't done it right. Please help me. Here is my lua.
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")--*"setup_teams handles the logic for specifying the unit loadout."
ScriptCB_DoFile("ObjectiveConquest")-- This is about capturing CP's
ScriptCB_DoFile("MultiObjectiveContainer")-- I'm not sure what this is for, but it is included in Almost all the Campaign missions
ScriptCB_DoFile("ObjectiveGoto")-- well this speaks for itself
ScriptCB_SetGameRules("campaign")
ScriptCB_DoFile("Ambush")-- Germans will be ambushing us at the ruble, so we need this.


-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2


function ScriptPostLoad()
SetAIDifficulty(0, 2, "hard")
AllowAISpawn(ATT, false)
AllowAISpawn(DEF, true)
EnableSPScriptedHeroes()
ScriptCB_SetGameRules("campaign")

onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then
ShowPopup("level.geo1.hints.hints")
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)

end
end)

--objective :goto
Objective1 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "Good. ", popupText = "Go to the trench ahead of you. Move it!",
regionName = "trench1", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}

Objective1:AddHint("level.geo1.hints.movement")
Objective1:AddHint("level.geo1.hints.obj_markers")
Objective1:AddHint("level.geo1.hints.review_objectives")
Objective1:AddHint("level.geo1.hints.sprint")


Objective1.OnStart = function(self)
att_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
def_obj1_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
MapAddEntityMarker("hud_objective_icon", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)

end

Objective1.OnComplete = function(self)
DeleteAIGoal(att_obj1_aigoal)
DeleteAIGoal(def_obj1_aigoal)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("hud_objective_icon")

end




--objective: conquest
Objective2CP = CommandPost:New{name = "cp1"}
Objective2 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "So you did it huh? Hm.", popupText = "Capture the CP here to secure a foothold for the troops. GO! Don't wait, just GO! ", AIGoalWeight = 0}
Objective2:AddCommandPost(Objective2CP)

Objective2:AddHint("level.geo1.hints.capture_cp")

Objective2.OnStart = function(self)
AICanCaptureCP("cp1", ATT, false)
AICanCaptureCP("cp1", DEF, true)
att_obj2_aigoal = AddAIGoal(ATT, "Defend", 50, "cp1")
def_obj2_aigoal = AddAIGoal(DEF, "Defend", 50, "cp1")
att_obj2_aigoal2 = AddAIGoal(ATT, "Deathmatch", 100)
def_obj2_aigoal2 = AddAIGoal(DEF, "Deathmatch", 100)
end

Objective2.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(att_obj2_aigoal)
DeleteAIGoal(att_obj2_aigoal2)
DeleteAIGoal(def_obj2_aigoal)
DeleteAIGoal(def_obj2_aigoal2)
SetProperty("cp1", "Team", 1)
SetProperty("cp1", "CaptureRegion", "")

end





--objective: assault
Objective3= ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "You are getting better. ", popupText = "Kill 5 german soilders."}

Dclass = TargetType:New{classname = "imp_inf_officer", killLimit = 5}
Objective3:AddTarget(Dclass)

Objective3.OnStart = function(self)
Objective3.Dclass_cpGoal1 = AddAIGoal(ATT, "Defend", 100, "cp2")
Objective3.Dclass_cpGoal2 = AddAIGoal(DEF, "Defend", 100, "cp2")
end

Objective3.OnComplete = function(self)
DeleteAIGoal(Objective3.Dclass_cpGoal1)
DeleteAIGoal(Objective3.Dclass_cpGoal2)
end




--objective :goto
Objective4 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "Well done. Now stay there for a bit and heal up. We have provided some rare droids to help you.", popupText = "Head forward through the tunnels. I want you to go to the German Military base, some way ahead. Make camp to the end of the tunnels. ",
regionName = "camp2", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}

Objective4:AddHint("level.geo1.hints.movement")
Objective4:AddHint("level.geo1.hints.obj_markers")
Objective4:AddHint("level.geo1.hints.review_objectives")
Objective4:AddHint("level.geo1.hints.sprint")


Objective4.OnStart = function(self)
att_obj4_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
def_obj4_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
MapAddEntityMarker("hud_objective_icon", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)

end

Objective4.OnComplete = function(self)
DeleteAIGoal(att_obj4_aigoal)
DeleteAIGoal(def_obj4_aigoal)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("hud_objective_icon")

end



end



function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 5)
StartTimer(beginobjectivestimer)
end

function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 5}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:AddObjectiveSet(Objective2)
objectiveSequence:AddObjectiveSet(Objective3)
objectiveSequence:AddObjectiveSet(Objective4)

objectiveSequence:Start()

end

cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}

conquest = ObjectiveConquest:New{teamDEF = DEF,
textDEF = "game.modes.con2",
multiplayerRules = true}

<eof>

conquest:Start()

EnableSPHeroRules()

end

---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' 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 ScriptInit()

ReadDataFile("ingame.lvl")



SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_urban",
"all_inf_rifleman_desert",
"all_inf_rifleman")


ReadDataFile("dc:SIDE\\ger.lvl",
"imp_inf_officer",

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_tat_barge",
"tur_bldg_laser")

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 400,
soldier = { "all_inf_rifleman_jungle",9, 25},
engineer = { "all_inf_engineer_jungle",1, 4},
sniper = { "all_inf_rifleman_urban",1, 4},

},
imp = {
team = IMP,
units = 50,
reinforcements = 600,
officer = { "imp_inf_officer",1, 4},
},
}

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("FlagItem", 2)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:WW2\\WW2.lvl", "WW2_ctf")
SetDenseEnvironment("false")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "des_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Allleaving")
SetOutOfBoundsVoiceOver(1, "Impleaving")

SetAmbientMusic(ALL, 1.0, "all_tat_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_tat_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_tat_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_tat_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_tat_amb_end", 2,1)

SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")

-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end
Ty in advance.
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: Strange Munge Error

Post by Frisbeetarian »

What's the problem, and why is it strange? It's telling you exactly what's wrong, unlike some other errors that just point you in the right direction.
..\..\common\scripts\WW2\WW2g_ctf.lua:186: <eof> expected near `end'
186
This occurs around line 186. I saw you put a "<eof>" in near there, but you take it too literally. <eof> means end of file.
<eof> expected near `end'
The compiler expects the end of the file, but it instead gets an "end". That means you have an extra "end" somewhere that is screwing up your code. In your case, it's the one before

Code: Select all

function BeginObjectivesTimer()
Oh, and remove the <eof>.
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 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: Owning people in SWBF2
Contact:

Re: Strange Munge Error

Post by Par3210 »

oh, lol, thanks. i'll try it now. :lol:
it worked, but none of my objectives are showing. Why? Please help Fris or anyone else. Here's the lua again.
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")--*"setup_teams handles the logic for specifying the unit loadout."
ScriptCB_DoFile("ObjectiveConquest")-- This is about capturing CP's
ScriptCB_DoFile("MultiObjectiveContainer")-- I'm not sure what this is for, but it is included in Almost all the Campaign missions
ScriptCB_DoFile("ObjectiveGoto")-- well this speaks for itself
ScriptCB_SetGameRules("campaign")
ScriptCB_DoFile("Ambush")-- Germans will be ambushing us at the ruble, so we need this.


-- Rebels Attacking (attacker is always #1)
local ALL = 1
local IMP = 2
-- These variables do not change
local ATT = 1
local DEF = 2


function ScriptPostLoad()
SetAIDifficulty(0, 2, "hard")
AllowAISpawn(ATT, false)
AllowAISpawn(DEF, true)
EnableSPScriptedHeroes()
ScriptCB_SetGameRules("campaign")

onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then
ShowPopup("level.geo1.hints.hints")
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)

end
end)

--objective :goto
Objective1 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "Good. ", popupText = "Go to the trench ahead of you. Move it!",
regionName = "trench1", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}

Objective1:AddHint("level.geo1.hints.movement")
Objective1:AddHint("level.geo1.hints.obj_markers")
Objective1:AddHint("level.geo1.hints.review_objectives")
Objective1:AddHint("level.geo1.hints.sprint")


Objective1.OnStart = function(self)
att_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
def_obj1_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
MapAddEntityMarker("hud_objective_icon", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)

end

Objective1.OnComplete = function(self)
DeleteAIGoal(att_obj1_aigoal)
DeleteAIGoal(def_obj1_aigoal)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("hud_objective_icon")

end




--objective: conquest
Objective2CP = CommandPost:New{name = "cp1"}
Objective2 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "So you did it huh? Hm.", popupText = "Capture the CP here to secure a foothold for the troops. GO! Don't wait, just GO! ", AIGoalWeight = 0}
Objective2:AddCommandPost(Objective2CP)

Objective2:AddHint("level.geo1.hints.capture_cp")

Objective2.OnStart = function(self)
AICanCaptureCP("cp1", ATT, false)
AICanCaptureCP("cp1", DEF, true)
att_obj2_aigoal = AddAIGoal(ATT, "Defend", 50, "cp1")
def_obj2_aigoal = AddAIGoal(DEF, "Defend", 50, "cp1")
att_obj2_aigoal2 = AddAIGoal(ATT, "Deathmatch", 100)
def_obj2_aigoal2 = AddAIGoal(DEF, "Deathmatch", 100)
end

Objective2.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(att_obj2_aigoal)
DeleteAIGoal(att_obj2_aigoal2)
DeleteAIGoal(def_obj2_aigoal)
DeleteAIGoal(def_obj2_aigoal2)
SetProperty("cp1", "Team", 1)
SetProperty("cp1", "CaptureRegion", "")

end





--objective: assault
Objective3= ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "You are getting better. ", popupText = "Kill 5 german soilders."}

Dclass = TargetType:New{classname = "imp_inf_officer", killLimit = 5}
Objective3:AddTarget(Dclass)

Objective3.OnStart = function(self)
Objective3.Dclass_cpGoal1 = AddAIGoal(ATT, "Defend", 100, "cp2")
Objective3.Dclass_cpGoal2 = AddAIGoal(DEF, "Defend", 100, "cp2")
end

Objective3.OnComplete = function(self)
DeleteAIGoal(Objective3.Dclass_cpGoal1)
DeleteAIGoal(Objective3.Dclass_cpGoal2)
end




--objective :goto
Objective4 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "Well done. Now stay there for a bit and heal up. We have provided some rare droids to help you.", popupText = "Head forward through the tunnels. I want you to go to the German Military base, some way ahead. Make camp to the end of the tunnels. ",
regionName = "camp2", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}

Objective4:AddHint("level.geo1.hints.movement")
Objective4:AddHint("level.geo1.hints.obj_markers")
Objective4:AddHint("level.geo1.hints.review_objectives")
Objective4:AddHint("level.geo1.hints.sprint")


Objective4.OnStart = function(self)
att_obj4_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
def_obj4_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
MapAddEntityMarker("hud_objective_icon", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)

end

Objective4.OnComplete = function(self)
DeleteAIGoal(att_obj4_aigoal)
DeleteAIGoal(def_obj4_aigoal)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("hud_objective_icon")

end


function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 5)
StartTimer(beginobjectivestimer)
end

function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 5}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:AddObjectiveSet(Objective2)
objectiveSequence:AddObjectiveSet(Objective3)
objectiveSequence:AddObjectiveSet(Objective4)

objectiveSequence:Start()

end

cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}

conquest = ObjectiveConquest:New{teamDEF = DEF,
textDEF = "game.modes.con2",
multiplayerRules = true}


conquest:Start()

EnableSPHeroRules()

end

---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' 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 ScriptInit()

ReadDataFile("ingame.lvl")



SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_urban",
"all_inf_rifleman_desert",
"all_inf_rifleman")


ReadDataFile("SIDE\\imp.lvl",
"imp_inf_officer")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_tat_barge",
"tur_bldg_laser")

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 400,
soldier = { "all_inf_rifleman_jungle",9, 25},
engineer = { "all_inf_engineer_jungle",1, 4},
sniper = { "all_inf_rifleman_urban",1, 4},

},
imp = {
team = IMP,
units = 50,
reinforcements = 600,
officer = { "imp_inf_officer",1, 4},
},
}

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("FlagItem", 2)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:WW2\\WW2.lvl", "WW2_ctf")
SetDenseEnvironment("false")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "des_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Allleaving")
SetOutOfBoundsVoiceOver(1, "Impleaving")

SetAmbientMusic(ALL, 1.0, "all_tat_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_tat_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_tat_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_tat_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_tat_amb_end", 2,1)

SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")

-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end
Can someone do it up for me so it works? Thank you ever so much :thumbs:
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: Strange Munge Error

Post by [RDH]Zerted »

The objectives never start because you never told them to. BeginObjectives() is never called. Maybe you wanted to call it when the beginobjectivestimer ends? If so, that code isn't written.
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 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: Owning people in SWBF2
Contact:

Re: Strange Munge Error

Post by Par3210 »

so do i need to add BeginObjectives() to the lua? Where? Please help..
User avatar
General_Nate
Lieutenant General
Lieutenant General
Posts: 689
Joined: Sun Jun 28, 2009 4:01 pm
Projects :: None because BFII is not working
Games I'm Playing :: Minecraft
xbox live or psn: No gamertag set
Location: 127.0.0.1

Re: Strange Munge Error

Post by General_Nate »

You could look at a stock map for reference.
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 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: Owning people in SWBF2
Contact:

Re: Strange Munge Error

Post by Par3210 »

good idea :shock: :P :oops:
User avatar
General_Nate
Lieutenant General
Lieutenant General
Posts: 689
Joined: Sun Jun 28, 2009 4:01 pm
Projects :: None because BFII is not working
Games I'm Playing :: Minecraft
xbox live or psn: No gamertag set
Location: 127.0.0.1

Re: Strange Munge Error

Post by General_Nate »

It's ok, I've had those moments before too. :wink:
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 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: Owning people in SWBF2
Contact:

Re: Strange Munge Error

Post by Par3210 »

I didn't have any inspiration - the stock campaigns are set up really difficultly..
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: Strange Munge Error

Post by [RDH]Zerted »

[RDH]Zerted wrote:...BeginObjectives() is never called...
Oops, sorry. I skimmed over one of the lines. Ignore my last post.

Scatter print statements throughout your code so when you run it, you can visually see in the debug log which sections of code are running and which sections aren't being run.

Example Print Statement: print("Just entered function ScriptPostLoad()")
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 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: Owning people in SWBF2
Contact:

Re: Strange Munge Error

Post by Par3210 »

i cannot do that, sorry. Please could you do that. I do not understand what you mean. :|
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: Strange Munge Error

Post by [RDH]Zerted »

No, that is something you must learn to do. It's called debugging. You are having problems with parts of your code not running, so you need to figure out which sections of your code are running. One way to do this is to put print statements throughout your code so you can see what is running. Print statements are functions that take a string. The string gets written to the debug log.

Put an informative print statement, say, at the start of each function then munge and run the map. Play the map until an objective is supposed to start. When it doesn't, pause the game and look at the debug/error log. The log will contain some of your print messages. This allows you to see which sections of the code were being run by the game. Trace/follow through the messages and the code until you come to the first message that isn't printed. You now know that the error is most likely in the code that runs between those two print statements (between the one that printed and the one that didn't).

If you don't understand anything about coding, such as functions, strings, or basic scoping rules, then you should go to the main Lua web site and read their intro to programming tutorial.

Also, your conquest objective has no CPs added to it. Fix that then post a debug log.
Post Reply