Results 1 to 4 of 4
  1. #1

    Default How do you make a code that sees when a player kills a bot? (Kismet)

    Hi, I'm trying to make something that gives points for killing bots. I'm making the code in Kismet.
    The variable for keeping track of the points is no problem. the announcement is already made.

    I just have one question:
    How do you make a code that sees when a player kills a bot?
    Do I use a pawn>death event or something?

    Any help would be appreciated
    Thanks in advance.

  2. #2
    MSgt. Shooter Person
    Join Date
    Jun 2009
    Posts
    401

    Default

    Yes. You can use the "Death" or the "See Death" event. But first, you need to attach the event to the spawned Pawn/Player by using the "Attach to event" action.
    The "See Death" event has two outgoing variables - Victim and Killer (don't know the correct naming atm). So you need to check if the Victim and/or the Killer is a bot/player.

    But this type of modification of the gameplay should be done via a mutator in general.
    Like so:

    Code:
    class ReverseHandicapMutator extends UTMutator;
    
    function InitMutator(string Options, out string ErrorMessage)
    {
        WorldInfo.Game.AddGameRules(class'ReverseHandicapRules');
        Super.InitMutator(Options, ErrorMessage);
    }
    Code:
    class ReverseHandicapRules extends GameRules;
    
    function ScoreKill(Controller Killer, Controller Killed)
    {
        super.ScoreKill(Killer, Killed);
        
        if (!Killed.bIsPlayer || AIController(Killed) != none)
            Killer.PlayerReplicationInfo.Score += 2;
    }
    Last edited by RattleSN4K3; 05-19-2012 at 08:32 AM. Reason: Typos

  3. #3

    Default

    Thanks for the help, it works now.
    I didn't use a mutator because I wanted to make it for this level only.
    I'm making a point system with prices in it. So you can invest the points into weapons/vehicles.

  4. #4
    MSgt. Shooter Person
    Join Date
    Jun 2009
    Posts
    401

    Default

    Glad i could help. Thanks for the reponse


 

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.