View unanswered posts | View active topics It is currently Thu Apr 25, 2024 2:47 pm



Reply to topic  [ 3 posts ] 
 Killing all enemy actors when their brain dies + Music woes 
Author Message
User avatar

Joined: Tue Mar 20, 2007 10:16 am
Posts: 186
Location: Australia
Reply with quote
Post Killing all enemy actors when their brain dies + Music woes
I feel im making a really simple mistake here. Below is the game over code copied from the dummy assault mission with a few bits added to it.

Code:
   -- Game over, show the appropriate messages until a certain time
   elseif not self.GameOverTimer:IsPastSimMS(self.GameOverPeriod) then
      for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
         if self:PlayerActive(player) and self:PlayerHuman(player) then
            local team = self:GetTeamOfPlayer(player)
            -- TODO: make more appropriate messages here for run out of funds endings
            if team == self.WinnerTeam then
               FrameMan:SetScreenText("Congratulations, you've destroyed the computer and ended the virus!", player, 0, -1, false)
////////////////////////////////////////////
               for actor in MovableMan.AddedActors do      --Make all the robots die.
                  if actor.Team == 1 then
                     actor.Health = 0
                  end
               end
               AudioMan:PlayMusic("RETARDS.rte/Victory.ogg", 0, -1);
////////////////////////////////////////////
            else
               FrameMan:SetScreenText("Your brain has been lost!", player, 0, -1, false)
            end
         end
      end
   end


The loop ive added works when it's put out in the open inside either the update or start function, but while its where it is the conditions for killing don't seem to be satisfied. Is this because team values are changed to stop the actors killing each other?

Another minor issue:
The music does play, but only after a 5 second delay. Should I be doing something else with Audioman?


Sat Sep 24, 2011 4:17 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Thu Jun 11, 2009 2:34 pm
Posts: 966
Location: Moscow, Russia
Reply with quote
Post Re: Killing all enemy actors when their brain dies + Music woes
I think you should search in MovableMan.Actors.


Thu Sep 29, 2011 11:12 am
Profile
User avatar

Joined: Tue Mar 20, 2007 10:16 am
Posts: 186
Location: Australia
Reply with quote
Post Re: Killing all enemy actors when their brain dies + Music woes
Yep, that works. None of the original enemy actors are left in the game by that point.


Thu Sep 29, 2011 5:45 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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.556s | 17 Queries | GZIP : Off ]