Dual Conquest Campaign Objecive [SOLVED]

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
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Dual Conquest Campaign Objecive [SOLVED]

Post by wishihadaname »

I looked through the assets but I could not find any examples of scripts that involve taking two command posts in one objective. I was wondering if this is possible to script. The way I tried it I got an indexing error the prevented campaign mode from initializing. I think I either need and "and" function or my conventions are wrong. Could someone please look this bit of script over and tell me how to correct it?
Hidden/Spoiler:
------------------------------------
--OBJECTIVE 3: RE-CAPTURE THE FLANK
------------------------------------
Objective3CP = CommandPost:New{name = "cp3"}
Objective3CP2 = CommandPost:New{name = "cp2"}
Objective3 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "TCR.objectives.smalltext.3", popupText = "TCR.objectives.bigtext.3", AIGoalWeight = 0}
Objective3:AddCommandPost(Objective3CP)
Objective3:AddCommandPost(Objective3CP2)
Last edited by wishihadaname on Fri Aug 05, 2011 3:25 pm, edited 1 time in total.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Dual Conquest Campaign Objecive

Post by DarthD.U.C.K. »

im pretty sure you cannot make an objective for capturing two commandposts with the stock functions. i guess you have to make a a custom bojective for that. (please correct me if im wrong)
User avatar
Unlucky13
Sergeant Major
Sergeant Major
Posts: 239
Joined: Mon Jan 24, 2011 11:11 am
Projects :: Models models models
Games I'm Playing :: Random stuff

Re: Dual Conquest Campaign Objecive

Post by Unlucky13 »

The stock Kashyyk campaign had you capture three different command posts in one objective, you could look in that script.
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Re: Dual Conquest Campaign Objecive [Solved]

Post by wishihadaname »

The Kashyyyk mission script has the objective set up exactly the same way I do except for without the AIGoalWeight=0 line after the various popup texts. Here it is for reference.
Hidden/Spoiler:
--Objective 5 Stuff
Objective5CP1 = CommandPost:New{name = "CP2"}
Objective5CP2 = CommandPost:New{name = "CP3"}
Objective5CP3 = CommandPost:New{name = "CP5"}
Objective5CP4 = CommandPost:New{name = "CP6"}
Objective5 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "level.kas2.objectives.5", popupText = "level.kas2.objectives.pop.5"}
Objective5:AddCommandPost(Objective5CP1)
Objective5:AddCommandPost(Objective5CP2)
Objective5:AddCommandPost(Objective5CP3)
Objective5:AddCommandPost(Objective5CP4)
I cleaned out a few more typos that may have had something to do with the problem, will re-enable the dual command posts and see what happens.

-edit-
Ok so it seems to be that the rule for multiple CP's is to have them indexed in ascending order and to have the lines of code defining them all be the same length. Here is what I changed my code to and it works now. (the typos I fixed were not related to cp's so I don't think they had anything to do with this.)
Hidden/Spoiler:
Objective3CP1 = CommandPost:New{name = "cp2"}
Objective3CP2 = CommandPost:New{name = "cp3"}
Objective3 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "level.TCR.objectives.smalltext.3", popupText = "level.TCR.objectives.bigtext.3"}
Objective3:AddCommandPost(Objective3CP1)
Objective3:AddCommandPost(Objective3CP2)
Post Reply