Results 1 to 8 of 8
  1. #1
    legacy-sid
    Guest

    Cool Help! How do I get the game to end?

    Its only me!

    I wonder if anyone can help?

    I've got a standard DM level with about ten rooms and 55 skaarj monsters distributed within them.

    I've set the frag limit to 55, I've coded it (with a LOT of help!)so that when the main boss monster is killed all the other monsters are killed.

    However even though I've killed all the monsters in the map and the boss the game still won't end.

    I've noticed that some of the monsters kill each other!
    This is obviously stopping the frag limit from being reached.

    How the heck do I get it so that the bloomin' game ends when either all the monsters are killed or the boss is killed.

    Any Help is greatly appreciated!

    :cry: :cry: :cry:

  2. #2
    MSgt. Shooter Person
    Join Date
    Aug 2002
    Posts
    434

    Default

    Try this.
    Code:
    function bool MonstersDead() 
    {
    	local Monster M;
    	local bool bAllDead;
    	
    	bAllDead=true;
    	ForEach AllActors(class'Monster', M)
    	{
    		if (M != None)
    		{
    			bAllDead=false;
    			break;
    		}
    	}  
    	
    	return bAllDead;
    	
    }
    
    function ScoreKill(Controller Killer, Controller Other)
    {
    	
    	local Controller C;
    	local PlayerReplicationInfo Winner;
    
    	Super.ScoreKill(Killer,Other);
    	
    	if (MonstersDead())
    	{
    		
    		for ( C=Level.ControllerList; C!=None; C=C.NextController )
    		    if ( (C.PlayerReplicationInfo != None) && C.bIsPlayer)
    		    {
    			if ((Winner !=None) && (Winner !=C.PlayerReplicationInfo) 
    				&& (C.PlayerReplicationInfo.Score > Winner.Score) ) 
    				Winner=C.PlayerReplicationInfo;
    		    } 
    		
    		EndGame(Winner,"triggered"); 
    	}
    }
    You may get an overtime bug when two players have same score but that needs more work in the checkendgame function.

  3. #3
    legacy-sid
    Guest

    Post Thanks for the response doc!

    Hey there Doc!

    In what class exactly should I stick that code into?

    I've tried pasting it into the subclass for the boss but it won't have it...throws up a compiler error :cry:

  4. #4
    MSgt. Shooter Person
    Join Date
    Aug 2002
    Posts
    434

    Default

    In your game info class.
    You could use it in a mutator but you'd need to addapt it to it.
    You'll have to learn a thing or two on your own.

  5. #5
    legacy-sid
    Guest

    Post Sorry!

    I'm just new to this game and crap at programming I'm sure it doesn't help!

    Thanks VERY much btw!

  6. #6
    legacy-sid
    Guest

    Post The joy of Semtex!

    That should read VERY CRAP!

    Although on the bright side (geddit?) maybe I'm the off position (like permanently!) on the genius switch! (lol)
    :haha:

  7. #7
    legacy-sid
    Guest

    Cool Joy is shortlived!

    I've subclassed the code and stuck the subclass into the level,
    but again when you kill the boss all the monsters are wiped out but the game still runs OR if you kill about 20 monsters the game prematurely ends.

    WTF is going on??!!

    My hats off to the man who can solve this...

    :cry: :cry: :cry:

  8. #8
    legacy-sid
    Guest

    Post Jammy git!

    Done it!!!


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.