damage function in a mutator

Discussions about Coding and Scripting
Post Reply
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

damage function in a mutator

Post by Rakiayn »

Is it possible to use a damage function in a mutator? as you can do in a gametype or pawn?
I made this code and added a broadcastmessage to the function to check if it is called , but it never does
any ideas?

Code: Select all

function MutatorTakeDamage( out int ActualDamage, Pawn Victim, Pawn InstigatedBy, out Vector HitLocation,
                				out Vector Momentum, name DamageType)
{
        local inventory s;

	if ( NextDamageMutator != None )
		NextDamageMutator.MutatorTakeDamage( ActualDamage, Victim, InstigatedBy, HitLocation, Momentum, DamageType );
		
        BroadcastMessage("mutatortakedamage");
        if (playerpawn(InstigatedBy) != none)
        {
        s = InstigatedBy.FindInventoryType(class'S_MMSpawner');

                if (s != none)
                {
                s_MMspawner(s).ownerinfo.damagedone[4] = s_MMspawner(s).ownerinfo.damagedone[3];
                s_MMspawner(s).ownerinfo.damagedone[3] = s_MMspawner(s).ownerinfo.damagedone[2];
                s_MMspawner(s).ownerinfo.damagedone[2] = s_MMspawner(s).ownerinfo.damagedone[1];
                s_MMspawner(s).ownerinfo.damagedone[1] = s_MMspawner(s).ownerinfo.damagedone[0];
                s_MMspawner(s).ownerinfo.damagedone[0] = actualdamage;
                }
        }
}
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: damage function in a mutator

Post by Rakiayn »

never mind, I already found the answer.
the mutator has to be registered as a damage mutator
read more about it here:
http://wiki.beyondunreal.com/Legacy:Mod ... _A_Mutator
Post Reply