Page 1 of 1

Dual Conquest Campaign Objecive [SOLVED]

Posted: Thu Aug 04, 2011 4:17 pm
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)

Re: Dual Conquest Campaign Objecive

Posted: Thu Aug 04, 2011 4:53 pm
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)

Re: Dual Conquest Campaign Objecive

Posted: Thu Aug 04, 2011 4:59 pm
by Unlucky13
The stock Kashyyk campaign had you capture three different command posts in one objective, you could look in that script.

Re: Dual Conquest Campaign Objecive [Solved]

Posted: Thu Aug 04, 2011 8:36 pm
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)