Am I able to destroy (disable) CP`s through LUA.?

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
SkinnyODST
Lieutenant Colonel
Lieutenant Colonel
Posts: 545
Joined: Mon Jul 04, 2016 10:56 pm
Location: My other account
Contact:

Am I able to destroy (disable) CP`s through LUA.?

Post by SkinnyODST »

Am I able to destroy or completely disable CP`s through LUA.? I know that there is a piece of code I can use that`s something along the lines of "HideCP (1)" for example (Or something like that) But that just hides the CP object and stops the sounds from occurring like the capture sound. The actual CP is still there and capture-able and the AI will still try to capture it as well. Is there something I can use like DestroyCP (1)?
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Am I able to destroy (disable) CP`s through LUA.?

Post by Marth8880 »

Code: Select all

KillObject("cpname")
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: Am I able to destroy (disable) CP`s through LUA.?

Post by Teancum »

Do you want it to totally go away, or just not be be capture-able? You can do either one.
SkinnyODST
Lieutenant Colonel
Lieutenant Colonel
Posts: 545
Joined: Mon Jul 04, 2016 10:56 pm
Location: My other account
Contact:

Re: Am I able to destroy (disable) CP`s through LUA.?

Post by SkinnyODST »

Teancum wrote:Do you want it to totally go away, or just not be be capture-able? You can do either one.
Totally go away, but knowing how make it not capture-able might also come in handy for some things.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Am I able to destroy (disable) CP`s through LUA.?

Post by Marth8880 »

To make a CP uncapturable, use SetProperty to set its CaptureRegion parameter to a nil value, like so:

Code: Select all

SetProperty("cpname", "CaptureRegion", "")
Post Reply