Page 1 of 1

TDM Conquest? [solved]

Posted: Thu Feb 21, 2013 5:12 pm
by Nedarb7
I'm trying to set up a conquest that you need to reach a certain amount of points to win
rather than kill all the enemies. Example:
{ways to win}
-reach 1000 points
-capture all cps

I've read a tutorial in the FAQ on how to make a custom campaign but it ended up plain
conquest. I have no experience whatsoever with this but here's my LUA:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

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

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}

hunt = ObjectiveTDM:New{teamATT = 1, teamDEF = 2, pointsPerKillATT = 1, pointsPerKillDEF = 1,
textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}

hunt.OnStart = function(self)

AddAIGoal(ATT, "Deathmatch", 1000)
AddAIGoal(DEF, "Deathmatch", 1000)
end

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

end

function StartObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 4.0 }
objectiveSequence:AddObjectiveSet(hunt)
objectiveSequence:Start()
end

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

SetPS2ModelMemory(4056000)

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



SetMemoryPoolSize("Music", 33)

ReadDataFile("ingame.lvl")


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

ReadDataFile("dc:SIDE\\Republic.lvl",
"rep_inf_ep2_rifleman",
"rep_inf_ep2_rocketeer",
"rep_inf_ep2_engineer",
"rep_inf_ep2_sniper",
"rep_inf_ep2_officer_training",
"rep_inf_ep2_jettrooper")

ReadDataFile("SIDE\\rep.lvl",

"rep_fly_assault_DOME",
"rep_fly_gunship_DOME",
"rep_hero_macewindu")

ReadDataFile("SIDE\\cis.lvl",
"cis_fly_droidfighter_DOME",
"cis_inf_engineer",
"cis_inf_officer",
"cis_hero_darthmaul")

ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_laser")

ReadDataFile("dc:SIDE\\Droids.lvl",
"cis_inf_rocketeer",
"cis_inf_rifleman",
"cis_inf_sniper",
"cis_inf_droideka",
"cis_inf_BD1")


SetupTeams{

rep = {
team = REP,
units = 32,
reinforcements = 365,
soldier = { "rep_inf_ep2_rifleman",7, 25},
assault = { "rep_inf_ep2_rocketeer",1, 4},
engineer = { "rep_inf_ep2_engineer",1, 4},
sniper = { "rep_inf_ep2_sniper",1, 4},
officer = {"rep_inf_ep2_officer_training",1, 4},
special = { "rep_inf_ep2_jettrooper",1, 4},

},
cis = {
team = CIS,
units = 32,
reinforcements = 400,
soldier = { "cis_inf_BD1",7, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
marine = { "cis_inf_rifleman",3, 10},

}
}
SetHeroClass(CIS, "cis_hero_darthmaul")
SetHeroClass(REP, "rep_hero_macewindu")



-- 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 = 210
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 18)
SetMemoryPoolSize("EntitySoundStream", 10)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("MountedTurret",12)
SetMemoryPoolSize("PathFollower", 50)
SetMemoryPoolSize("Navigator", 50)
SetMemoryPoolSize("Obstacle", 375)
SetMemoryPoolSize("SoundSpaceRegion", 38)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("TreeGridStack", 140)
SetMemoryPoolSize("UnitAgent", 50)
SetMemoryPoolSize("UnitController", 50)
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")

ReadDataFile("dc:SIDE\\Textures.lvl",
"Cor1")


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

Re: TDM Conquest?

Posted: Fri Feb 22, 2013 11:27 am
by Locutus
A simple way would be to set up stock conquest.
Then add sth. like this to have the points displayed and to unlimit reinforcement count:

ShowTeamPoints(ATT, true)
ShowTeamPoints(DEF, true)
SetReinforcementCount(ATT, -1)
SetReinforcementCount(DEF, -1)
SetTeamPoints(ATT, 1000)
SetTeamPoints(DEF, 1000)
ScriptCB_ShowHuntScoreLimit(3)


Then open a TDM script and copy the stuff that counts the kills and the victory conditions.
Remember to set the CPs bleed values to 0 in ZE.

Re: TDM Conquest?

Posted: Fri Feb 22, 2013 2:55 pm
by Nedarb7
Locutus wrote:A simple way would be to set up stock conquest.
Then add sth. like this to have the points displayed and to unlimit reinforcement count:

ShowTeamPoints(ATT, true)
ShowTeamPoints(DEF, true)
SetReinforcementCount(ATT, -1)
SetReinforcementCount(DEF, -1)
SetTeamPoints(ATT, 1000)
SetTeamPoints(DEF, 1000)
ScriptCB_ShowHuntScoreLimit(3)


Then open a TDM script and copy the stuff that counts the kills and the victory conditions.
Remember to set the CPs bleed values to 0 in ZE.
Where does that all go and what TDM
stuff?

Re: TDM Conquest?

Posted: Fri Feb 22, 2013 6:14 pm
by [RDH]Zerted
That all goes inside the ScriptPostLoad function and he's referring to ObjectiveTDM.lua which is somewhere...

However before trying that, fix your hunt objective: it's never started.

Fix:
1) Replace the conquest:Start() line with the text StartObjectives(conquest)
2) Adjust function StartObjectives() to function StartObjectives(conq)
3) Add the line objectiveSequence:AddObjectiveSet(conq) above the line objectiveSequence:AddObjectiveSet(hunt)
4) Munge
5) If no errors, test your map. If errors post your error log and lua, and/or try the other method.

I don't remember if all objectives in a MultiObjectiveContainers are active or if you're supposed to go through them one at a time. You'll noticed when testing your map. Also, the hunt point limit will be adjustable by the user. I don't know if you want that or not (I'd prefer maps let you adjust how long they are) but it's fixable with a small tweak to ObjectiveTDM.

Re: TDM Conquest?

Posted: Mon Feb 25, 2013 4:00 pm
by Nedarb7
Second edit. I've made a little bit of progress, I just don't know what stuff I need from the ObjectiveTDM script to set up the victory (add points to the team points) Ex. One kill, your team gets one point. Also I need help to change the point limit.
Here's the LUA:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
Conquest = ScriptCB_DoFile("ObjectiveConquest")
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()

ShowTeamPoints(ATT, true)
ShowTeamPoints(DEF, true)
SetReinforcementCount(ATT, -1)
SetReinforcementCount(DEF, -1)
ScriptCB_ShowHuntScoreLimit(3)


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",
pointsPerKillATT = 1,
pointsPerKillDEF = 1,
isUberMode = true,
uberScoreLimit = 1000,
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:Start()

end

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



SetPS2ModelMemory(4056000)

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



SetMemoryPoolSize("Music", 33)

ReadDataFile("ingame.lvl")


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

ReadDataFile("dc:SIDE\\Republic.lvl",
"rep_inf_ep2_rifleman",
"rep_inf_ep2_rocketeer",
"rep_inf_ep2_engineer",
"rep_inf_ep2_sniper",
"rep_inf_ep2_officer_training",
"rep_inf_ep2_jettrooper")

ReadDataFile("SIDE\\rep.lvl",

"rep_fly_assault_DOME",
"rep_fly_gunship_DOME",
"rep_hero_macewindu")

ReadDataFile("SIDE\\cis.lvl",
"cis_fly_droidfighter_DOME",
"cis_inf_engineer",
"cis_inf_officer",
"cis_hero_darthmaul")

ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_laser")

ReadDataFile("dc:SIDE\\Droids.lvl",
"cis_inf_rocketeer",
"cis_inf_rifleman",
"cis_inf_sniper",
"cis_inf_droideka",
"cis_inf_BD1")


SetupTeams{

rep = {
team = REP,
units = 32,
reinforcements = 365,
soldier = { "rep_inf_ep2_rifleman",7, 25},
assault = { "rep_inf_ep2_rocketeer",1, 4},
engineer = { "rep_inf_ep2_engineer",1, 4},
sniper = { "rep_inf_ep2_sniper",1, 4},
officer = {"rep_inf_ep2_officer_training",1, 4},
special = { "rep_inf_ep2_jettrooper",1, 4},

},
cis = {
team = CIS,
units = 32,
reinforcements = 400,
soldier = { "cis_inf_BD1",7, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
marine = { "cis_inf_rifleman",3, 10},

}
}
SetHeroClass(CIS, "cis_hero_darthmaul")
SetHeroClass(REP, "rep_hero_macewindu")



-- 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 = 210
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 18)
SetMemoryPoolSize("EntitySoundStream", 10)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("MountedTurret",12)
SetMemoryPoolSize("PathFollower", 50)
SetMemoryPoolSize("Navigator", 50)
SetMemoryPoolSize("Obstacle", 375)
SetMemoryPoolSize("SoundSpaceRegion", 38)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("TreeGridStack", 140)
SetMemoryPoolSize("UnitAgent", 50)
SetMemoryPoolSize("UnitController", 50)
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")

ReadDataFile("dc:SIDE\\Textures.lvl",
"Cor1")


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

Re: TDM Conquest?

Posted: Mon Mar 11, 2013 6:55 pm
by [RDH]Zerted
Well, I shouldn't try to answer questions while I have a fever. But I wrote it anyway so I'll still post it. Maybe it'll help.
Hidden/Spoiler:
[quote="Nedarb7"]Here's the LUA...[/quote]So you're not going to try my fix and are instead trying to merge parts of ObjectiveTDM with ObjectiveConquest?

Ignore this: I can't walk you though the ObjectiveConquest changes (it's probably easier to directly edit ObjectiveConquest.lua than copy parts into your ScriptPostLoad function) as I don't have the mod tools on this computer. You'll have to find where in ObjectiveTDM.lua that changes and checks the team point counts (probably in an OnCharacterDeath) and copy that into ObjectiveConquest. Somewhere there will be a GetTeamPoints and a SetTeamPoints.

Basically whenever someone dies, the other team should gain one point. If the team's new point value is greater than or equal to the point limit, that team wins. If you don't want to copy anything you'll need an OnCharacterDeath event handler that'll contain the point changing and checking code. Pseduocode:
[code]
MaxPoints = 1000
OnCharacterDeath(
function(player, killer)
local playerTeam = GetCharacterTeam(player)
local killerTeam = GetCharacterTeam(killer)
--err, I just noticed that I'm simply reimplementing reinforcement counts... stupid me

--player was on a local team, we don't care about them
if (playerTeam ~= ATT) and (playerTeam ~= DEF) then
return
end

AddTeamPoints(killerTeam, 1)
if GetTeamPoints(killerTeam) >= MaxPoints then
MissionVictor(killerTeam)
end
end
)[/code]That goes in ScriptPostLoad.

The following code gets inserted at the end of your ScriptPostLoad function (but still inside the function):[code]ShowTeamPoints(ATT, true)
ShowTeamPoints(DEF, true) --display points instead of reinforcement counts
SetReinforcementCount(ATT, -1) --unlimited reinforcements
SetReinforcementCount(DEF, -1) --unlimited reinforcements
SetTeamPoints(ATT, 0) --set ATT's points to 0
SetTeamPoints(DEF, 0) --set DEF's points to 0[/code]
Edit: And then seeing your last post again, I'm not sure what you're trying to do. 1 kill = 1 point. If that's all you're doing it's the same as reinforcements counts. Are you also counting the team points for CP captures, object destruction, etc...?

Re: TDM Conquest?

Posted: Mon Mar 11, 2013 7:57 pm
by Nedarb7
Zerted wrote:So you're not going to try my fix and are instead trying to merge parts of ObjectiveTDM with ObjectiveConquest?
I did and it ended up that I had to go through one objective at a time, I just edited my last post.
Zerted wrote: And then seeing your last post again, I'm not sure what you're trying to do. 1 kill = 1 point. If that's all you're doing it's the same as reinforcements counts. Are you also counting the team points for CP captures, object destruction, etc...?
I wanted
kill = 1pt added to team points and
capture = 5pt added to team points
then when score limit reached = Victory

So I'm guessing the chunk you just posted is what I need for the kill = 1pt = team pts = victory.
What about CPs?

Re: TDM Conquest?

Posted: Tue Mar 12, 2013 1:20 am
by [RDH]Zerted
Lucky for you I just finished playing SWBF2 so I'm on the right computer.

ObjectiveTDM.lua isn't too complicated, but you don't need to copy anything. I recommend reading through the Events responses section at the bottom of the file. That is TDM's OnCharacterDeath code. It shows the ScriptCB functions which get the point limits set by the user for the different game modes. You may or may not want to use one of those.

You may need to add ScriptCB_ShowHuntScoreLimit(3) to your code like Locutus said. For CP points, use an OnFinishCapture( function(postPtr) ... end )event callback. Return if postPrt == nil for extra robustness. Next, AddTeamPoints(GetObjectTeam(postPrt), 5) and check if that team is over the point limit.

In OnCharacterDeath, you should also add checks for when killer == nil (player killed himself) and when playerTeam == killerTeam (a TK). I'm guessing you don't want to give points for those. Simply return if any of those are true, like how the local team check is written.

Re: TDM Conquest?

Posted: Tue Mar 12, 2013 2:20 pm
by Nedarb7
[RDH]Zerted wrote:ScriptCB_ShowHuntScoreLimit(3)
Yeah I noticed that... On to the point, first off the OnFinishCapture isn't giving points
(might have done something wrong), also you get unlimited points, no score limit, lets say there's
a 400 score limit and you reach 400 next thing you know you have 410 and it goes on and on.
So basically the victory thing in OnCharacterDeath isn't working too.
Here's the new LUA (current):
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
Conquest = ScriptCB_DoFile("ObjectiveConquest")
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()

--TDM

MaxPoints = 1000,
OnCharacterDeath(
function(player, killer)
local playerTeam = GetCharacterTeam(player)
local killerTeam = GetCharacterTeam(killer)

if (playerTeam ~= ATT) and (playerTeam ~= DEF) then
return
end

AddTeamPoints(killerTeam, 1)
if GetTeamPoints(killerTeam) >= MaxPoints then
MissionVictor(killerTeam)
end
end
)

--Cp Capture
OnFinishCapture(
function (postPtr)
if isComplete then return end
if not commandPosts[GetEntityName(postPtr)] then return end
AddTeamPoints(GetObjectTeam(postPrt), 5)
UpdatePostMapMarker(postPtr)
UpdateState()
end
)


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.con",
pointsPerKillATT = 1,
pointsPerKillDEF = 1,
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)

--More TDM
ShowTeamPoints(ATT, true)
ShowTeamPoints(DEF, true)
SetReinforcementCount(ATT, -1)
SetReinforcementCount(DEF, -1)
SetTeamPoints(ATT, 0)
SetTeamPoints(DEF, 0)
ScriptCB_ShowHuntScoreLimit(3)


conquest:Start()

end

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



SetPS2ModelMemory(4056000)

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



SetMemoryPoolSize("Music", 33)

ReadDataFile("ingame.lvl")


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

ReadDataFile("dc:SIDE\\Republic.lvl",
"rep_inf_ep2_rifleman",
"rep_inf_ep2_rocketeer",
"rep_inf_ep2_engineer",
"rep_inf_ep2_sniper",
"rep_inf_ep2_officer_training",
"rep_inf_ep2_jettrooper")

ReadDataFile("SIDE\\rep.lvl",

"rep_fly_assault_DOME",
"rep_fly_gunship_DOME",
"rep_hero_macewindu")

ReadDataFile("SIDE\\cis.lvl",
"cis_fly_droidfighter_DOME",
"cis_inf_engineer",
"cis_inf_officer",
"cis_hero_darthmaul")

ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_laser")

ReadDataFile("dc:SIDE\\Droids.lvl",
"cis_inf_rocketeer",
"cis_inf_rifleman",
"cis_inf_sniper",
"cis_inf_droideka",
"cis_inf_BD1")


SetupTeams{

rep = {
team = REP,
units = 32,
reinforcements = 365,
soldier = { "rep_inf_ep2_rifleman",7, 25},
assault = { "rep_inf_ep2_rocketeer",1, 4},
engineer = { "rep_inf_ep2_engineer",1, 4},
sniper = { "rep_inf_ep2_sniper",1, 4},
officer = {"rep_inf_ep2_officer_training",1, 4},
special = { "rep_inf_ep2_jettrooper",1, 4},

},
cis = {
team = CIS,
units = 32,
reinforcements = 400,
soldier = { "cis_inf_BD1",7, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
marine = { "cis_inf_rifleman",3, 10},

}
}
SetHeroClass(CIS, "cis_hero_darthmaul")
SetHeroClass(REP, "rep_hero_macewindu")



-- 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 = 210
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 18)
SetMemoryPoolSize("EntitySoundStream", 10)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("MountedTurret",12)
SetMemoryPoolSize("PathFollower", 50)
SetMemoryPoolSize("Navigator", 50)
SetMemoryPoolSize("Obstacle", 375)
SetMemoryPoolSize("SoundSpaceRegion", 38)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("TreeGridStack", 140)
SetMemoryPoolSize("UnitAgent", 50)
SetMemoryPoolSize("UnitController", 50)
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")

ReadDataFile("dc:SIDE\\Textures.lvl",
"Cor1")


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

Re: TDM Conquest?

Posted: Wed Mar 13, 2013 6:45 am
by [RDH]Zerted
It should be MissionVictory (was missing the y)
I don't guarantee my code doesn't have typos. I don't test forum posts.

Code: Select all

--Cp Capture
OnFinishCapture(
  function (postPtr)
    if postPtr == nil then return end

    --add points to whichever team now owns the CP
    local team = GetObjectTeam(postPrt)
    AddTeamPoints(GetObjectTeam(team), 5)

    --see if the newly owning team won
    if GetTeamPoints(team) >= MaxPoints then
      MissionVictory(team)
    end
  end
)
Also, your MaxPoints = 1000 line shouldn't contain a comma.

Re: TDM Conquest?

Posted: Wed Mar 13, 2013 11:21 am
by Nedarb7
Yeah I noticed that the y was missing and fixed it already, also the maxpoints worked with a comma.
Zerted wrote:--Cp Capture
OnFinishCapture(
function (postPtr)
if postPtr == nil then return end

--add points to whichever team now owns the CP
local team = GetObjectTeam(postPrt)
AddTeamPoints(GetObjectTeam(team), 5)

--see if the newly owning team won
if GetTeamPoints(team) >= MaxPoints then
MissionVictory(team)
end
end
)
Ohh I see, mine had nothing to do with points then. I'll get back with the results.
-EDIT-
I got it to work, here's the result:
Hidden/Spoiler:
--TDM

MaxPoints = 400,
OnCharacterDeath(
function(player, killer)

local playerTeam = GetCharacterTeam(player)
local killerTeam = GetCharacterTeam(killer)

if killer == nil then return end

if playerTeam == killerTeam then return end

if (playerTeam ~= ATT) and (playerTeam ~= DEF) then
return
end

AddTeamPoints(killerTeam, 1)
if GetTeamPoints(killerTeam) >= MaxPoints then
MissionVictory(killerTeam)
end
end
)

--Cp Capture
OnFinishCapture(
function(postPtr)
if postPtr == nil then return end
local team = GetObjectTeam(postPtr)
AddTeamPoints(GetObjectTeam(postPtr), 5)
if GetTeamPoints(team) >= MaxPoints then
MissionVictory(team)
end
end
)
Thanks for your help :D (I'm actually understanding what I'm doing now).