Page 1 of 2

A New Problem with LUA (Again) (updated)

Posted: Thu May 19, 2011 1:52 pm
by Slime615
There is a problem here somewhere. But I dont know what it is:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
TDM:Start()

AddAIGoal(1, "Deathmatch", 100)
AddAIGoal(2, "Deathmatch", 100)
end

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()
StealArtistHeap(1536*1024)
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(2097152 + 65536 * 8)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",30) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo

ReadDataFile("ingame.lvl")

-- REP Attacking (attacker is always #1)
local REP = 1
local CIS = 2
-- These variables do not change
local ATT = 1
local DEF = 2

SetTeamAggressiveness(CIS, 1.0)
SetTeamAggressiveness(REP, 1.0)

SetMemoryPoolSize("Music", 40)

ReadDataFile("sound\\geo.lvl;geo1cw")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_commando_leader",
"rep_inf_clone_commando_sniper",
"rep_inf_clone_commando_demospec",
"rep_inf_clone_commando_techspec")
)

ReadDataFile("SIDE\\cis.lvl",
"cis_inf_commando_leader",
"cis_inf_commando_sniper",
"cis_inf_commando_weapspec",
"cis_inf_commando_biospec")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_geoturret")

-- Level Stats

ClearWalkers()
SetMemoryPoolSize("EntityWalker", -1)
AddWalkerType(0, 3) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(2, 3) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponcnt = 240
SetMemoryPoolSize("Aimer", 50)
SetMemoryPoolSize("AmmoCounter", weaponcnt)
SetMemoryPoolSize("BaseHint", 100)
SetMemoryPoolSize("CommandWalker", 1)
SetMemoryPoolSize("EnergyBar", weaponcnt)
SetMemoryPoolSize("EntityFlyer", 6)
SetMemoryPoolSize("EntityHover", 9)
SetMemoryPoolSize("EntityLight", 50)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("MountedTurret", 10)
SetMemoryPoolSize("Navigator", 50)
SetMemoryPoolSize("Obstacle", 450)
SetMemoryPoolSize("PathFollower", 50)
SetMemoryPoolSize("PathNode", 100)
SetMemoryPoolSize("TreeGridStack", 300)
SetMemoryPoolSize("UnitAgent", 50)
SetMemoryPoolSize("UnitController", 50)
SetMemoryPoolSize("Weapon", weaponcnt)

SetSpawnDelay(10.0, 0.25)

SetupTeams{

rep = {
team = REP,
units = 20,
reinforcements = 100,
soldier = {"rep_inf_clone_commando_leader",5,20},
assault = {"rep_inf_clone_commando_demospec",5,20},
engineer = {"rep_inf_clone_commando_techspec",2,20},
sniper = {"rep_inf_clone_commando_sniper",5,20},
},
cis = {
team = CIS,
units = 20,
reinforcements = 100,
soldier = {"cis_inf_commando_leader",5,20},
assault = {"cis_inf_commando_weapspec",5,20},
engineer = {"cis_inf_commando_biospec",5,20},
sniper = {"cis_inf_commando_sniper",5,20},
}
}


-- Attacker Stats

--teamATT = ConquestTeam:New{team = ATT}
--teamATT:AddBleedThreshold(21, 0.75)
--teamATT:AddBleedThreshold(11, 2.25)
--teamATT:AddBleedThreshold(1, 3.0)
--teamATT:Init()
SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(3,ATT)

-- Defender Stats

--teamDEF = ConquestTeam:New{team = DEF}
--teamDEF:AddBleedThreshold(21, 0.75)
--teamDEF:AddBleedThreshold(11, 2.25)
--teamDEF:AddBleedThreshold(1, 3.0)
--teamDEF:Init()
SetTeamAsFriend(DEF,3)

-- Local Stats

SetDenseEnvironment("false")
SetMinFlyHeight(-65)
SetMaxFlyHeight(50)
SetMaxPlayerFlyHeight(50)



-- Birdies
--SetNumBirdTypes(1)
--SetBirdType(0.0,10.0,"dragon")
--SetBirdFlockMinHeight(90.0)

-- Sound

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\geo.lvl", "geo1cw")
OpenAudioStream("sound\\geo.lvl", "geo1cw")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "repleaving")
SetOutOfBoundsVoiceOver(2, "cisleaving")

SetAmbientMusic(REP, 1.0, "rep_GEO_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_GEO_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_GEO_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_GEO_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_GEO_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_GEO_amb_end", 2,1)

SetVictoryMusic(REP, "rep_geo_amb_victory")
SetDefeatMusic (REP, "rep_geo_amb_defeat")
SetVictoryMusic(CIS, "cis_geo_amb_victory")
SetDefeatMusic (CIS, "cis_geo_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")


--ActivateBonus(CIS, "SNEAK_ATTACK")
--ActivateBonus(REP, "SNEAK_ATTACK")

SetAttackingTeam(ATT)

--Opening Satalite Shot
--Geo
--Mountain
AddCameraShot(0.996091, 0.085528, -0.022005, 0.001889, -6.942698, -59.197201, 26.136919)
--Wrecked Ship
AddCameraShot(0.906778, 0.081875, -0.411906, 0.037192, 26.373968, -59.937874, 122.553581)
--War Room
AddCameraShot(0.994219, 0.074374, 0.077228, -0.005777, 90.939568, -49.293945, -69.571136)
end

[/code]

Re: Problem with LUA

Posted: Thu May 19, 2011 1:54 pm
by DarthD.U.C.K.
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_commando_leader",
"rep_inf_clone_commando_sniper",
"rep_inf_clone_commando_demospec",
"rep_inf_clone_commando_techspec")
)
its not that hard to spot. next time you should post the error, often it tells in which line a bracket is missing7expected.

Re: Problem with LUA

Posted: Thu May 19, 2011 1:56 pm
by THEWULFMAN
Hidden/Spoiler:
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_commando_leader",
"rep_inf_clone_commando_sniper",
"rep_inf_clone_commando_demospec",
"rep_inf_clone_commando_techspec")
)

Its an extra bracket actually.

DANG, duck beat me :P

Re: Problem with LUA

Posted: Thu May 19, 2011 2:02 pm
by Slime615
oh. :oops:

EDIT:

Ok, I Now have a second Problem. Again It is proablbly painfull Obvious to some of you, but I cant see it...

I have atemppted to make a new Mode, called Spec opps, which means that it has fused elements of Assalt and Hunt...

It is untested so far.

When I munged, I got this errorr...
Hidden/Spoiler:
[code]C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\CMD\CMDc_surv.lua:82: `}' expected (to close `{' at line 81) near `Commandos'
ERROR[scriptmunge scripts\CMD\CMDc_surv.lua]:Could not read input file.ERROR[scriptmunge scripts\CMD\CMDc_surv.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

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

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

ucft <--
[continuing]
2 Errors 0 Warnings[/code]
I Believe it to be a LUA Error.

Here Is the LUA:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
hunt = ObjectiveTDM:New{teamATT = 3, teamDEF = 4, pointsPerKillATT = 10, pointsPerKillDEF = 10, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}

TDM:Start()

AddAIGoal(1, "Deathmatch", 50)
AddAIGoal(2, "Deathmatch", 50)
end


---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()


SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",70) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",850) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",750) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",8000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",140) -- should be ~1x #combo -- should be ~1x #combo

ReadDataFile("ingame.lvl")

REP = 1
CIS = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\ARC.lvl",
"arc_inf_Ordo")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_commando_leader",
"rep_inf_clone_commando_demospec",
"rep_inf_clone_commando_techspec",
"rep_inf_clone_commando_sniper")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_commando_leader",
"cis_inf_commando_biospec",
"cis_inf_commando_weapspec",
"cis_inf_commando_sniper")

ReadDataFile("dc:SIDE\\eg5.lvl",
"cis_inf_eg5")

--[[ Turrets disabled
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)
--]]
SetupTeams{
Clone Commandos = {
team = REP,
units = 12,
reinforcements = -1,
soldier = { "rep_inf_clone_commando_leader",1,2},
assault = { "rep_inf_clone_commando_demospec",1,2},
engineer= { "rep_inf_clone_commando_techspec",1,2},
sniper = { "rep_inf_clone_commando_sniper", 1,2},
},
}

SetupTeams{
Droid Commandos = {
team = CIS,
units = 12,
reinforcements = -1,
soldier = { "cis_inf_commando_leader",1,2},
assault = { "cis_inf_commando_biospec",1,2},
engineer= { "cis_inf_commando_weapspecl", 1,2},
sniper = { "cis_inf_commando_sniper", 1,2},

},
}

-- SetupTeams{
-- 3 = {
-- team = 3,
-- units = 1,
-- reinforcements = -1,
-- officer = { "arc_inf_Ordo",1},
-- }
-- }

-- SetupTeams{
-- 4 = {
-- team = 4,
-- units = 1,
-- reinforcements = -1,
-- soldier = { "cis_inf_eg5",1},
-- }
-- }


SetTeamAsEnemy(3, CIS)
SetTeamAsEnemy(CIS, 3)
SetTeamAsFriend(REP, 3)
SetTeamAsFriend(3, REP

SetTeamAsEnemy(4, REP)
SetTeamAsEnemy(REP, 4)
SetTeamAsFriend(CIS, 4)
SetTeamAsFriend(4, CIS)

-- 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 = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",41)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 0)
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 23)
SetMemoryPoolSize("UnitController", 23)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:CMD\\CMD.lvl", "CMD_surv")
SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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(REP, REP, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, 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(1, "Allleaving")
SetOutOfBoundsVoiceOver(2, "Impleaving")

SetAmbientMusic(ALL, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(ALL, 0.9, "all_tat_amb_middle", 1,1)
-- SetAmbientMusic(ALL, 0.1, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(IMP, 0.9, "imp_tat_amb_middle", 1,1)
-- SetAmbientMusic(IMP, 0.1, "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")

SetAttackingTeam(ATT)

-- 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
[/code]

Re: A New Problem with LUA (Again)

Posted: Sat May 21, 2011 9:46 am
by THEWULFMAN
Well, just for starters, you dont need the "Droid Commandos = {" and "Clone Commandos = {" lines, remove them.

Re: A New Problem (Again)

Posted: Sat May 21, 2011 9:51 am
by Slime615
I will Update in a sec spotted a problem..

EDIT: Fixed for now.

EDIT 2:

Right, Now there seems to be a new glitch. Now, on the spawn screen, there is no minimap, (where to spawn) and pressing spawn does not do anything....

I can see nothing wrong with my LUA, But here it is:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
hunt = ObjectiveTDM:New{teamATT = 3, teamDEF = 4, pointsPerKillATT = 10, pointsPerKillDEF = 10, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}

TDM:Start()

AddAIGoal(1, "Deathmatch", 50)
AddAIGoal(2, "Deathmatch", 50)
end

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",70) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",850) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",750) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",8000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",140) -- should be ~1x #combo -- should be ~1x #combo

ReadDataFile("ingame.lvl")

REP = 1
CIS = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\ARC.lvl",
"arc_inf_Ordo")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_commando_leader",
"rep_inf_clone_commando_demospec",
"rep_inf_clone_commando_techspec",
"rep_inf_clone_commando_sniper")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_commando_leader",
"cis_inf_commando_biospec",
"cis_inf_commando_weapspec",
"cis_inf_commando_sniper")

ReadDataFile("dc:SIDE\\eg5.lvl",
"cis_inf_eg5")

--[[ Turrets disabled
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)
--]]

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_clone_commando_leader",5, 20},
assault = { "rep_inf_clone_commando_demospec",5, 20},
engineer = { "rep_inf_clone_commando_sniper",5, 20},
sniper = { "rep_inf_clone_commando_techspec",5, 20},

},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_commando_leader",5, 20},
assault = { "cis_inf_commando_sniper",5, 20},
engineer = { "cis_inf_commando_biospec",5, 20},
sniper = { "cis_inf_commando_weapspec",5, 20},
},
}

-- SetupTeams{
-- 3 = {
-- team = 3,
-- units = 1,
-- reinforcements = -1,
-- officer = { "arc_inf_Ordo",1},
-- },
-- }

-- SetupTeams{
-- 4 = {
-- team = 4,
-- units = 1,
-- reinforcements = -1,
-- soldier = { "cis_inf_eg5",1},
-- },
-- }

SetTeamAsEnemy(3, CIS)
SetTeamAsEnemy(CIS, 3)
SetTeamAsFriend(REP, 3)
SetTeamAsFriend(3, REP)

SetTeamAsEnemy(4, REP)
SetTeamAsEnemy(REP, 4)
SetTeamAsFriend(CIS, 4)
SetTeamAsFriend(4, CIS)

-- 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 = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",41)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 0)
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 23)
SetMemoryPoolSize("UnitController", 23)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:CMD\\CMD.lvl", "CMD_surv")
SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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(REP, REP, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, 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(1, "Allleaving")
SetOutOfBoundsVoiceOver(2, "Impleaving")

SetAmbientMusic(ALL, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(ALL, 0.9, "all_tat_amb_middle", 1,1)
-- SetAmbientMusic(ALL, 0.1, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(IMP, 0.9, "imp_tat_amb_middle", 1,1)
-- SetAmbientMusic(IMP, 0.1, "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")

SetAttackingTeam(ATT)

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


[/code]
I believe that the errorr is linked to this:
Hidden/Spoiler:
[code]Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(829)
Unable to find level chunk CMD_surv in C:\Program Files\LucasArts\Star Wars Battlefront II\GameData\AddOn\CMD\Data\_lvl_pc\CMD\CMD.lvl


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


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #2 to `SetBleedingVoiceOver' (number expected, got nil)
stack traceback:
[C]: in function `SetBleedingVoiceOver'
(none): in function `ScriptInit'
[/code]

Re: A New Problem (Again)

Posted: Sat May 21, 2011 2:47 pm
by fasty
The teams in the audio lines should be ALL and IMP. You have some of them for REP that should not be there.
Slime615 wrote:

Code: Select all

    SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
    SetBleedingVoiceOver(REP, IMP, "rep_off_com_report_enemy_losing",   1)
    SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing",   1)
    SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

    SetLowReinforcementsVoiceOver(CIS, REP, "rep_off_defeat_im", .1, 1)
    SetLowReinforcementsVoiceOver(REP, IMP, "rep_off_victory_im", .1, 1)
    SetLowReinforcementsVoiceOver(IMP, IMP, "cis_off_defeat_im", .1, 1)
    SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

    SetAmbientMusic(REP, 1.0, "gen_amb_celebDeathmatch",  0,1)
    -- SetAmbientMusic(REP, 0.9, "rep_tat_amb_middle", 1,1)
    -- SetAmbientMusic(REP, 0.1, "rep_tat_amb_end",    2,1)
    SetAmbientMusic(CIS, 1.0, "gen_amb_celebDeathmatch",  0,1)
    -- SetAmbientMusic(CIS, 0.9, "cis_tat_amb_middle", 1,1)
    -- SetAmbientMusic(CIS, 0.1, "cis_tat_amb_end",    2,1)

    SetVictoryMusic(REP, "rep_tat_amb_victory")
    SetDefeatMusic (REP, "rep_tat_amb_defeat")
    SetVictoryMusic(CIS, "cis_tat_amb_victory")
    SetDefeatMusic (CIS, "cis_tat_amb_defeat")

Change that to this:

Code: Select all

    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(1, "Allleaving")
    SetOutOfBoundsVoiceOver(2, "Impleaving")

    SetAmbientMusic(ALL, 1.0, "gen_amb_celebDeathmatch",  0,1)
    -- SetAmbientMusic(ALL, 0.9, "all_tat_amb_middle", 1,1)
    -- SetAmbientMusic(ALL, 0.1, "all_tat_amb_end",    2,1)
    SetAmbientMusic(IMP, 1.0, "gen_amb_celebDeathmatch",  0,1)
    -- SetAmbientMusic(IMP, 0.9, "imp_tat_amb_middle", 1,1)
    -- SetAmbientMusic(IMP, 0.1, "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")

Re: A New Problem with LUA (Again)

Posted: Sat May 21, 2011 4:56 pm
by Slime615
Ok...


No, still get errorrs..
Hidden/Spoiler:
[code]essage Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(317)
Memory pool "ParticleTransformer::SizeTransf" set item count after being allocated
utility_functions2: ReadDataFile(): This map's code, mode: cmd cmd_surv

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\SkyManager.cpp(122)
Skyfile FarSceneRange is in old format

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


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

[/code]
Here is the LUA
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
hunt = ObjectiveTDM:New{teamATT = 3, teamDEF = 4, pointsPerKillATT = 10, pointsPerKillDEF = 10, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}

TDM:Start()

AddAIGoal(1, "Deathmatch", 50)
AddAIGoal(2, "Deathmatch", 50)
end

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",70) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",850) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",750) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",8000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",140) -- should be ~1x #combo -- should be ~1x #combo

ReadDataFile("ingame.lvl")

REP = 1
CIS = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\ARC.lvl",
"arc_inf_Ordo")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_commando_leader",
"rep_inf_clone_commando_demospec",
"rep_inf_clone_commando_techspec",
"rep_inf_clone_commando_sniper")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_commando_leader",
"cis_inf_commando_biospec",
"cis_inf_commando_weapspec",
"cis_inf_commando_sniper")

ReadDataFile("dc:SIDE\\eg5.lvl",
"cis_inf_eg5")

--[[ Turrets disabled
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)
--]]

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_clone_commando_leader",5, 20},
assault = { "rep_inf_clone_commando_demospec",5, 20},
engineer = { "rep_inf_clone_commando_sniper",5, 20},
sniper = { "rep_inf_clone_commando_techspec",5, 20},

},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_commando_leader",5, 20},
assault = { "cis_inf_commando_sniper",5, 20},
engineer = { "cis_inf_commando_biospec",5, 20},
sniper = { "cis_inf_commando_weapspec",5, 20},
},
}

-- SetupTeams{
-- 3 = {
-- team = 3,
-- units = 1,
-- reinforcements = -1,
-- officer = { "arc_inf_Ordo",1},
-- },
-- }

-- SetupTeams{
-- 4 = {
-- team = 4,
-- units = 1,
-- reinforcements = -1,
-- soldier = { "cis_inf_eg5",1},
-- },
-- }

SetTeamAsEnemy(3, CIS)
SetTeamAsEnemy(CIS, 3)
SetTeamAsFriend(REP, 3)
SetTeamAsFriend(3, REP)

SetTeamAsEnemy(4, REP)
SetTeamAsEnemy(REP, 4)
SetTeamAsFriend(CIS, 4)
SetTeamAsFriend(4, CIS)

-- 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 = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",41)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 0)
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 23)
SetMemoryPoolSize("UnitController", 23)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("SoldierAnimation", 480)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 1770)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 1056)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1210)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:CMD\\CMD.lvl", "CMD_surv")
SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_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(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(CIS, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "repleaving")
SetOutOfBoundsVoiceOver(2, "cisleaving")

SetAmbientMusic(REP, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(REP, 0.9, "rep_tat_amb_middle", 1,1)
-- SetAmbientMusic(REP, 0.1, "rep_tat_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(CIS, 0.9, "cis_tat_amb_middle", 1,1)
-- SetAmbientMusic(CIS, 0.1, "cis_tat_amb_end", 2,1)

SetVictoryMusic(REP, "rep_tat_amb_victory")
SetDefeatMusic (REP, "rep_tat_amb_defeat")
SetVictoryMusic(CIS, "cis_tat_amb_victory")
SetDefeatMusic (CIS, "cis_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")

SetAttackingTeam(ATT)

-- 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
[/code]
Here is the LUA

I did not do as you asked, since the teams are REP and CIS , but I have changed them to what I think is working... but...

Re: A New Problem with LUA (Again)

Posted: Sun May 22, 2011 7:17 am
by DarthD.U.C.K.
does your map have a layer called "surv" in ze? because visualmunge seems to be unable to find it.

Re: A New Problem with LUA (Again)

Posted: Sun May 22, 2011 8:39 am
by Slime615
Not A specific one... I had thought I added a line to it to make it use Conquest Layer...

What was the Line?

SetProperty("*****", "CaptureRegion", "")
For each Line?

YES Thats it the problem, that lin is missing...

Adding it now. Will Updte how it goes..

EDIT:

No, that has not solved it...

New LUA:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
hunt = ObjectiveTDM:New{teamATT = 3, teamDEF = 4, pointsPerKillATT = 10, pointsPerKillDEF = 10, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}

TDM:Start()

AddAIGoal(1, "Deathmatch", 50)
AddAIGoal(2, "Deathmatch", 50)
end

SetProperty("cp1_capture", "CaptureRegion", "")
SetProperty("cp2_capture", "CaptureRegion", "")
SetProperty("cp3_capture", "CaptureRegion", "")
SetProperty("cp4_capture", "CaptureRegion", "")

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",70) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",850) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",750) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",8000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",140) -- should be ~1x #combo -- should be ~1x #combo

ReadDataFile("ingame.lvl")

REP = 1
CIS = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\ARC.lvl",
"arc_inf_Ordo")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_commando_leader",
"rep_inf_clone_commando_demospec",
"rep_inf_clone_commando_techspec",
"rep_inf_clone_commando_sniper")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_commando_leader",
"cis_inf_commando_biospec",
"cis_inf_commando_weapspec",
"cis_inf_commando_sniper")

ReadDataFile("dc:SIDE\\eg5.lvl",
"cis_inf_eg5")

--[[ Turrets disabled
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)
--]]

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_clone_commando_leader",5, 20},
assault = { "rep_inf_clone_commando_demospec",5, 20},
engineer = { "rep_inf_clone_commando_sniper",5, 20},
sniper = { "rep_inf_clone_commando_techspec",5, 20},

},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_commando_leader",5, 20},
assault = { "cis_inf_commando_sniper",5, 20},
engineer = { "cis_inf_commando_biospec",5, 20},
sniper = { "cis_inf_commando_weapspec",5, 20},
},
}

-- SetupTeams{
-- 3 = {
-- team = 3,
-- units = 1,
-- reinforcements = -1,
-- officer = { "arc_inf_Ordo",1},
-- },
-- }

-- SetupTeams{
-- 4 = {
-- team = 4,
-- units = 1,
-- reinforcements = -1,
-- soldier = { "cis_inf_eg5",1},
-- },
-- }

SetTeamAsEnemy(3, CIS)
SetTeamAsEnemy(CIS, 3)
SetTeamAsFriend(REP, 3)
SetTeamAsFriend(3, REP)

SetTeamAsEnemy(4, REP)
SetTeamAsEnemy(REP, 4)
SetTeamAsFriend(CIS, 4)
SetTeamAsFriend(4, CIS)

-- 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 = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",41)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 0)
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 23)
SetMemoryPoolSize("UnitController", 23)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("SoldierAnimation", 480)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 1770)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 1056)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1210)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:CMD\\CMD.lvl", "CMD_surv")
SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_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(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(CIS, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "repleaving")
SetOutOfBoundsVoiceOver(2, "cisleaving")

SetAmbientMusic(REP, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(REP, 0.9, "rep_tat_amb_middle", 1,1)
-- SetAmbientMusic(REP, 0.1, "rep_tat_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(CIS, 0.9, "cis_tat_amb_middle", 1,1)
-- SetAmbientMusic(CIS, 0.1, "cis_tat_amb_end", 2,1)

SetVictoryMusic(REP, "rep_tat_amb_victory")
SetDefeatMusic (REP, "rep_tat_amb_defeat")
SetVictoryMusic(CIS, "cis_tat_amb_victory")
SetDefeatMusic (CIS, "cis_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")

SetAttackingTeam(ATT)

-- 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
[/code]

Re: A New Problem with LUA (Again) (updated)

Posted: Sun May 22, 2011 9:33 am
by DarthD.U.C.K.
that is the problem:

Code: Select all

    ReadDataFile("dc:CMD\\CMD.lvl", "CMD_surv")
you have to rename it to

Code: Select all

    ReadDataFile("dc:CMD\\CMD.lvl", "CMD_conquest")

Re: A New Problem with LUA (Again) (updated)

Posted: Sun May 22, 2011 11:33 am
by Slime615
Ah. Now that thats fixed, I have atempted to add the local sides, and extra code, that will make my Map Uniqe... However:

Error:
Hidden/Spoiler:
[code]C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\CMD\CMDc_surv.lua:106: `}' expected (to close `{' at line 105) near `='
ERROR[scriptmunge scripts\CMD\CMDc_surv.lua]:Could not read input file.ERROR[scriptmunge scripts\CMD\CMDc_surv.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

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

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

ucft <--

2 Errors 0 Warnings

[/code]
LUA :
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
hunt = ObjectiveTDM:New{teamATT = 3, teamDEF = 4, pointsPerKillATT = 10, pointsPerKillDEF = 10, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}

TDM:Start()

AddAIGoal(1, "Deathmatch", 50)
AddAIGoal(2, "Deathmatch", 50)
end

SetProperty("cp1_capture", "CaptureRegion", "")
SetProperty("cp2_capture", "CaptureRegion", "")
SetProperty("cp3_capture", "CaptureRegion", "")
SetProperty("cp4_capture", "CaptureRegion", "")

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",70) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",850) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",750) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",8000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",140) -- should be ~1x #combo -- should be ~1x #combo

ReadDataFile("ingame.lvl")

REP = 1
CIS = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\ARC.lvl",
"arc_inf_Ordo")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_commando_leader",
"rep_inf_clone_commando_demospec",
"rep_inf_clone_commando_techspec",
"rep_inf_clone_commando_sniper")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_commando_leader",
"cis_inf_commando_biospec",
"cis_inf_commando_weapspec",
"cis_inf_commando_sniper")

ReadDataFile("dc:SIDE\\eg5.lvl",
"cis_inf_eg5")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_clone_commando_leader",5, 20},
assault = { "rep_inf_clone_commando_demospec",5, 20},
engineer = { "rep_inf_clone_commando_sniper",5, 20},
sniper = { "rep_inf_clone_commando_techspec",5, 20},

},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_commando_leader",5, 20},
assault = { "cis_inf_commando_sniper",5, 20},
engineer = { "cis_inf_commando_biospec",5, 20},
sniper = { "cis_inf_commando_weapspec",5, 20},
},
}

SetupTeams{
3 = {
team = 3,
units = 1,
reinforcements = -1,
officer = { "arc_inf_Ordo",1},
},
}

SetupTeams{
4 = {
team = 4,
units = 1,
reinforcements = -1,
soldier = { "cis_inf_eg5",1},
},
}

SetTeamAsEnemy(3, CIS)
SetTeamAsEnemy(CIS, 3)
SetTeamAsFriend(REP, 3)
SetTeamAsFriend(3, REP)

SetTeamAsEnemy(4, REP)
SetTeamAsEnemy(REP, 4)
SetTeamAsFriend(CIS, 4)
SetTeamAsFriend(4, CIS)

-- 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 = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",41)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 0)
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 10)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 23)
SetMemoryPoolSize("UnitController", 23)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("SoldierAnimation", 480)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 1770)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 1056)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1210)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:CMD\\CMD.lvl", "CMD_conquest")

SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_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(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(CIS, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "repleaving")
SetOutOfBoundsVoiceOver(2, "cisleaving")

SetAmbientMusic(REP, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(REP, 0.9, "rep_tat_amb_middle", 1,1)
-- SetAmbientMusic(REP, 0.1, "rep_tat_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(CIS, 0.9, "cis_tat_amb_middle", 1,1)
-- SetAmbientMusic(CIS, 0.1, "cis_tat_amb_end", 2,1)

SetVictoryMusic(REP, "rep_tat_amb_victory")
SetDefeatMusic (REP, "rep_tat_amb_defeat")
SetVictoryMusic(CIS, "cis_tat_amb_victory")
SetDefeatMusic (CIS, "cis_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")

SetAttackingTeam(ATT)

-- 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
[/code]

Re: A New Problem with LUA (Again) (updated)

Posted: Sun May 22, 2011 11:59 am
by DarthD.U.C.K.
you have to be carefull with the commas, within "setupteams" a comma is used to seperate the teamsetups, if you have one "setupteams" per team, dont put in a comma.
Hidden/Spoiler:
SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_clone_commando_leader",5, 20},
assault = { "rep_inf_clone_commando_demospec",5, 20},
engineer = { "rep_inf_clone_commando_sniper",5, 20},
sniper = { "rep_inf_clone_commando_techspec",5, 20},

},

cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_commando_leader",5, 20},
assault = { "cis_inf_commando_sniper",5, 20},
engineer = { "cis_inf_commando_biospec",5, 20},
sniper = { "cis_inf_commando_weapspec",5, 20},
},
}

SetupTeams{
3 = {
team = 3,
units = 1,
reinforcements = -1,
officer = { "arc_inf_Ordo",1},
},
}

SetupTeams{
4 = {
team = 4,
units = 1,
reinforcements = -1,
soldier = { "cis_inf_eg5",1},
},
}
and im not sure if you can use teams that are normally used for ambushes as locals.

Re: A New Problem with LUA (Again) (updated)

Posted: Sun May 22, 2011 12:17 pm
by THEWULFMAN
DarthD.U.C.K. wrote:and im not sure if you can use teams that are normally used for ambushes as locals.
I know you can if the team name is GAR (I use it in my Naboo script, which was unused stock lines)

Re: A New Problem with LUA (Again) (updated)

Posted: Sun May 22, 2011 12:27 pm
by Slime615
This has not solved the Bug... But The errorr log now says that the problem is at line 107... thats this:

SetupTeams{
107. 3 = {

Re: A New Problem with LUA (Again) (updated)

Posted: Sun May 22, 2011 12:44 pm
by DarthD.U.C.K.
can yu post the complete lua again please?

Re: A New Problem with LUA (Again) (updated)

Posted: Sun May 22, 2011 12:45 pm
by Slime615
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
hunt = ObjectiveTDM:New{teamATT = 3, teamDEF = 4, pointsPerKillATT = 10, pointsPerKillDEF = 10, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}

TDM:Start()

AddAIGoal(1, "Deathmatch", 50)
AddAIGoal(2, "Deathmatch", 50)
end

SetProperty("cp1_capture", "CaptureRegion", "")
SetProperty("cp2_capture", "CaptureRegion", "")
SetProperty("cp3_capture", "CaptureRegion", "")
SetProperty("cp4_capture", "CaptureRegion", "")

---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",70) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",850) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",750) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",8000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",140) -- should be ~1x #combo -- should be ~1x #combo

ReadDataFile("ingame.lvl")

REP = 1
CIS = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\ARC.lvl",
"arc_inf_Ordo")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_commando_leader",
"rep_inf_clone_commando_demospec",
"rep_inf_clone_commando_techspec",
"rep_inf_clone_commando_sniper")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_commando_leader",
"cis_inf_commando_biospec",
"cis_inf_commando_weapspec",
"cis_inf_commando_sniper")

ReadDataFile("dc:SIDE\\eg5.lvl",
"cis_inf_eg5")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_clone_commando_leader",5, 20},
assault = { "rep_inf_clone_commando_demospec",5, 20},
engineer = { "rep_inf_clone_commando_sniper",5, 20},
sniper = { "rep_inf_clone_commando_techspec",5, 20},

},

cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_commando_leader",5, 20},
assault = { "cis_inf_commando_sniper",5, 20},
engineer = { "cis_inf_commando_biospec",5, 20},
sniper = { "cis_inf_commando_weapspec",5, 20},
}
}

SetupTeams{
3 = {
team = 3,
units = 1,
reinforcements = -1,
officer = { "arc_inf_Ordo",1},
}
}

SetupTeams{
4 = {
team = 4,
units = 1,
reinforcements = -1,
soldier = { "cis_inf_eg5",1},
}
}

SetTeamAsEnemy(3, CIS)
SetTeamAsEnemy(CIS, 3)
SetTeamAsFriend(REP, 3)
SetTeamAsFriend(3, REP)

SetTeamAsEnemy(4, REP)
SetTeamAsEnemy(REP, 4)
SetTeamAsFriend(CIS, 4)
SetTeamAsFriend(4, CIS)

-- 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 = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",41)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 0)
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 10)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 23)
SetMemoryPoolSize("UnitController", 23)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("SoldierAnimation", 480)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 1770)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 1056)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1210)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:CMD\\CMD.lvl", "CMD_conquest")

SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_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(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(CIS, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "repleaving")
SetOutOfBoundsVoiceOver(2, "cisleaving")

SetAmbientMusic(REP, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(REP, 0.9, "rep_tat_amb_middle", 1,1)
-- SetAmbientMusic(REP, 0.1, "rep_tat_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(CIS, 0.9, "cis_tat_amb_middle", 1,1)
-- SetAmbientMusic(CIS, 0.1, "cis_tat_amb_end", 2,1)

SetVictoryMusic(REP, "rep_tat_amb_victory")
SetDefeatMusic (REP, "rep_tat_amb_defeat")
SetVictoryMusic(CIS, "cis_tat_amb_victory")
SetDefeatMusic (CIS, "cis_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")

SetAttackingTeam(ATT)

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

Re: A New Problem with LUA (Again) (updated)

Posted: Sun May 22, 2011 4:33 pm
by AQT
Incorrect things to point out with your LUA:

1. You haven't even defined what teams 3 and 4 are.
2. teamATT can't both be 1 and 3, and teamDEF can't both be 2 and 4.
3. Teams 3 and 4 don't have any goals.
4. All of the teams you set up should all go under one SetupTeams not three.
5.
Hidden/Spoiler:
[quote]SetupTeams{
3 = {
team = 3,
units = 1,
reinforcements = -1,
officer = { "arc_inf_Ordo",1},
}
}

SetupTeams{
4 = {
team = 4,
units = 1,
reinforcements = -1,
soldier = { "cis_inf_eg5",1},
}
}[/quote]
Don't use numbers here; see #1. And see how each team is under one seperate SetupTeams? See #4.

Re: A New Problem with LUA (Again) (updated)

Posted: Mon May 23, 2011 3:07 am
by Slime615
Ok Thats alot of errorrs....


1) WHat should the LUA Look Like then?

2) Also, I have been trying to set up the mode so that killing the regulaer units earn 0 points, and killing the special units, (arc_inf_Ordo and cis_inf_eg5)

I tryed to do this by adding:
Hidden/Spoiler:
Hunt = ObjectiveTDM:New{teamATT = 3, teamDEF = 4, pointsPerKillATT = 10, pointsPerKillDEF = 10, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}
How could I do this then?

Re: A New Problem with LUA (Again) (updated)

Posted: Mon May 23, 2011 9:38 am
by DarthD.U.C.K.
1. take a look at a shipped lua with multiple teams:
cor1c_c wrote:ATT = 1
DEF = 2
GAR = DEF --the dorky looking naboo guards
RUN = 5 --the flag runners
BOS = 6 --the boss team (several powerful jedi)

AMB = 3 --the "JED" team is actually the extra henchmen jedis that surround the boss jedis at the last objective
REP = ATT --the player is on the republic team
thats how the threeletter teamnames are assigned to teamnumbers