Regions and 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
User avatar
Lorul1
Rebel Colonel
Rebel Colonel
Posts: 562
Joined: Wed Apr 24, 2013 10:34 pm
Projects :: Assault on Theed
Games I'm Playing :: Battlegrounds
xbox live or psn: No gamertag set
Location: Your House

Regions and LUA

Post by Lorul1 »

I have found my self wanting to edit regions through lua for a while, multipul times...

I have a danger regiond and shadow regiond I would like to remove after taking a command post over for team 1.

Is ths even posible ???
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: Regions and LUA

Post by Marth8880 »

Certainly. :0

Code: Select all

	OnFinishCaptureTeam(
		function(cPost)
			local pName = GetEntityName(cPost)	-- gets the name of the post that was captured
			
			if pName == "cpname" then	-- change "cpname" to the name of the post that was captured
				RemoveRegion("regionname")	-- change "regionname" to the name of the region that will be deleted
			end
		end,
		1 -- team ID who captured the CP (can also be ATT/DEF or ALL/CIS/IMP/REP)
	)
User avatar
Lorul1
Rebel Colonel
Rebel Colonel
Posts: 562
Joined: Wed Apr 24, 2013 10:34 pm
Projects :: Assault on Theed
Games I'm Playing :: Battlegrounds
xbox live or psn: No gamertag set
Location: Your House

Re: Regions and LUA

Post by Lorul1 »

Cool thanks ...

But just so I don't have to make another post -

Is there a way that I can disable or turn off a region then turn it on. I know you can do this with death regionds but I'm talking about other regiond like shadow and danger regions
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: Regions and LUA

Post by Marth8880 »

DeactivateRegion("regionname") and ActivateRegion("regionname") might work. No promises, though.
Post Reply