View unanswered posts | View active topics It is currently Thu Apr 18, 2024 3:50 am



Reply to topic  [ 2 posts ] 
 Running a Script That Causes A WIN 
Author Message
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Running a Script That Causes A WIN
So I'm trying to run a script that causes the activity to make you win once the actor it's attached to spawns into the scene out of a dropship/rocket. Right now I've got this...


Code:
function Create(self)
   
   self.winTimer = Timer();
   
end

function Update(self)
   
   if self.winTimer:IsPastSimMS(150) then
      if self.CPUTeam == Activity.NOTEAM then
         if self.playertally == 1 then
            for i = 1, #self.playerlist do
               if self.playerlist[i] == true then
                  self.WinnerTeam = i;
                  ActivityMan:EndActivity();
               end
            end
         end
      else
         if self.playertally == 0 then
            self.WinnerTeam = self.CPUTeam;
            ActivityMan:EndActivity();
         end
      end
   end
end


...attached to a Coalition Light. It's slightly altered from the skirmish defence win/lose conditions code. Right now it doesn't do anything. I was hoping for some guidance in the right direction!


Wed Mar 14, 2012 4:27 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Running a Script That Causes A WIN
You're not setting self.playertally at any point, so nothing is happening.


Wed Mar 14, 2012 5:59 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.057s | 15 Queries | GZIP : Off ]