Page 1 of 1

Replacing Player Skins with a mutator

Posted: 24 Jun 2019, 19:59
by Lightning Hunter
Edit: I have actually found a solution. I just needed to add 'PlayerPawn' to the classes in the code below, and I had to replace MultiSkins[0] instead of the skin itself (in case anyone finds this post and needs to perform this task themselves).

Can any coders out there help me with mutator code that works with replacing player skins? Ahaigh and I have already created replacement HD skins for all of the Unreal player skins, but the existing mutator I have does not work. It only works with the player carcasses. Here is an example of the current mutator code:

Code: Select all

/=============================================================================
// HDSkinNotify.
//=============================================================================
class HDSkinsNotify expands SpawnNotify;

var Actor PendingActors[64];
var int   PendingActorsCount;

//============================================================
simulated function PostBeginPlay()
{
   local Actor A;

   foreach AllActors( Class'Actor', A )
      ModifyThing(A);

   Super.PostBeginPlay();
}


//============================================================
event Actor SpawnNotification( actor A )
{
   ModifyThing(A);

   return A;
}

function Tick(float deltaTime)
{
    local int i;
    local actor A;
   
    for(i=0;i<PendingActorsCount;i++)
    {
        A = PendingActors[i];
        DelayedModifyThing(A);
    }
   
    PendingActorsCount = 0;
}

//============================================================
function ModifyThing( Actor A )
{
     if(A.Mesh != None)
     {
          if( A.Mesh == LodMesh'UnrealShare.Skaarjw' )
      {
         if( A.Skin == None )
            A.Skin = Texture'HDSkins2.HDSkaarjw1';
         else if( A.Skin == Texture'SkaarjL' )
            A.Skin = Texture'HDSkins2.HDSkaarjL';
         else if( A.Skin == Texture'Skaarjw2' )
            A.Skin = Texture'HDSkins2.HDSkaarjw2';
         else if( A.Skin == Texture'Skaarjw3' )
            A.Skin = Texture'HDSkins2.HDSkaarjw3';
         else if( A.Skin == Texture'Skaarjw4' )
            A.Skin = Texture'HDSkins2.HDSkaarjw4';
         else if( A.Skin == Texture'Skaarjw5' )
            A.Skin = Texture'HDSkins2.HDSkaarjw5';
      }
   }
}
if(A.IsA('CreatureChunks') || A.IsA('Fragment') || A.IsA('Chunk') || A.Class.Name == 'olCreatureChunks')
    {
       if(PendingActorsCount<64)
       {
          PendingActors[PendingActorsCount] = A;
          PendingActorsCount++;
       }
      else
      {
        log("Too much stuff - some won't be reskinned.");
      }
       return;
}
    DelayedModifyThing(A);
}

function DelayedModifyThing(actor A)
{
     if(A.Mesh != None)
     {
   //.......................................Gibs...........................................

      if( A.Mesh == LodMesh'UnrealI.BigChunk1' )
         {
         if( A.MultiSkins[1] == None )
            A.MultiSkins[1] = Texture'HDSkins2.HDJgcow1';
    }
  }
}
The code above is only an example of how the mutator replaces the Skaarj skin and a gib skin. They work differently, since the second part of the code has a delay in order to properly replace gibs. I have tried putting player skins in both parts of the mutator, and neither way will replace Player Skins. Any ideas?