Scripting new gametype

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
User avatar
ACEwithSPADES
Command Sergeant Major
Command Sergeant Major
Posts: 253
Joined: Thu Jan 20, 2011 3:49 pm
Projects :: Alzoc 3
Games I'm Playing :: Battlefront 2 MW2
xbox live or psn: xundyingxace
Location: Somewhere, but most likely where i am

Scripting new gametype

Post 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
User avatar
AgentSmith_#27
Rebel Warrant Officer
Rebel Warrant Officer
Posts: 302
Joined: Thu Feb 11, 2010 3:10 pm
Projects :: No Projects I am ready to unveil
Games I'm Playing :: SWBF2-MW2-Madden 08
xbox live or psn: No gamertag set
Location: Zeroeditor
Contact:

Re: Scripting new gametype

Post 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?
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: Scripting new gametype

Post 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.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Scripting new gametype

Post by Fiodis »

You could trigger messages when team 3 or 4's reinforcements reach certain points.
User avatar
ACEwithSPADES
Command Sergeant Major
Command Sergeant Major
Posts: 253
Joined: Thu Jan 20, 2011 3:49 pm
Projects :: Alzoc 3
Games I'm Playing :: Battlefront 2 MW2
xbox live or psn: xundyingxace
Location: Somewhere, but most likely where i am

Re: Scripting new gametype

Post 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
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Scripting new gametype

Post 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.
User avatar
ACEwithSPADES
Command Sergeant Major
Command Sergeant Major
Posts: 253
Joined: Thu Jan 20, 2011 3:49 pm
Projects :: Alzoc 3
Games I'm Playing :: Battlefront 2 MW2
xbox live or psn: xundyingxace
Location: Somewhere, but most likely where i am

Re: Scripting new gametype

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