Page 1 of 1

Glitch on le Death Star [Solved]

Posted: Mon Jun 13, 2011 12:40 am
by Havoc 526
I don't know what to make of this, I have no idea WHY this happens. I have done manual cleans, I have changed sides, I have done everything I can think of to fix this and still NOTHING works.

Okay, so on the Death Star, using a script that I modified to use my custom sides with, it appears that the attacking team, whenever one soldier is killed, the reinforcements go down by two. This makes it very difficult for the attacking team to win the battle. The kicker is that when the reinforcement count goes to zero, there are still about 10 units of the team left on the field! Thats right! Maybe even more!

I'll post the lua script, since I know that's what you experts want. :)
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------

function ScriptPostLoad()

TrashStuff();
PlayAnimExtend();
PlayAnimTakExtend();

BlockPlanningGraphArcs("compactor")
OnObjectKillName(CompactorConnectionOn, "grate01")

DisableBarriers("start_room_barrier")
DisableBarriers("dr_left")
DisableBarriers("circle_bar1")
DisableBarriers("circle_bar2")

-- handle reinforcment loss and defeat condition
OnCharacterDeathTeam(function(character, killer) AddReinforcements(1, -1) end, 1)
OnTicketCountChange(function(team, count) if count == 0 then MissionDefeat(team) end end)

OnObjectRespawnName(PlayAnimExtend, "Panel-Chasm");
OnObjectKillName(PlayAnimRetract, "Panel-Chasm");

OnObjectRespawnName(PlayAnimTakExtend, "Panel-Tak");
OnObjectKillName(PlayAnimTakRetract, "Panel-Tak");

EnableSPHeroRules()
KillObject("CP6")
cp1 = CommandPost:New{name = "CP1"}
cp2 = CommandPost:New{name = "CP2"}
cp3 = CommandPost:New{name = "CP3"}
cp4 = CommandPost:New{name = "CP4"}
cp5 = CommandPost:New{name = "CP5"}
--cp6 = CommandPost:New{name = "CP6"}
cp7 = CommandPost:New{name = "CP7"}

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

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

conquest:Start()

AddDeathRegion("DeathRegion01")
AddDeathRegion("DeathRegion02")
AddDeathRegion("DeathRegion03")
AddDeathRegion("DeathRegion04")
AddDeathRegion("DeathRegion05")

end

function CompactorConnectionOn()
UnblockPlanningGraphArcs ("compactor")
end
--START BRIDGEWORK!

-- OPEN
function PlayAnimExtend()
PauseAnimation("bridgeclose");
RewindAnimation("bridgeopen");
PlayAnimation("bridgeopen");

-- allow the AI to run across it
UnblockPlanningGraphArcs("Connection122");
DisableBarriers("BridgeBarrier");

end
-- CLOSE
function PlayAnimRetract()
PauseAnimation("bridgeopen");
RewindAnimation("bridgeclose");
PlayAnimation("bridgeclose");

-- prevent the AI from running across it
BlockPlanningGraphArcs("Connection122");
EnableBarriers("BridgeBarrier");

end

--START BRIDGEWORK TAK!!!

-- OPEN
function PlayAnimTakExtend()
PauseAnimation("TakBridgeOpen");
RewindAnimation("TakBridgeClose");
PlayAnimation("TakBridgeClose");

-- allow the AI to run across it
UnblockPlanningGraphArcs("Connection128");
DisableBarriers("Barrier222");

end
-- CLOSE
function PlayAnimTakRetract()
PauseAnimation("TakBridgeClose");
RewindAnimation("TakBridgeOpen");
PlayAnimation("TakBridgeOpen");

-- prevent the AI from running across it
BlockPlanningGraphArcs("Connection128");
EnableBarriers("Barrier222");

end

function TrashStuff()

trash_open = 1
trash_closed = 0

trash_timer = CreateTimer("trash_timer")
SetTimerValue(trash_timer, 7)
StartTimer(trash_timer)
trash_death = OnTimerElapse(
function(timer)
if trash_open == 1 then
AddDeathRegion("deathregion")
SetTimerValue(trash_timer, 5)
StartTimer(trash_timer)
trash_closed = 1
trash_open = 0
print("death region added")

elseif trash_closed == 1 then
RemoveRegion("deathregion")
SetTimerValue(trash_timer, 15)
StartTimer(trash_timer)
print("death region removed")
trash_closed = 0
trash_open = 1
end
end,
trash_timer
)
end


function ScriptInit()
StealArtistHeap(650*1024)
-- Designers, these two lines *MUST* be first.
SetPS2ModelMemory(4200000)
ReadDataFile("dc:ingame.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:ingame.lvl")

AISnipeSuitabilityDist(30)

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

SetMemoryPoolSize ("ClothData",40)
SetMemoryPoolSize ("Combo",100) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",1300) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",1300) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",1300) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",1100) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",15000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",200) -- should be ~1x #combo

ReadDataFile("sound\\dea.lvl;dea1cw")
ReadDataFile("dc:sound\\ABC.lvl;ABCcw")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep2_sniper",
"rep_inf_ep3_officer",
"rep_inf_assassin",
"rep_inf_commando",
"rep_inf_ep3_pyro",
"rep_inf_ep3_commander",
"rep_hero_maloc")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_inf_recon",
"cis_inf_commando",
"cis_inf_commander",
"cis_hero_emperor")

ReadDataFile("dc:SIDE\\501.lvl",
"rep_inf_501_rifleman",
"rep_inf_501_rocketeer",
"rep_inf_501_sniper",
"rep_inf_501_officer",
"rep_inf_501_engineer",
"rep_inf_501_pyro",
"rep_inf_501_commander",
"cis_inf_rifleman")

SetupTeams{
rep = {
team = REP,
units = 32,
reinforcements = 200,
soldier = { "rep_inf_501_rifleman",7,25},
assault = { "rep_inf_501_rocketeer",1,4},
engineer = { "rep_inf_501_engineer",1,4},
sniper = { "rep_inf_501_sniper",1,4},
officer = {"rep_inf_501_officer",1,4},
special = { "rep_inf_assassin",1,4},

},
cis = {
team = CIS,
units = 32,
reinforcements = 200,
soldier = { "cis_inf_rifleman",7,25},
assault = { "cis_inf_rocketeer",1,4},
engineer = { "cis_inf_engineer",1,14},
sniper = { "cis_inf_sniper",1,4},
officer = {"cis_inf_officer",1,4},
special = { "cis_inf_droideka",1,4},
}
}

AddUnitClass(REP,"rep_inf_ep3_pyro",1,2)
AddUnitClass(REP,"rep_inf_commando",1,2)
AddUnitClass(REP,"rep_inf_501_commander",0,1)
AddUnitClass(CIS,"cis_inf_recon",1,2)
AddUnitClass(CIS,"cis_inf_commando",1,2)
AddUnitClass(CIS,"cis_inf_commander",0,1)

SetHeroClass(CIS, "cis_hero_emperor")
SetHeroClass(REP, "rep_hero_maloc")


-- Level Stats
ClearWalkers()
AddWalkerType(0, 2)
local weaponNum = 220
SetMemoryPoolSize ("Aimer", 10)
SetMemoryPoolSize ("AmmoCounter", weaponNum)
SetMemoryPoolSize ("BaseHint", 300)
SetMemoryPoolSize ("EnergyBar", weaponNum)
SetMemoryPoolSize ("EntityFlyer", 6)
SetMemoryPoolSize ("EntityLight", 100)
SetMemoryPoolSize ("EntitySoundStatic", 30)
SetMemoryPoolSize ("MountedTurret", 2)
SetMemoryPoolSize ("Navigator", 45)
SetMemoryPoolSize ("Obstacle", 270)
SetMemoryPoolSize ("PathFollower", 45)
SetMemoryPoolSize ("PathNode", 512)
SetMemoryPoolSize ("SoundSpaceRegion", 50)
SetMemoryPoolSize ("TreeGridStack", 250)
SetMemoryPoolSize ("Weapon", weaponNum)


-- SetMemoryPoolSize("Obstacle", 725)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("dea\\dea1.lvl", "dea1_Conquest")
SetDenseEnvironment("false")

SetMaxFlyHeight(72)
SetMaxPlayerFlyHeight(72)

-- Sound Stats

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\\dea.lvl", "dea1")
OpenAudioStream("sound\\dea.lvl", "dea1")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
--OpenAudioStream("sound\\dea.lvl", "dea1_emt")

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_dea_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_dea_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2,"rep_dea_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_dea_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_dea_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2,"cis_dea_amb_end", 2,1)

SetVictoryMusic(REP, "rep_dea_amb_victory")
SetDefeatMusic (REP, "rep_dea_amb_defeat")
SetVictoryMusic(CIS, "cis_dea_amb_victory")
SetDefeatMusic (CIS, "cis_dea_amb_defeat")

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


-- Camera Stats
--Tat 1 - Dune Sea
--Crawler
AddCameraShot(-0.404895, 0.000992, -0.514360, -0.002240, -121.539894, 62.536297, -257.699493)
--Homestead
AddCameraShot(0.040922, -0.004049, -0.994299, -0.098381, -103.729523, 55.546598, -225.360893)
--Sarlac Pit
AddCameraShot(-1.0, 0.0, -0.514360, 0.0, -55.381485, 50.450953, -96.514324)

end
Can somebody help me? I'm afraid to even make another new era to take place on this map just because of this glitch!

EDIT: Gosh darn it, I did it again! Can somebody move this to the modding forum? :oops:

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 12:50 am
by AQT
You do realize that this problem already exists with the stock script, right? Just remove the following line:

Code: Select all

OnCharacterDeathTeam(function(character, killer) AddReinforcements(1, -1) end, 1)

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 1:28 am
by sim-al2
Question: Does anyone know why that was even there? Some kind of test they forgot to fix?

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 3:43 am
by DarthD.U.C.K.
pandemic added it on purpose. because the deatchstar has an uneven layout that gives the defenders a disadvatage, they added the double reincforcementloss for the attacker to balance it out if i remember right.

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 7:49 am
by Maveritchell
DarthD.U.C.K. wrote:pandemic added it on purpose. because the deatchstar has an uneven layout that gives the defenders a disadvatage, they added the double reincforcementloss for the attacker to balance it out if i remember right.
All the maps in the game are slightly uneven, which is fine. This is likely left in there as a mistake from when they were writing conquest mode - as a balancing method this is a particularly bad choice, and more playtesting would have revealed this. I have to believe that no one sat down and said "this would be the best way to make things fair for both teams."

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 8:39 am
by Marvel4
They probably didn't want to make it fair, a small rebel army vs a whole space station should be very hard... :wink:

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 9:23 am
by THEWULFMAN
I was told that the Death Star was the last map made for BF2, it was graphically done well, but the balance was bad and they had the least amount of time to test it compared to the other maps. It is a good MP map, but I never play it SP.

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 10:54 am
by Twilight_Warrior
And I was told that Lucasarts was giving away free money near the release date of SWBF2, but unless I provide a source, no one is going to believe me =p

Anyway, I've noticed this since before I joined GT.
STORY TIME!
Hidden/Spoiler:
So this one time, I was playing Death Star as the Republic. The CPs were evenly distrubuted most of the game (3-3), but my team was losing. Badly. I was like "wtf?" so I pushed harder and got 5 of the CPs. Then we lost. Not one point in that match did the Republic have less than 3 CPs. I was sad.
Anyway, is there a mod already out there that fixes it permanently for the stock game?

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 11:19 am
by Xavious
THEWULFMAN wrote:I was told that the Death Star was the last map made for BF2, it was graphically done well, but the balance was bad and they had the least amount of time to test it compared to the other maps. It is a good MP map, but I never play it SP.
If you look at the loadscreens for the Death Star, some of them still have the green CPs in them, which most likely means they had the map done in the earlier stages of the game's development.
Twilight_Warrior wrote:Anyway, is there a mod already out there that fixes it permanently for the stock game?

Yes, but you won't be able to play online with others who don't have it, of course. (Click)

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 11:35 am
by Marvel4
I just played through the map again, it's almost impossible to win, I think I'll change that in my mod... :P

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 4:19 pm
by THEWULFMAN
Xavious wrote:
THEWULFMAN wrote:I was told that the Death Star was the last map made for BF2, it was graphically done well, but the balance was bad and they had the least amount of time to test it compared to the other maps. It is a good MP map, but I never play it SP.
If you look at the loadscreens for the Death Star, some of them still have the green CPs in them, which most likely means they had the map done in the earlier stages of the game's development.
Not to mention the trailer with the old rebel setup with the pilot. I must have gotten it mixed up, it was not the Death Star, I forget which map it was that was developed last. Anyway, I get to walk away in shame, again :P :runaway:

Sometimes I wonder why I bother. And TW, that was uncalled for.

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 5:50 pm
by Dakota
i just wanted to point out that the death star is a bit glitchy sometimes with things like that.

i was on my dedicated and the ai was at max and i was empire with a few of my friends (a few were rebel) the battle was insane. the rebel reinforcements went from 0 to 1000+ at least 3 times untill we got all of the cps for the empire and won, our reinforcements didn't go down to 0 at all, if i recall right we had at least 400+ reinforcements at the end. that was kinda weird.

Re: Glitch on le Death Star

Posted: Mon Jun 13, 2011 6:14 pm
by Havoc 526
Yeah, so anyway, I kinda realized how to fix the problem immediately after posting this topic, so I felt like a total moron for not catching it earlier. Thanks for the help, guys!

Although, if you want my opinion, I think they put that there to troll us.


...Clever. Very clever.

Re: Glitch on le Death Star [Solved]

Posted: Fri Jun 17, 2011 1:23 pm
by FighterRex
There's a fix for it on swbffiles.com, in case you're wondering:

http://starwarsbattlefront.filefront.co ... _Fix;86515

Re: Glitch on le Death Star [Solved]

Posted: Fri Jun 17, 2011 3:37 pm
by AQT
@FighterRex: Xavious had already linked to it in this same exact topic (http://www.gametoast.com/forums/viewtop ... 18#p450118). You should really learn to read posts over more carefully to avoid the reposting of information.