Page 1 of 1

Scripting new gametype

Posted: Mon Feb 28, 2011 10:48 am
by ACEwithSPADES
Hulla GT, i was wondering if there is any way to script a gametype where you have 50 allies against 50 enemies (teams 3 and 4) and the top says 50 out of 50 and you and the other team (1 and 2) have to kill the ai of the teams 3 and 4 and as they die the 50 out of 50 goes down, when there is none left on teams 3 or 4 then the ally of the team with men left wins? is this possible, ask if you need a better explanation. Thanks :D

Re: Scripting new gametype

Posted: Mon Feb 28, 2011 10:56 am
by AgentSmith_#27
So to clarify, what you're asking is if you could, for example, have Team 1 and Team 3 as friends, and Team 2 and Team 4 as friends, and make it so you lose or win by Team 3 or 4's reinforcement count instead of your own?

Re: Scripting new gametype

Posted: Mon Feb 28, 2011 2:13 pm
by fasty
I've tried this before and there's no way to show team 3's reinforcements in the HUD but you can give team 3 reinforcements and they will stop spawning when they run out.

Re: Scripting new gametype

Posted: Mon Feb 28, 2011 4:11 pm
by Fiodis
You could trigger messages when team 3 or 4's reinforcements reach certain points.

Re: Scripting new gametype

Posted: Mon Feb 28, 2011 4:24 pm
by ACEwithSPADES
could you connect team 3 losing directly to team 1 losing with a code and the message, like directions in the start like campaign, and so on till one teams ally is out? if so then how, wanna add somethin like this :P

Re: Scripting new gametype

Posted: Mon Feb 28, 2011 5:04 pm
by Teancum
So I'm a bit confused. Let me see if I get this right (which I probably won't)

**Teams 1 and 2 are player teams, but aren't "enemies" per say, though they are competing for points
**Teams 3 and 4 are basically target practice. Both teams try to either kill them off or hit a point limit.

If that's it in a nutshell it's not hard to code, and you can set it up so that the reinforcement count is is a team deathmatch scoreboard.

Re: Scripting new gametype

Posted: Wed Mar 02, 2011 10:55 am
by ACEwithSPADES
here is the script so far
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("AIHeroSupport")
ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_SetGameRules("campaign")


-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;
Arc = 3;
Dro = 4;
SBD = 5;

function ScriptPostLoad()
SetAIDifficulty(0, 2, "hard")
AllowAISpawn(ATT, false)
AllowAISpawn(DEF, false)
AllowAISpawn(3, false)
AllowAISpawn(4, false)
EnableSPScriptedHeroes()
ScriptCB_SetGameRules("campaign")

onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then
ShowPopup("level.geo1.hints.hints")
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)

end
end)
--objective Protect your allies CP


Objective1CP = CommandPost:New{name = "ADDCP_HERE"}
Objective1 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "level.ETR.campaign.rep.1", popupText = "level.ETR.campaign.rep.1_popup", AIGoalWeight = 0}
Objective1:AddCommandPost(Objective1CP)

Objective1:AddHint("level.geo1.hints.capture_cp")

Objective1.OnStart = function(self)
Matchtimer= CreateTimer("Matchtimer")
SetTimerValue(Matchtimer, (420))
StarTimer(Matchtimer)
OnTimerElapse(AICanCaptureCP("DRO_CP", "SBD_CP", "CIS_CP"), AddAIGoal(ATT, "Defend", 50000, "DRO_CP", SBD_CP", CIS_CP"), AddAIGoal(3, "Defend", 50000, "DRO_CP", "SBD_CP", "CIS_CP"),
DeleteAIGoal(ATT, "Defend", 50000, "ADDCP_HERE")
DeleteAIGoal(DEF, "Defend", 50000, "cp2_c")
DeleteAIGoal(ATT, "Deathmatch", 10)
function(timer)

DestroyTimer(timer)
end,
Matchtimer
)
AICanCaptureCP("ADDCP_HERE", ATT, false)
MapAddEntityMarker("ADDCP_HERE", "hud_objective_icon_circle", 3.0, ATT, "YELLOW", true, true, true)
AICanCaptureCP("ADDCP_HERE", DEF, true)
att_obj1_aigoal = AddAIGoal(ATT, "Defend", 50000, "ADDCP_HERE")
def_obj1_aigoal = AddAIGoal(DEF, "Defend", 50000, "ADDCP_HERE")
def_obj1_aigoal = AddAIGoal(3, "Defend", 50000, "ADDCP_HERE")
def_obj1_aigoal = AddAIGoal(4, "Defend", 50000, "ADDCP_HERE")
def_obj1_aigoal = AddAIGoal(5, "Defend", 50000, "ADDCP_HERE")
att_obj1_aigoal2 = AddAIGoal(ATT, "Deathmatch", 10)
AllowAISpawn(ATT, true)
AllowAISpawn(DEF, true) [/code]
would this work for the on timer elapse stuff with multiple command posts, and is this all set up right so far? also is there a way that i can have the mission be victory after the timer elapses and the Droids main cp not their ally's cps is capture i know the code would be missionvictoy, but can someone look over this for me? Thanks! :D :D :D