Results 1 to 7 of 7
  1. #1

    Default Embedding a Mutator into a map

    I've read that this was possible in 2k4 but have been unable to get it to work in UT3. I need to disable fall damage in my map without affecting the terminal velocity (it screws with my jump pads). I've written a Mutator to do this and would like it add this code to my map directly. Can this be done?

  2. #2

    Default

    Yes, you can do this. I did this already, but i done have access to my source atm.
    But wouldn't it be possible to create a water volume about 1 unit above the ground to "disable" the fall damage.

  3. #3

  4. #4

    Default

    Nope, Don't know much about kismet. Didn't realize it could do that kind of thing, I'll take a look.
    As for the water thing, I thought that might have unwanted side effects though I never tested it, I could try that too, thanks.

  5. #5
    MSgt. Shooter Person
    Join Date
    Sep 2009
    Location
    Arlington, TX
    Posts
    394

    Default

    You should be able to affect all pawns with a custom volume enveloping the level and/or giving all an inventory item by applying a really high MaxFallSpeed to the pawns as the jump boots do, without affecting jump pads. If using inventory items, you may have to have the item maintain the MaxFallSpeed variable on the pawn using a timer or watching for other events which may affect the maxfallspeed of your pawns. jumpboots are an example which affect the maxfallspeed. You could disable them for your level, or make sure the maxfallspeed is maintained upon the events which the jumpboots affect the maxfallspeed. The jumpboots adjust this value almost directly after the pawn gets and loses them, so one thing you you could do just watch for this inventory event from kismet and re-give your special inventory item when/if that happens. This could also be done through the inventory item itself, I think. If you find that more than jumpboots are a problem, you can resort to a timer or jumped(/maybe even landed) events to re-apply the value from within your custom inventory item. A volume may keep the variable applied (inherently) without adding an timer explicitly, but I forget if this is certainly true.

  6. #6

    Default

    Just to help others who came across this thread on how to embed a mutator into a map:
    The beyondunreal wiki has already a page on how to. But this is for UT2k4. Most of the code can be ported.
    http://wiki.beyondunreal.com/Legacy:...bedded_Mutator

    However, i'll provide an easy example.

    First of all, you need add a class defition placeable to the class you want to add on design time (classes can be added differently to a map, but if the placeable attribute is not set, the class/actor won't show up in the browser).

    A mutator needs to be registered. In UT3, you need to put this mutator into the chain of mutators (BaseMutator of a Game; BaseMutator.NextMutator = ???).
    In addition, as the embedded mutator is added afterwards, we need to call the InitMutator method to initialize mutators like InstaGib.

    The following code is a actor to load a mutator if the map is running. Just place the actor into your map. You can specify what mutator to load with the MyMutPath variable (packagename + Mutator class) or you can select a mutator out of the dropdown on MyMutClass. In order to use MyMutClass, you need to set bUseMyMutPath to false in its properties.

    !!! There is no additional check if a mutator is already loaded or if it is not allowed to run. But you can check the original AddMutator of the GameInfo class. !!!
    Code:
    class EGenericLoader extends Info 
        placeable
        HideCategories(Mutator, Advanced, Attachment, Debug, Physics)
        AutoExpandCategories(EGenericLoader);
    
    var bool bPreInitialized;
    
    var() bool bUseMutPath;
    var() String MyMutPath;
    var() class<Mutator> MyMutClass;
    
    function PreBeginPlay()
    {
        if (!bPreInitialized ) {
            bPreInitialized = true;
    
            AddMutatorToGame(true);
        }
    
        super.PreBeginPlay();
    }
    
    function AddMutatorToGame(optional bool UserAdded)
    {
        local string Error;
        local class<Mutator> mutClass;
        local Mutator mut;
        local GameInfo  G;
    
        G = WorldInfo.Game;
    
        if (bUseMutPath) 
            mutClass = class<Mutator>(DynamicLoadObject(MyMutPath , class'Class'));
        else
            mutClass = MyMutClass;
    
        if (mutClass == None)
            return;
    
        mut = Spawn(mutClass);
    
        if (mut == None)
            return;
    
        mut.bUserAdded = UserAdded;
    
        if (G.BaseMutator == None)
            G.BaseMutator = mut;
        else
            G.BaseMutator.AddMutator(mut);
    
        mut.InitMutator(G.ServerOptions, Error);
    }
    
    DefaultProperties
    {
        bUseMutPath=true
        MyMutPath="UTGame.UTMutator_Instagib"
    }

    The following code is an example on how to disable the fall damage with an embedded mutator.
    Code:
    class EMut extends UTMutator
        placeable
        HideCategories(Mutator, Advanced, Attachment, Debug, Physics)
        AutoExpandCategories(EMut);
    
    var bool bPreInitialized;
    
    function PreBeginPlay()
    {
        local string Error;
    
        if (!bPreInitialized ) {
            bPreInitialized = true;
    
            self.NextMutator = WorldInfo.Game.BaseMutator; 
    
            WorldInfo.Game.BaseMutator = self;
            InitMutator(WorldInfo.Game.ServerOptions,Error);
        }
    
        super.PreBeginPlay();
    }
    
    function ModifyPlayer(Pawn Other)
    {
        Other.MaxFallSpeed = 0;
    
        Super.ModifyPlayer(Other);
    }
    
    function AddMutator(Mutator M)
    {
        if (M == self) {
            return;
        }
    
        super.AddMutator(M);
    }
    
    DefaultProperties
    {
    }

  7. #7

    Default

    OMG that was extremely thorough, more than I could have hoped for. You sir, are my hero.


 

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.