A New Problem with LUA (Again) (updated)

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

Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

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

Post by Slime615 »

Eh?

Sorry guys, some one is going to have to spell this out to me...

How would I apply this to my Map? I have hadd a hard day of exams, so learning new things is trickey at the moment...
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

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

Post by THEWULFMAN »

I sat down and finally went over the script, I think I have it working. It munges, but I couldn't test it ingame.
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 = 3, teamDEF = 4,
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)
AddAIGoal(3, "Deathmatch", 50)
AddAIGoal(4, "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
ARC = 3
EGD = 4
-- 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},
},


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


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

SetTeamAsEnemy(ARC, CIS)
SetTeamAsEnemy(CIS, ARC)
SetTeamAsFriend(REP, ARC)
SetTeamAsFriend(ARC, REP)

SetTeamAsEnemy(EGD, REP)
SetTeamAsEnemy(REP, EGD)
SetTeamAsFriend(CIS, EGD)
SetTeamAsFriend(EGD, CIS)

SetTeamAsEnemy(ARC, EGD)
SetTeamAsEnemy(EGD, ARC)

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

My Lua Project

Post by Slime615 »

LUA Project:

Essencialy, a Assalt mode/Unlimitedtime Hunt Mode, where you only get points for killing certain Units...
and none (idealy) for killing other units...

Unfortuanatly I have two problems:
1) The Local SIdes (the ones needed to be killed) wont spawn...
2) I do not think that the code I am using works (Although withiout the units spawning it is hard to test...

I would be greatfull for any help offered...

LUA:
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 = 3, teamDEF = 4,
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)
AddAIGoal(3, "Deathmatch", 50)
AddAIGoal(4, "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
ARC = 3
EGD = 4
-- 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},
},


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


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

SetTeamAsEnemy(ARC, CIS)
SetTeamAsEnemy(CIS, ARC)
SetTeamAsFriend(REP, ARC)
SetTeamAsFriend(ARC, REP)

SetTeamAsEnemy(EGD, REP)
SetTeamAsEnemy(REP, EGD)
SetTeamAsFriend(CIS, EGD)
SetTeamAsFriend(EGD, CIS)

SetTeamAsEnemy(ARC, EGD)
SetTeamAsEnemy(EGD, ARC)

-- 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 = 188
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", 34)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 32)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 10)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 34)
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
Topics merged, -Staff
User avatar
skelltor
Sith
Sith
Posts: 1431
Joined: Fri Dec 11, 2009 6:24 pm
Projects :: BFSM
Games I'm Playing :: SWBFII
xbox live or psn: skelltor95
Location: minisnowta
Contact:

Re: My Lua Project

Post by skelltor »

How is this topic different from this one? http://www.gametoast.com/forums/viewtop ... 27&t=26056
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

Re: My Lua Project

Post by Slime615 »

Simple. That topic is about individual Bugs and CTDs that occur as a result of the LUA, while this one is a topic dedicated to actualy finding out whatcode works... Simply put, this one is working outthe LUA, while that one is fixing it when It breaks,... Which will...
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: My Lua Project

Post by DarthD.U.C.K. »

if you dont want somebody else to write the lua for you here, this topic isnt different from the initial one.
anyway, as i said before locals are set up differently. your extrateams are set up like ambushteams. that could be the reason why they dont spawn. do you have any errors in the bfront2log? do the mainteams span in other modes?
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

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

Post by Slime615 »

Ok, that is my Lua Up there. Does anyone know why The locals wont spawn?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: My Lua Project

Post by DarthD.U.C.K. »

DarthD.U.C.K. wrote:anyway, as i said before locals are set up differently. your extrateams are set up like ambushteams. that could be the reason why they dont spawn. do you have any errors in the bfront2log? do the mainteams spawn in other modes?
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

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

Post by Slime615 »

Eh? How Have I set them up wrong then?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

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

Post by DarthD.U.C.K. »

you didnt set them up like that
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

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

Post by Slime615 »

Like what? How should I have set them up then?
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

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

Post by THEWULFMAN »

DarthD.U.C.K. wrote:you didnt set them up like that
Slime615
Lieutenant General
Lieutenant General
Posts: 704
Joined: Thu Jan 07, 2010 9:38 am

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

Post by Slime615 »

Oh, I did not see that was a hyperlink.

Ok, Getting sick of this now... I still am having probs.... Here is the Erorr.
Hidden/Spoiler:
[code]C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\CMD\CMDc_surv.lua:111: `}' expected (to close `{' at line 88) near `AddUnitClass'
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]
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 = 3, teamDEF = 4,
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", 100)
AddAIGoal(2, "Deathmatch", 100)
AddAIGoal(3, "Deathmatch", 100)
AddAIGoal(4, "Deathmatch", 100)
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
ARC = 3
EGD = 4
-- 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_laser",
"tur_bldg_tower")

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

SetTeamName (3, "Arcs")
AddUnitClass (3, "arc_inf_Ordo", 1,1)
SetUnitCount (1, 10)
AddAIGoal(3, "Deathmatch", 100)

SetTeamName (4, "Eg5s")
AddUnitClass (4, "cis_inf_eg5", 1,1)
SetUnitCount (1, 10)
AddAIGoal(4, "Deathmatch", 100)
}

SetTeamAsEnemy(ARC, CIS)
SetTeamAsEnemy(CIS, ARC)
SetTeamAsFriend(REP, ARC)
SetTeamAsFriend(ARC, REP)

SetTeamAsEnemy(EGD, REP)
SetTeamAsEnemy(REP, EGD)
SetTeamAsFriend(CIS, EGD)
SetTeamAsFriend(EGD, CIS)

SetTeamAsEnemy(ARC, EGD)
SetTeamAsEnemy(EGD, ARC)

-- 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 = 188
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", 34)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 32)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 10)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 34)
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]
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

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

Post by DarthD.U.C.K. »

you have put the brackets wrong again
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},
},


SetTeamName (3, "Arcs")
AddUnitClass (3, "arc_inf_Ordo", 1,1)
SetUnitCount (1, 10)
AddAIGoal(3, "Deathmatch", 100)

SetTeamName (4, "Eg5s")
AddUnitClass (4, "cis_inf_eg5", 1,1)
SetUnitCount (1, 10)
AddAIGoal(4, "Deathmatch", 100)
}
but they have to be like this
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},
}
}


SetTeamName (3, "Arcs")
AddUnitClass (3, "arc_inf_Ordo", 1,1)
SetUnitCount (1, 10)
AddAIGoal(3, "Deathmatch", 100)

SetTeamName (4, "Eg5s")
AddUnitClass (4, "cis_inf_eg5", 1,1)
SetUnitCount (1, 10)
AddAIGoal(4, "Deathmatch", 100)
its nice that you try things out yourself but when you essencially hust have to copy a part from the tutorial or assets, you shouldnt modify it if its works.
Post Reply