Announcement

Collapse
No announcement yet.

Problem with GameRules and Mutator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem with GameRules and Mutator

    I have compiled my own damage modifier that give me 3 times powerful and reduce my damage inflicted by half.

    However, I got error message indicate that G = spawn( class 'Danmutator') is mismatch! How I can fix it?

    This part script made by me below:

    class Danmutator extends Mutator;

    var GameRules NextGameRules;

    function PostBeginPlay()
    {
    local GameRules G;
    local Pawn Mypawn;

    super.PostBeginPlay( );
    G = spawn( class'Danmutator' );
    if( Level.Game.GameRulesModifiers == None )
    Level.Game.GameRulesModifiers = G;
    else
    Level.Game.GameRulesModifiers.AddGameRules( G );

    foreach AllActors(class 'Pawn', Mypawn)
    {
    if(Mypawn.IsA('PlayerPawn') == True){
    Mypawn.zjump=1000;
    Mypawn.default.zjump=1000;
    Mypawn.DamageScaling=3;
    Mypawn.default.DamageScaling=3;
    }
    }
    }

    #2
    Im not an unrealscript expert, but from what i can see, Danmutator is a subclass of the mutator class.

    Gamerules != mutator

    and you are assigning a mutator to gamerules

    what exactly are u trying to do?
    I've done something similar, perhaps if u look at my code it will help:

    Code:
    // Mutator Class
    class MutVampFrenzy extends Mutator;
    
    var() int healthDecrease;
    
    
    function PostBeginPlay()
    {
    	local GameRules G;
    
    	Super.PostBeginPlay();
    	G = spawn(class'VampFrenzyGameRules');
    	if ( Level.Game.GameRulesModifiers == None )
    		Level.Game.GameRulesModifiers = G;
    	else
    		Level.Game.GameRulesModifiers.AddGameRules(G);
    }
     //Whatever else needs to be done in the mutator
    and

    Code:
    // GameRules class
    
    class VampFrenzyGameRules extends VampireGameRules;
    // You just stick whatever needs to be done as part of gamerules
    defaultproperties {
       ConversionRatio=0.3
    }

    Comment

    Working...
    X