Script different difficulties at different times?

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
Filipinio
Master Sergeant
Master Sergeant
Posts: 178
Joined: Fri Jan 22, 2010 3:29 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mygeeto's Bridge Battle's

Script different difficulties at different times?

Post by Filipinio »

Hello GameToast,

Is there any way of using the LUA code: SetAIDifficulty() at differant times using the LUA
(for example, when say the CIS capture a certain CP, the Republic become more difficult or visa-vursa)?

Help will be much appreciated.
Aman/Pinguin
Jedi
Jedi
Posts: 1104
Joined: Tue Jan 30, 2007 6:04 am
Projects :: Inactive
Location: Germany

Re: Differant Difficulty's - Dirrerant Times

Post by Aman/Pinguin »

Not sure if changing the difficulty while the map is running works, but the correct code would be:

Code: Select all

OnFinishCaptureTeam(
   function(cPost)
      local pName = GetEntityName(cPost)
     
	SetAIDifficulty(2, whatever, "whatever")
   end,
   1
)



OnFinishCaptureTeam(
   function(cPost)
      local pName = GetEntityName(cPost)
     
	SetAIDifficulty(1, whatever, "whatever")
   end,
   2
)
That would apply to every Commandpost though. For a single CP it would be something like

Code: Select all

OnFinishCaptureTeam(
   function(cPost)
      local pName = GetEntityName(cPost)
		if pName == "cp1" then
			SetAIDifficulty(1, whatever, "whatever")
		end
   end,
   2
)
Typed most of it from head, so there might be mistakes.
Post Reply