Page 1 of 1

Script different difficulties at different times?

Posted: Sat May 08, 2010 1:24 pm
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.

Re: Differant Difficulty's - Dirrerant Times

Posted: Sat May 08, 2010 5:52 pm
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.