Page 1 of 1

Mission victory/defeat on destruction of object?

Posted: Sun Feb 13, 2011 10:12 pm
by =BloodyRoses=
Title pretty much self-explanatory. I need to make a map where the objective is to guard/destroy an object which when destroyed triggers endgame. Sorting through the campaign mission objective scripts hasn't helped. Need specific LUAs and coding. Sorry if this has been posted before, can't find it anywhere though.

Re: Mission victory/defeat on destruction of object?

Posted: Sun Feb 13, 2011 10:26 pm
by AQT
A combination of this and the two following LUA functions should do the trick. They should replace PlayAnimation():

Code: Select all

MissionDefeat() 
MissionVictory()
The name of the team you want to lose/win should go in between the parentheses, and make sure the names are defined first.

Re: Mission victory/defeat on destruction of object?

Posted: Mon Mar 21, 2011 10:00 pm
by =BloodyRoses=
That's great, now can someone explain the add points on destruction of object script that AQT mentioned, I'd like a working example since mine isn't working properly.

EDIT
=BloodyRoses= wrote:That's great, now can someone explain the add points on destruction of object script that AQT mentioned, I'd like a working example since mine isn't working properly.
I really need this soon. Any help would be appreciated.

Re: Mission victory/defeat on destruction of object?

Posted: Mon Mar 21, 2011 10:57 pm
by Firefang

Code: Select all

killobject = OnObjectKill(
   function(object, killer)
      if  GetEntityName(object) == "objectbeingkillednameinZeroEditor" then
         AddAssaultDestroyPoints(killer)
         MissionVictory(ATT)
      end
   end
)
Assuming that ATT is the enemy team, this should work. If the enemy team is DEF, then change it accordingly.

Re: Mission victory/defeat on destruction of object?

Posted: Tue Mar 22, 2011 12:10 am
by THEWULFMAN
You could replace ATT with the actual team name, like REP/CIS/IMP/ALL

Re: Mission victory/defeat on destruction of object?

Posted: Tue Mar 22, 2011 12:20 am
by Firefang
That works as well, but I used ATT and DEF because they are universal and not limited to one era.