Team 3 Reinforcements?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
fasty
1st Lieutenant
1st Lieutenant
Posts: 438
Joined: Thu Apr 15, 2010 4:17 am
Projects :: Server modding
Games I'm Playing :: SWBF2
Contact:

Team 3 Reinforcements?

Post by fasty »

Hey guys, I'm trying to make it so when you kill a unit on team 3, team 1 loses a reinforcement ticket. I can't think of any instances in the stock game where this happens and a search through stock luas and GT searching was unsuccessful. It seems simple enough and likely possible so how can I do it?

My lua:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
Conquest = ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_DoFile("setup_teams")

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

-- Empire Attacking (attacker is always #1)
CIS = ATT
REP = DEF

---------------------------------------------------------------------------
-- 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()
SetAIDifficulty(10, 10, "hard")
ClearAIGoals( 1 )
ClearAIGoals( 2 )
AddAIGoal(CIS, "Deathmatch", 1)
AddAIGoal( 2, "Destroy", 99, 0 )
AddAIGoal( 1, "Destroy", 99, 0 )


AddDeathRegion("death")
AddDeathRegion("death1")
AddDeathRegion("death2")
AddDeathRegion("death3")
AddDeathRegion("death4")




SetProperty ("LibCase1","MaxHealth",1000)
SetProperty ("LibCase2","MaxHealth",1000)
SetProperty ("LibCase3","MaxHealth",1000)
SetProperty ("LibCase4","MaxHealth",1000)
SetProperty ("LibCase5","MaxHealth",1000)
SetProperty ("LibCase6","MaxHealth",1000)
SetProperty ("LibCase7","MaxHealth",1000)
SetProperty ("LibCase8","MaxHealth",1000)
SetProperty ("LibCase9","MaxHealth",1000)
SetProperty ("LibCase10","MaxHealth",1000)
SetProperty ("LibCase11","MaxHealth",1000)
SetProperty ("LibCase12","MaxHealth",1000)
SetProperty ("LibCase13","MaxHealth",1000)
SetProperty ("LibCase14","MaxHealth",1000)


SetProperty ("LibCase1","CurHealth",1000)
SetProperty ("LibCase2","CurHealth",1000)
SetProperty ("LibCase3","CurHealth",1000)
SetProperty ("LibCase4","CurHealth",1000)
SetProperty ("LibCase5","CurHealth",1000)
SetProperty ("LibCase6","CurHealth",1000)
SetProperty ("LibCase7","CurHealth",1000)
SetProperty ("LibCase8","CurHealth",1000)
SetProperty ("LibCase9","CurHealth",1000)
SetProperty ("LibCase10","CurHealth",1000)
SetProperty ("LibCase11","CurHealth",1000)
SetProperty ("LibCase12","CurHealth",1000)
SetProperty ("LibCase13","CurHealth",1000)
SetProperty ("LibCase14","CurHealth",1000)



EnableSPHeroRules()

DisableBarriers("SideDoor1")
DisableBarriers("MainLibraryDoors")
DisableBarriers("SideDoor2")
DisableBarriers("SIdeDoor3")
DisableBarriers("ComputerRoomDoor1")
DisableBarriers("StarChamberDoor1")
DisableBarriers("StarChamberDoor2")
DisableBarriers("WarRoomDoor1")
DisableBarriers("WarRoomDoor2")
DisableBarriers("WarRoomDoor3")
PlayAnimation("DoorOpen01")
PlayAnimation("DoorOpen02")


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

--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}
SetAIViewMultiplier(0.99)

--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:Start()
SetProperty("CP1", "Team","2")
SetProperty("CP3", "Team","3")
SetProperty("CP2", "Team","1")
SetProperty("CP4", "Team","1")
SetProperty("CP1", "CaptureRegion","fake_cp")
SetProperty("CP2", "CaptureRegion","fake_cp")
SetProperty("CP3", "CaptureRegion","fake_cp")
SetProperty("CP4", "CaptureRegion","fake_cp")
SetProperty("CP5", "CaptureRegion","fake_cp")
SetProperty("CP6", "CaptureRegion","fake_cp")
end

function ScriptInit()
-- Designers, these two lines *MUST* be first.

SetPS2ModelMemory(4056000)

SetMapNorthAngle(180, 1)
SetMaxFlyHeight(25)
SetMaxPlayerFlyHeight (25)
AISnipeSuitabilityDist(99)


SetMemoryPoolSize ("ClothData",60)
SetMemoryPoolSize ("Combo",90) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",1500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",1500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",1500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",1200) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",12000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",250) -- should be ~1x #combo

ReadDataFile("ingame.lvl")
SetTeamAggressiveness(REP, 1.00)
SetTeamAggressiveness(CIS, 1.00)


ReadDataFile("sound\\cor.lvl;cor1cw")



ReadDataFile("dc:SIDE\\geg.lvl",
"cis_hero_grievous",
"imp_inf_royalguard")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_hero_jangofett3",
"cis_hero_jangofett4",
"cis_hero_jangofett6",
"cis_hero_jangofett5",
"cis_hero_jangofett2",
"cis_hero_jangofett")

SetupTeams{

rep = {
team = REP,
units = 32,
reinforcements = 10,
soldier = { "cis_hero_jangofett3", 0, 0},
engineer = { "cis_hero_jangofett5",0, 0},
sniper = { "cis_hero_jangofett6",0, 0},
officer = { "cis_hero_jangofett2",0, 0},
special = { "cis_hero_jangofett",0,0},

},
cis = {
team = CIS,
units = 32,
reinforcements = 10,
soldier = { "imp_inf_royalguard", 0,0},
engineer = { "cis_hero_grievous",0, 0},

},}
SetTeamName(3, "heros")
SetUnitCount(3, 1)
AddUnitClass(3, "imp_inf_royalguard", 1)
AddUnitClass(3, "cis_hero_grievous", 1)
AddAIGoal(3, "Deathmatch", 100)
SetTeamAsFriend(3, ATT)
SetTeamAsFriend(ATT, 3)
SetTeamAsEnemy(3, DEF)
SetTeamAsEnemy(DEF, 3)


-- Level Stats
ClearWalkers()
AddWalkerType(0, 3) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(1, 0) --
AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponCnt = 230
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("EntityFlyer", 4)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("cor\\cor1.lvl","cor1_Conquest")
SetDenseEnvironment("True")
-- SetMaxFlyHeight(25)
--SetMaxPlayerFlyHeight (25)
AddDeathRegion("DeathRegion1")

-- 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\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_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(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rep_cor_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_cor_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_cor_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_cor_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_cor_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_cor_amb_end", 2,1)

SetVictoryMusic(REP, "rep_cor_amb_victory")
SetDefeatMusic (REP, "rep_cor_amb_defeat")
SetVictoryMusic(CIS, "cis_cor_amb_victory")
SetDefeatMusic (CIS, "cis_cor_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
AddCameraShot(0.419938, 0.002235, -0.907537, 0.004830, -15.639358, 5.499980, -176.911179);
AddCameraShot(0.994506, 0.104463, -0.006739, 0.000708, 1.745251, 5.499980, -118.700668);
AddCameraShot(0.008929, -0.001103, -0.992423, -0.122538, 1.366768, 16.818106, -114.422173);
AddCameraShot(0.761751, -0.117873, -0.629565, -0.097419, 59.861904, 16.818106, -81.607773);
AddCameraShot(0.717110, -0.013583, 0.696703, 0.013197, 98.053314, 11.354497, -85.857857);
AddCameraShot(0.360958, -0.001053, -0.932577, -0.002721, 69.017578, 18.145807, -56.992413);
AddCameraShot(-0.385976, 0.014031, -0.921793, -0.033508, 93.111061, 18.145807, -20.164375);
AddCameraShot(0.695468, -0.129569, -0.694823, -0.129448, 27.284357, 18.145807, -12.377695);
AddCameraShot(0.009002, -0.000795, -0.996084, -0.087945, 1.931320, 13.356332, -16.410583);
AddCameraShot(0.947720, -0.145318, 0.280814, 0.043058, 11.650738, 16.955814, 28.359180);
AddCameraShot(0.686380, -0.127550, 0.703919, 0.130810, -30.096384, 11.152356, -63.235146);
AddCameraShot(0.937945, -0.108408, 0.327224, 0.037821, -43.701199, 8.756138, -49.974789);
AddCameraShot(0.531236, -0.079466, -0.834207, -0.124787, -62.491230, 10.305247, -120.102989);
AddCameraShot(0.452286, -0.179031, -0.812390, -0.321572, -50.015198, 15.394646, -114.879379);
AddCameraShot(0.927563, -0.243751, 0.273918, 0.071982, 26.149965, 26.947924, -46.834148);

end


[/code]
User avatar
Firefang
Major
Major
Posts: 518
Joined: Mon Nov 15, 2010 8:55 pm
Location: California

Re: Team 3 Reinforcements?

Post by Firefang »

How many reinforcements do you want overall?
genaral_mitch
Jedi
Jedi
Posts: 1056
Joined: Fri Aug 14, 2009 12:32 am

Re: Team 3 Reinforcements?

Post by genaral_mitch »

Firefang wrote:How many reinforcements do you want overall?
That's not important.
I don't have a clue if this would work, but I'm just guessing.
Hidden/Spoiler:
SetTeamName(3, "heros")
reinforcements = 10,

SetUnitCount(3, 1)
AddUnitClass(3, "imp_inf_royalguard", 1)
AddUnitClass(3, "cis_hero_grievous", 1)
AddAIGoal(3, "Deathmatch", 100)
SetTeamAsFriend(3, ATT)
SetTeamAsFriend(ATT, 3)
SetTeamAsEnemy(3, DEF)
SetTeamAsEnemy(DEF, 3)
fasty
1st Lieutenant
1st Lieutenant
Posts: 438
Joined: Thu Apr 15, 2010 4:17 am
Projects :: Server modding
Games I'm Playing :: SWBF2
Contact:

Re: Team 3 Reinforcements?

Post by fasty »

genaral_mitch wrote: I don't have a clue if this would work, but I'm just guessing.
Hidden/Spoiler:
SetTeamName(3, "heros")
reinforcements = 10,

SetUnitCount(3, 1)
AddUnitClass(3, "imp_inf_royalguard", 1)
AddUnitClass(3, "cis_hero_grievous", 1)
AddAIGoal(3, "Deathmatch", 100)
SetTeamAsFriend(3, ATT)
SetTeamAsFriend(ATT, 3)
SetTeamAsEnemy(3, DEF)
SetTeamAsEnemy(DEF, 3)
Now they stop spawning after I get 10 kills but the team 1 reinforcement count stays the same.
So I defeated all of team 3 but the games still going because team 1 still has reinforcements. :x
Image
User avatar
Firefang
Major
Major
Posts: 518
Joined: Mon Nov 15, 2010 8:55 pm
Location: California

Re: Team 3 Reinforcements?

Post by Firefang »

This might work. I haven't tested it.
Hidden/Spoiler:
Objective1= ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF, text = "localized text", popupText = "localized text"}
Objective1.OnStart = function (self)

local characterindex = GetTeamMember(3, 0)
BatchChangeTeams(3, ATT, 1)
SetHeroClass(CIS, "name of unit")
local classindex = AddUnitClass(ATT, "name of unit", 1, 1)
SelectCharacterClass(characterindex, classindex)
SpawnCharacter(characterindex, GetPathPoint("path", 0))
end

Hero = TargetType:New{classname = "name of unit", killLimit = 10}
Objective1:AddTarget(Hero)

Objective1.OnComplete = function(self)
ShowMessageText("localized text here", ATT)
end
EDIT
Nevermind
fasty
1st Lieutenant
1st Lieutenant
Posts: 438
Joined: Thu Apr 15, 2010 4:17 am
Projects :: Server modding
Games I'm Playing :: SWBF2
Contact:

Re: Team 3 Reinforcements?

Post by fasty »

I ended up scraping the team 3 part and just having it be team 1 versus team 2. With this:

Code: Select all

            units = 1,
            reinforcements = 10,
        soldier = { "imp_inf_royalguard",    1,1},
        engineer = { "cis_hero_grievous",1, 1},
Thanks Firefang for helping over Xfire.
I still would like to know if its possible to link team 3's reinforcements with team 1's if anyone knows 8) .
User avatar
thedarkforce
Private Third Class
Posts: 57
Joined: Wed Nov 17, 2010 8:05 am
Projects :: Le celeste
Games I'm Playing :: swbf2 and swbf1
Location: Paris. France/French

Re: Team 3 Reinforcements?

Post by thedarkforce »

How do you add a third team like in battlefront 1
Dune Sea in Tatoine :D
fasty
1st Lieutenant
1st Lieutenant
Posts: 438
Joined: Thu Apr 15, 2010 4:17 am
Projects :: Server modding
Games I'm Playing :: SWBF2
Contact:

Re: Team 3 Reinforcements?

Post by fasty »

thedarkforce wrote:How do you add a third team like in battlefront 1
Dune Sea in Tatoine :D
Check out the everything you need thread.
http://www.gametoast.com/forums/viewtop ... 27&t=13806
And maybe the site rules too...
User avatar
thedarkforce
Private Third Class
Posts: 57
Joined: Wed Nov 17, 2010 8:05 am
Projects :: Le celeste
Games I'm Playing :: swbf2 and swbf1
Location: Paris. France/French

Re: Team 3 Reinforcements?

Post by thedarkforce »

Thank you I had not seen it!! :bowdown:

And there are divergent add video before and after a party that's ?

EDIT
There is nowhere Write or create a third team!! snif snif :cry:

Double posting is against the RULES, please EDIT your post instead -Staff
Post Reply