I'm making a map which involves removing cps during the course of the battle (conquest) and currently I am doing so by setting the cps' team to 0 and killing the cp objects. While this keeps the AI from spawning, removes the cp models from play, and removes the icons from the minimap, it unfortunately doesn't alter the reinforcement drain rates that are set when the cps are initially added to the objective. Is there code for removing them from the objective?
Hint: replacing the word "Add" with "Remove" doesn't work...rather it crashes the map.
Is there code for removing cps from conquest?
Moderator: Moderators
-
Jaspo
- Command Sergeant Major

- Posts: 282
- Joined: Sun Mar 01, 2009 4:34 am
- Projects :: AotC DoW+++Boonta Eve Classic
- xbox live or psn: No gamertag set
- Contact:
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Is there code for removing cps from conquest?
i suppose you could modify the killcommanndpost function in the objectiveconquest.lua
and insert these two lines from the addcommandpost function with a "-" istead of a "+"
you somehow have to get the name from the ptr though..
Code: Select all
-- command post kill
OnCommandPostKill(
function (postPtr)
if self.isComplete then return end
if not self.commandPosts[GetEntityName(postPtr)] then return end
if not self.multiplayerRules then
MapRemoveEntityMarker(postPtr, self.teamATT)
end
UpdateState()
end
) Code: Select all
self.totalBleedValue[self.teamATT] = self.totalBleedValue[self.teamATT] + GetCommandPostBleedValue(cp.name, self.teamATT)
self.totalBleedValue[self.teamDEF] = self.totalBleedValue[self.teamDEF] + GetCommandPostBleedValue(cp.name, self.teamDEF)- lucasfart
- Sith

- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Is there code for removing cps from conquest?
Out of curiosity, what is the ptr?
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Is there code for removing cps from conquest?
hmm, according to the scriptingsystem.doc its the actual object rather than its name. it seems like an object name and its ptr can be used synonymously, so you probably can probably replace cp.name with postptr..
-
Jaspo
- Command Sergeant Major

- Posts: 282
- Joined: Sun Mar 01, 2009 4:34 am
- Projects :: AotC DoW+++Boonta Eve Classic
- xbox live or psn: No gamertag set
- Contact:
Re: Is there code for removing cps from conquest?
Disregard the former contents of this post. It wasn't working because I put the code on the wrong side of an "end." It works now. Thanks.
