Page 1 of 1

Tutorial: Conquer Game Mode

Posted: Mon Sep 09, 2013 8:48 pm
by CalvaryCptMike
Conquer Game Mode Tutorial


This is a very fun game mode. Basically it takes the two teams on a conquest map, and puts one of them backed up and starting at one CP, while the other team holds all the other CPs.
Hidden/Spoiler:
Image
Team 1 has to capture all of the other CPs to win. What makes the mode unique is that team 2 cannot capture any CPs. Once team 1 captures a CP, it's team 1s for the rest of the game. A giant padlock appears over it, and there is nothing team 2 can do to get it back.
Hidden/Spoiler:
Image
This avoids the back and forth action that I think is annoying in regular conquest, and makes the gameplay more linear, as if you are assualting and capturing a position from front to back. The script is moderately complex, and you will have to fine tune it to your map. Also, it only works on about half the stock maps, I don't know why. (I highly recommend you test it on coruscant, before doing it to your own map.)

So here's a basic script for Coruscant, using the coruscant conquest layer. (This is an advanced tutorial, if you don't know anything it will be very hard for you.)

--Conquer REPATT-v

--this will go in scriptpostload fyi

--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"} --defines the cps
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}

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

SetProperty ("cp1", "Team", 2) --VERY IMPORTANT, gives team 1 one cp, and team 2 the rest of the cps
SetProperty ("cp2", "Team", 1) --team1s only cp
SetProperty ("cp3", "Team", 2)
SetProperty ("cp4", "Team", 2)
SetProperty ("cp5", "Team", 2)
SetProperty ("cp6", "Team", 2)

SetProperty ("cp2", "CaptureRegion", "") --this makes team1s cp uncaptureable, because there is no capture zone
--SetProperty ("cp2", "GeometryName", "com_dyn_scp_locked") --this is a feature specific to my 3.5 mod, I added a new cp msh for when the cps were uncaptureable. A giant padlock to show they could not be retaken.

--this little function is what makes the gamemode work
OnFinishCapture( --if any cp is captured then:
function(post, holding)
if GetCommandPostTeam("cp1") == 1 then --if the cp was captured by team 1
SetProperty ("cp1", "CaptureRegion", "") --remove the capture zone (make it uncaptureable)
SetProperty ("cp1", "GeometryName", "com_dyn_scp_locked") --and change it to the padlocked msh.
end
end
)

repeat for each cp that is held by team 2, swapping "cp1" for the name of the different cps

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp3") == 1 then
SetProperty ("cp3", "CaptureRegion", "")
SetProperty ("cp3", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp4") == 1 then
SetProperty ("cp4", "CaptureRegion", "")
SetProperty ("cp4", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp5") == 1 then
SetProperty ("cp5", "CaptureRegion", "")
SetProperty ("cp5", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp6") == 1 then
SetProperty ("cp6", "CaptureRegion", "")
SetProperty ("cp6", "GeometryName", "com_dyn_scp_locked")
end
end
)

conquest:Start()

) --end of ff_AddCommand's parameters

--Conquer REPATT-^
As you probably noticed, that script right there only lets team 1 be the attacker. If you want team two to be the attacker, here's what you should do.

SetProperty ("cp1", "Team", 1) --invert all the team numbers, change 1 to 2 and 2 to 1
SetProperty ("cp2", "Team", 2)
SetProperty ("cp3", "Team", 1)
SetProperty ("cp4", "Team", 1)
SetProperty ("cp5", "Team", 1)
SetProperty ("cp6", "Team", 1)

SetProperty ("cp2", "CaptureRegion", "")
SetProperty ("cp2", "GeometryName", "com_dyn_scp_locked")

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp1") == 2 then --change this from 1 to 2, for each OnFinishCapture function
SetProperty ("cp1", "CaptureRegion", "")
SetProperty ("cp1", "GeometryName", "com_dyn_scp_locked")
end
end
)
The cool thing about this gamemode is that you can combine both team 1 attacking, team 2 attacking, and regular conquest all onto one mission by using my Multiple game modes on a single map tutorial.

Here is the scriptpostload() of coruscant Clone wars conquest from my mod:
Hidden/Spoiler:
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")

--fc game mode selection start -v
--fc game mode selection start -v
--fc game mode selection start -v
--tell v1.3 to expect custom FC commands
SupportsCustomFCCommands = true

--make sure we don't wipe out someone else's custom commands
local moreCommands = nil
if AddFCCommands ~= nil then
moreCommands = AddFCCommands
end

--v1.3 will automatically call this for you at the proper times
AddFCCommands = function()
--Add your custom commands here using ff_AddCommand() as show below

--CONQUEST -V
--CONQUEST -V
--CONQUEST -V
ff_AddCommand(
"Play Regular Conquest", --name of the command, should be unique
nil, --command description. If nil, defaults to mods.fakeconsole.description.<name without spaces> (example: mods.fakeconsole.description.MyEnemyAITeleport)
function() --this function does whatever it is you want your command to do

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

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

) --end of ff_AddCommand's parameters
--CONQUEST -^
--CONQUEST -^
--CONQUEST -^

--Conquer REPATT-v
--Conquer REPATT-v
--Conquer REPATT-v

ff_AddCommand(
"Play Conquer the CIS", --name of the command, should be unique
nil, --command description. If nil, defaults to mods.fakeconsole.description.<name without spaces> (example: mods.fakeconsole.description.MyEnemyAITeleport)
function() --this function does whatever it is you want your command to do

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

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

SetProperty ("cp1", "Team", 2)
SetProperty ("cp2", "Team", 1)
SetProperty ("cp3", "Team", 2)
SetProperty ("cp4", "Team", 2)
SetProperty ("cp5", "Team", 2)
SetProperty ("cp6", "Team", 2)

SetProperty ("cp2", "CaptureRegion", "")
--SetProperty ("cp2", "GeometryName", "com_dyn_scp_locked")

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp1") == 1 then
SetProperty ("cp1", "CaptureRegion", "")
SetProperty ("cp1", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp3") == 1 then
SetProperty ("cp3", "CaptureRegion", "")
SetProperty ("cp3", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp4") == 1 then
SetProperty ("cp4", "CaptureRegion", "")
SetProperty ("cp4", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp5") == 1 then
SetProperty ("cp5", "CaptureRegion", "")
SetProperty ("cp5", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp6") == 1 then
SetProperty ("cp6", "CaptureRegion", "")
SetProperty ("cp6", "GeometryName", "com_dyn_scp_locked")
end
end
)

conquest:Start()
end

) --end of ff_AddCommand's parameters

--Conquer REPATT-^
--Conquer REPATT-^
--Conquer REPATT-^

--Conquer CISATT-v
--Conquer CISATT-v
--Conquer CISATT-v

ff_AddCommand(
"Play Conquer the Republic", --name of the command, should be unique
nil, --command description. If nil, defaults to mods.fakeconsole.description.<name without spaces> (example: mods.fakeconsole.description.MyEnemyAITeleport)
function() --this function does whatever it is you want your command to do

--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.conq",
textDEF = "game.modes.conq",
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)

SetProperty ("cp1", "Team", 1)
SetProperty ("cp2", "Team", 2)
SetProperty ("cp3", "Team", 1)
SetProperty ("cp4", "Team", 1)
SetProperty ("cp5", "Team", 1)
SetProperty ("cp6", "Team", 1)

SetProperty ("cp2", "CaptureRegion", "")
SetProperty ("cp2", "GeometryName", "com_dyn_scp_locked")

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp1") == 2 then
SetProperty ("cp1", "CaptureRegion", "")
SetProperty ("cp1", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp3") == 2 then
SetProperty ("cp3", "CaptureRegion", "")
SetProperty ("cp3", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp4") == 2 then
SetProperty ("cp4", "CaptureRegion", "")
SetProperty ("cp4", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp5") == 2 then
SetProperty ("cp5", "CaptureRegion", "")
SetProperty ("cp5", "GeometryName", "com_dyn_scp_locked")
end
end
)

OnFinishCapture(
function(post, holding)
if GetCommandPostTeam("cp6") == 2 then
SetProperty ("cp6", "CaptureRegion", "")
SetProperty ("cp6", "GeometryName", "com_dyn_scp_locked")
end
end
)

conquest:Start()
end

) --end of ff_AddCommand's parameters

--Conquer CISATT-^
--Conquer CISATT-^
--Conquer CISATT-^

--process someone else's custom FC commands
if moreCommands ~= nil then
return moreCommands()
end
end

--fc game mode selection start -^
--fc game mode selection start -^
--fc game mode selection start -^

end
Credits:
Me, CavalryCaptainMike (I'm pretty sure I figured this one out all on my own, if you helped and I forgot, send me a PM) :wink:

Re: Tutorial: Conquer Game Mode

Posted: Tue Sep 10, 2013 12:34 am
by Maveritchell
Fair warning. This is an incredibly imbalanced mode. Team 1 has a huuuuuge advantage.

Re: Tutorial: Conquer Game Mode

Posted: Tue Sep 10, 2013 3:30 am
by THEWULFMAN
Yeah, I'm with Mav. There needs to be some sort of balancing factor in place, otherwise it's really easy for team 1 to win.

It's a nice idea, just needs work.

Re: Tutorial: Conquer Game Mode

Posted: Tue Sep 10, 2013 9:16 am
by lucasfart
Just chuck in an activate bonus? :D

Re: Tutorial: Conquer Game Mode

Posted: Tue Sep 10, 2013 10:55 am
by Maveritchell
lucasfart wrote:Just chuck in an activate bonus? :D
The issue is this - in short time, Team 1 will have captured at least two posts. That's nearly inevitable - it's hard to defend 4/5 CPs from a team spawning from all one place at once. And then it's likely downhill from there - the way this is set up, you can lose a command post while you're standing on top of it. Team 2 has basically no recourse except to eliminate all of the enemy. And then, if Team 2 loses more than half their CPs, they have a permanent reinforcement bleed that they can't stop. The cherry on top of that is that the AI for both teams are still set for conquest, which is a worthless objective for Team 2 - it's just going to get their AI killed.

Re: Tutorial: Conquer Game Mode

Posted: Tue Sep 10, 2013 11:50 am
by Locutus
Looks neat!
I always appreciate new game modes.
Thinking about what Mav said, you could do even more changes to that mode. You could add a timer of 4 or 5 minutes for example. If team 1 doesn't manage to capture a cp in time they lose. If they make it the timer will be reset. Team 2 will lose a lot of reinforcements when team 1 has captured nearly all cps but it should be challenging for them to get the last cp in time. ...Just thinking out loud here.

Re: Tutorial: Conquer Game Mode

Posted: Wed Sep 11, 2013 2:48 am
by CalvaryCptMike
Thanks for the replies :D

The mode isn't supposed to be balanced at all, you're supposed to play as the attacker and win, the question is just how long it takes. It's not a multiplayer mode, it's for singleplayer. The idea is that you can choose whether you want to be team A attacking or team B attacking at the beginning of the mode, and then "conquer" your enemy.

Re: Tutorial: Conquer Game Mode

Posted: Wed Sep 11, 2013 4:20 am
by THEWULFMAN
In that case, I suggest the mode have a timer. If the attacking team fails to win in 5 minutes, then defenders win.

Of course I can just add whatever I want to it if I choose to include this mode in a mod sometime.

Re: Tutorial: Conquer Game Mode

Posted: Thu Sep 12, 2013 6:44 am
by lucasfart
Maveritchell wrote:
lucasfart wrote:Just chuck in an activate bonus? :D
The issue is this - in short time, Team 1 will have captured at least two posts. That's nearly inevitable - it's hard to defend 4/5 CPs from a team spawning from all one place at once. And then it's likely downhill from there - the way this is set up, you can lose a command post while you're standing on top of it. Team 2 has basically no recourse except to eliminate all of the enemy. And then, if Team 2 loses more than half their CPs, they have a permanent reinforcement bleed that they can't stop. The cherry on top of that is that the AI for both teams are still set for conquest, which is a worthless objective for Team 2 - it's just going to get their AI killed.
All fair points. As it stands, most of those could be adjusted/fixed, but in its current state I can see what you're saying. It would certainly work better for the enclosed maps, where the simultaneous assault of all 4/5 cps at once is virtually impossible. I don't get the whole "capture it while you're standing over it" though? Can't the enemy only capture cps once there's none of the defending team present? And the region disabling only occurs AFTER the CP is captured, so they can still reclaim it while its neutral, surely? Can you adjust that cp bleed? You can change the bleed rate in the cps options in ZE or the .odf file, right? True that. Just change the objective to Defend and you've got a much smarter game. And the balance can surely be tweaked through bonuses, adjusting the difficulty, or even combining this with your Control mode (defending team starts with all the bonuses). Although that would be double-edged once the attackers started gaining cps...

That timer is a good idea.

@ CalvaryCptMike - It might seem like we're being overly critical of your mode, but I really like how you're doing this. Just listen to what everyone suggests, and you'll have an awesome game mode going in no time! :)

Re: Tutorial: Conquer Game Mode

Posted: Thu Sep 12, 2013 8:59 am
by Maveritchell
CalvaryCptMike wrote:The mode isn't supposed to be balanced at all, you're supposed to play as the attacker and win, the question is just how long it takes. It's not a multiplayer mode, it's for singleplayer. The idea is that you can choose whether you want to be team A attacking or team B attacking at the beginning of the mode, and then "conquer" your enemy.
If that's the case, just set your attackers based on the team the player spawns as and restrict the mode from multiplayer.

Re: Tutorial: Conquer Game Mode

Posted: Thu Sep 12, 2013 4:36 pm
by CalvaryCptMike
@Mav, yeah, that's pretty much how it works, except in my mod I left the mode in MP simply because it's fun to play co-op with it.

@lucasfart, don't worry, no offense taken, I'm actually surprised this topic got so many replies. :D