Page 1 of 2

Can someone help me...please!?

Posted: Fri Jul 10, 2009 9:05 am
by Par3210
Well, hey there. I have a bit of a problem. In my PC_MungeLog I got this error
Hidden/Spoiler:
C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\RPM\RPMg_con.lua:116: `}' expected (to close `{' at line 107) near `AddUnitClass'
ERROR[scriptmunge scripts\RPM\RPMg_con.lua]:Could not read input file.ERROR[scriptmunge scripts\RPM\RPMg_con.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings
Can someone help me on where to add the '}' into? I have displayed my lua:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

-- 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()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)

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",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"rep_hero_kiyadimundi")

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"cis_hero_darthmaul",
"imp_fly_destroyer_dome" )
ReadDataFile("SIDE\\rep.lvl",
"rep_hero_obiwan",
"rep_hero_kiyadimundi",
"rep_hero_anakin")
ReadDataFile("SIDE\\cis.lvl",
"cis_hero_countdooku",
"cis_hero_darthmaul")

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

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman",9, 25},
assault = { "all_inf_rocketeer",1,4},
sniper = { "all_inf_sniper",1,4},

AddUnitClass(ALL, "rep_hero_obiwan")
AddUnitClass(ALL, "rep_hero_anakin")
},
}
imp = {
team = IMP,
units = 20,
reinforcements = 150,
assault = { "imp_inf_rocketeer",1,4},
sniper = { "imp_inf_sniper",1,4},

AddUnitClass(IMP, "cis_hero_countdooku")
AddUnitClass(IMP, "cis_hero_darthmaul")
},
}

-- 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)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:RPM\\RPM.lvl", "RPM_conquest")
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
Thanks for your help and time. :) :(

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 9:10 am
by Xavious
Try setting it up like this

Code: Select all

SetupTeams{
   all = {
    team = ALL,
    units = 20,
    reinforcements = 150,
    soldier = { "all_inf_rifleman",9, 25},
    assault = { "all_inf_rocketeer",1,4},
    sniper = { "all_inf_sniper",1,4},


 },
 imp = {
   team = IMP,
    units = 20,
    reinforcements = 150,
    assault = { "imp_inf_rocketeer",1,4},
    sniper = { "imp_inf_sniper",1,4},

  }
 }

AddUnitClass(ALL, "rep_hero_obiwan")
AddUnitClass(ALL, "rep_hero_anakin")
AddUnitClass(IMP, "cis_hero_countdooku")
AddUnitClass(IMP, "cis_hero_darthmaul")

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 9:10 am
by Par3210
i did it's just that the hide quote things came out wrong and made everything go over to the side

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 9:11 am
by Xavious
I changed more than the spacing. (Which doesn't matter, by the way)

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 9:13 am
by Battleffront_Conquer
you are missing "SetupTeams{" before the imperial team
Hidden/Spoiler:
SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman",9, 25},
assault = { "all_inf_rocketeer",1,4},
sniper = { "all_inf_sniper",1,4},

AddUnitClass(ALL, "rep_hero_obiwan")
AddUnitClass(ALL, "rep_hero_anakin")
},
}
SetupTeams{
imp = {
team = IMP,
units = 20,
reinforcements = 150,
assault = { "imp_inf_rocketeer",1,4},
sniper = { "imp_inf_sniper",1,4},

AddUnitClass(IMP, "cis_hero_countdooku")
AddUnitClass(IMP, "cis_hero_darthmaul")
},
}

Xavious' way will work also, but this is the stock setup.

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 9:14 am
by Par3210
thank you very much i'll just munge now and let you know if it works
EDIT: still says error.. But it's changed now
Hidden/Spoiler:
C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\RPM\RPMg_con.lua:123: `}' expected (to close `{' at line 115) near `AddUnitClass'
The extract from my munge log
EDIT2: ARRGH! I tried adding SetupTeams{ but it still hasn't worked! Please help! Any help at all would be appreciated. :( :( :(

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 3:13 pm
by Frisbeetarian
Battleffront_Conquer wrote:Xavious' way will work also, but this is the stock setup.
I'm not quite sure which way Xavious was going for since he made a small mistake (which he has since fixed), but your way is not the way most scripts do it (and in the process of "correcting" Xavious, you didn't fix the original problem).

@Par3210
Repost your Lua script... or fix it yourself. It's very easy to read the munge errors. It's saying that there is a bracket opened at line 115 that should be closed around line 123 (and line 123 is near AddUnitClass).

If you copied or pasted either of what was suggested above, you'll still have a problem. All you need to do from your original Lua script is to move the AddUnitClass() calls to outside of the SetupTeams{}.

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 3:47 pm
by Par3210
nah it's ok.. i've deleted it anyway. I was like 90% finished and it was my best map yet, stupid me. Dang, i'll have to start again!! :(

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 3:49 pm
by TK432
outch

simply take the luas out of the template and rename them would've worked too

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 3:53 pm
by Xavious
TK432 wrote:outch

simply take the luas out of the template and rename them would've worked too
No, it wouldn't have. The template would be missing references to his world, Command Posts, and any other changes. He'd end up doing much too much work to solve the problem.

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 4:00 pm
by TK432
yea but its better to start with a new lua than making the whole thing again...i think

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 4:02 pm
by Xavious
You don't have to make the whole thing over to fix one simple issue. Starting over with a new one is the same thing as making the whole thing again.

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 4:15 pm
by TK432
well yea

remaking something because of a bracket is....overreacted

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 4:46 pm
by Par3210
thanks a lot anyway guys. I didn't think i'd get many replies but it appears lots of people have tried to help. :D I really appreciate that. Thanks again. :wink:

Re: Can someone help me...please!?

Posted: Fri Jul 10, 2009 6:49 pm
by Maveritchell
Par3210 wrote:nah it's ok.. i've deleted it anyway. I was like 90% finished and it was my best map yet, stupid me. Dang, i'll have to start again!! :(
For future reference, this is not a smart move. I promise you that there's no way you can screw up your .lua so bad that no one here can correct it.

Re: Can someone help me...please!?

Posted: Sat Jul 11, 2009 7:17 am
by [RDH]Zerted
Battleffront_Conquer wrote:Xavious' way will work also, but this is the stock setup.
Both ways do work, but Xavious' format is better. I don't have a clue why some of the developers did it the other way, but putting those AddUnitClasses in SetupTeams isn't clear/clean.

Did you remember to check the Recycling Bin to see if you could restore your map? A map with errors in any single file is always mostly recoverable, no matter what file it is. Everything you see in ZeroEdit is actually stored in a bunch of different files. If you still want to know, your Lua was only missing a couple of commas.

In HTML (web pages), extra spacing is ignored. If you want to see multiple spaces, use the code tags. If you still want it hidden, put the hide tags around the code tags.

Re: Can someone help me...please!?

Posted: Sat Jul 11, 2009 1:50 pm
by Par3210
I know I am stupid, I deleted it and therefore can't be restored unless like a great computer genius came along which is highly unlikely. My map wasn't very good anyway, it had too much fog, which made it very laggy.

Re: Can someone help me...please!?

Posted: Sat Jul 11, 2009 2:19 pm
by RogueKnight
Par3210 wrote:I know I am stupid, I deleted it and therefore can't be restored unless like a great computer genius came along which is highly unlikely. My map wasn't very good anyway, it had too much fog, which made it very laggy.
*pokes Zerted*

I think there's a way to get files back after you empty the recycle bin, correct?

Re: Can someone help me...please!?

Posted: Sat Jul 11, 2009 2:21 pm
by Super_Clone
No, if he emptied the Recycle Bin, their gone. Correct me if I'm wrong, please.

Re: Can someone help me...please!?

Posted: Sat Jul 11, 2009 6:35 pm
by [RDH]Zerted
Yes there is, look online for undelete utilities. Files aren't gone until something is written on the hard drive where they were originally stored. However, if you didn't like how the map turned out, it might not be worth the effort. Rebuilding it gives you more experience anyway.

If you can make a mod (even if buggy), you're not stupid.