Results 1 to 3 of 3
  1. #1
    Skaarj
    Join Date
    Aug 2003
    Posts
    6

    Default Remove item from game.

    Hi all,

    I want to remove all ammunition pickups from the game by the means of a mutator. Is there a better way to do it than this one below?

    Code:
    // Remove all ammunition
    function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
    {
        bSuperRelevant = 0;
    
        if (Ammo(Other) != None)
        {
    		Other = None;
    		return false;
        }
    
    	return true;
    }
    Cheers.

  2. #2
    MSgt. Shooter Person
    Join Date
    Jul 2003
    Posts
    56

    Default Re: Remove item from game.

    Originally posted by nickelplate
    Hi all,

    I want to remove all ammunition pickups from the game by the means of a mutator. Is there a better way to do it than this one below?

    Code:
    // Remove all ammunition
    function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
    {
        bSuperRelevant = 0;
    
        if (Ammo(Other) != None)
        {
    		Other = None;
    		return false;
        }
    
    	return true;
    }
    Cheers.
    a-you must always keep compatibility with other mutators at the end of these functions (see mutator code)
    b-its better to modify it from the isrelevant() function

    this should be more like
    Code:
    function bool IsRelevant(Actor Other, out byte bSuperRelevant)
    {
    	if (Ammo(Other) != None)
                   {
                                    bSuperRelevant = 0;
                                    return false;
                    }
    	return Super.IsRelevant(Other, bSuperRelevant);
    }
    use checkreplacement() when you want to replace the actor

  3. #3
    MSgt. Shooter Person
    Join Date
    Dec 2001
    Posts
    477

    Default

    CheckReplacement removes them with return false like you did, only don't set Other to none. It screws everything up.
    Visit us at BeyondUnreal!
    And for a cultured and mature Unreal Engine community, try our forums!


 

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.