Birds fly. Sun shines. And brother? Brutes shoot people.

[Released] Unreal HD Skins [UT] [227]

For discussion and promotion of Unreal Engine single-player campaigns, mapping projects and total conversions.

Moderators: Semfry, ividyon

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 05 Sep 2016, 19:41

You could probably vastly simplify this with a Spawn Notify that gets spawned by the mutator, then use that to replace textures as creatures spawn. There looks like a lot of code there for what is essentially just taking each pawn and replacing a single variable.
Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 05 Sep 2016, 19:48

Buff Skeleton wrote:You could probably vastly simplify this with a Spawn Notify that gets spawned by the mutator, then use that to replace textures as creatures spawn. There looks like a lot of code there for what is essentially just taking each pawn and replacing a single variable.



Would you be so kind as to show me how it should look? I am a rubbish coder, and wouldn't know where to begin. I really wanted my focus on this project to be on skinning alone (I still want to skin the inventory if I figure a way to get these skins released). It would take me days to code something simple like this, which I don't have the time for. I've already wasted 3 days trying to get these skins imported in to UnrealShare. :/
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 05 Sep 2016, 20:20

Yeah, basically you create a SpawnNotify subclass called something like TextureSwapplerator, then spawn that in your mutator's PreBeginPlay. Then it runs in the background and automatically makes defined changes to actors as they spawn.

Here's a skeleton for you:

Code: Select all

//========================================================================================================
// NOTIFYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
//========================================================================================================
event Actor SpawnNotification( actor A )
{
   //============================================================
   // PAWNZ
   //============================================================
   if( Pawn(A)!=None )
   {
      // You can improve the if/else skyscraper shittiness somewhat by checking
      // for parent classes, then going into subclasses. It at least looks neater
      if( Brute(A)!=None )
      {
         if( Behemoth(A)!=None )
            A.Skin = Texture'YourPackage.YourGroup.YourBehemothSkin';
         else if( LesserBrute(A)!=None )
            A.Skin = Texture'YourPackage.YourGroup.YourLesserBruteSkin';
         else
            A.Skin = Texture'YourPackage.YourGroup.YourBruteSkin';
      }

      else if( Cow(A)!=None )
         A.Skin = ;

      else if( Devilfish(A)!=None )
         A.Skin = ;

      else if( Fly(A)!=None )
         A.Skin = ;

      else if( Gasbag(A)!=None )
      {
         A.MultiSkins[5] = ;
         A.MultiSkins[6] = ;
      }

      else if( Krall(A)!=None )
      {
         if( KrallElite(A)!=None )
            A.Skin = ;
         else
            A.Skin = ;
      }

      else if( Manta(A)!=None )
      {
         if( CaveManta(A)!=None )
            A.Skin = ;
         else
            A.Skin = ;
      }

      else if( Mercenary(A)!=None )
      {
         if( MercenaryElite(A)!=None )
            A.Skin = ;
         else
            A.Skin = ;
      }

      else if( Nali(A)!=None )
      {
         if( NaliPriest(A)!=None )
            A.Skin = ;
         else
            A.Skin = ;
      }

      else if( Pupae(A)!=None )
         A.Skin = ;

      else if( Queen(A)!=None )
         A.Skin = ;

      else if( Skaarj(A)!=None )
      {
         if( SkaarjTrooper(A)!=None )
         {
            if( SkaarjGunner(A)!=None )
               A.Skin = ;
            else if( SkaarjInfantry(A)!=None )
               A.Skin = ;
            else if( SkaarjOfficer(A)!=None )
               A.Skin = ;
            else if( SkaarjSniper(A)!=None )
               A.Skin = ;
            else
               A.Skin = ;
         }
         else if( SkaarjWarrior(A)!=None )
         {
            if( IceSkaarj(A)!=None )
               A.Skin = ;
            else if( SkaarjAssassin(A)!=None )
               A.Skin = ;
            else if( SkaarjBerserker(A)!=None )
               A.Skin = ;
            else if( SkaarjLord(A)!=None )
               A.Skin = ;
            else if( SkaarjScout(A)!=None )
               A.Skin = ;
            else
               A.Skin = ;
         }
      }

      else if( Slith(A)!=None )
         A.Skin = ;

      else if( Squid(A)!=None )
         A.Skin = ;

      else if( Tentacle(A)!=None )
         A.Skin = ;

      else if( Titan(A)!=None )
      {
         if( StoneTitan(A)!=None )
            A.Skin = ;
         else
            A.Skin = ;
      }

      else if( Warlord(A)!=None )
         A.Skin = ;
   }

   //============================================================
   // Decorations
   //============================================================
   else if( Decoration(A)!=None )
   {
      if( Book(A)!=None )
         A.Skin = Texture'YourPackage.YourGroup.YourBookSkin';

      else if( Barrel(A)!=None )
         A.Skin = Texture'YourPackage.YourGroup.YourBarrelSkin';

      else if( Carcass(A)!=None )
      {
         if( CreatureCarcass(A)!=None )
         {
            // Carc stuff
         }
         else if( CreatureChunks(A)!=None )
         {
            // GUTS
         }
      }

      // etc.
   }

   //============================================================
   // Items
   //============================================================
   else if( Inventory(A)!=None )
   {
      if( Superhealth(A)!=None )
         A.Skin = ;

      else if( Health(A)!=None
         A.Skin = ;

      // etc.
   }

   //============================================================
   // Whatever else (projectiles?)
   //============================================================
   else if( )
   {
      if( (A)!=None )
         A.Skin = ;
      else if( (A)!=None )
         A.Skin = ;

      // etc etc etc.
   }

   // etc etc etc etc etc etc etc TEEC TGYUEGRFKVHFJLBKDnm

   return A;
}


Note some actors, like the Gasbag, use MultiSkins, so you'll want to be sure you swap out A.Skin where appropriate. If you have A.Skin directly below an if() with no brackets and you need to add more, be sure to bracket the lines in so they all are applied to the same if() statement.

That's about it really -- it's mostly just the tedium of inserting values. But doing it in a good text editor like Notepad++ which lets you easily duplicate lines is faster, and you can use templates and such to speed it up, etc.
Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 05 Sep 2016, 20:50

Thanks for giving that example. I'm guessing your code checks for the class only? Is there a way to make it check for both the mesh and skin instead? The reason I want it done this way is because a custom map maker could then create a new pawn as a subclass of anything, and the skin would still be replaced if the mesh and skin match up. That's how the old mutator code worked. Also, it seems your code would replace custom skins with the default skin, since it is only going off the class. If you know how to make the code work the way I want, you can just change one line or something, and I can figure out the rest. :)

My other concern is that I spend hours adding all my skins to this code, and get the same type of lag I did with the other mutator. I hope that does not happen, or I would be back to square one!
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 06 Sep 2016, 04:55

Yeah, you may want to first just test and get it working with a handful of classes to see if it will behave properly. I don't see why it would cause any issues, though, performance-wise.

As for going based on mesh and texture, you could do that yeah -- instead of checking the class, you'd check A.Mesh and then operate from there. That would probably make this a hell of a lot simpler, too:

Code: Select all

      if( A.Mesh = Mesh'WhateverTheNameOfTheBruteMeshIs' )
      {
         if( A.Skin == Texture'BehemothSkinHere' )
            A.Skin = Texture'YourPackage.YourGroup.YourBehemothSkin';
         else if( A.Skin == Texture'LesserBruteSkinHere' )
            A.Skin = Texture'YourPackage.YourGroup.YourLesserBruteSkin';
         else if( A.Skin == None )
            A.Skin = Texture'YourPackage.YourGroup.YourBruteSkin';
      }


I considered this originally when I drew up that skeleton, but for some reason didn't consider that going by mesh and skin would probably actually be a lot easier in the long run. So yeah, do it that way!
Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 06 Sep 2016, 05:48

I am such a coding noob (plus, it's been years since I attempted anything). I created a mutator with this code:

Code: Select all

//=============================================================================
// HDSkinsMut.
//=============================================================================
class HDSkinsMut expands Mutator;

function PreBeginPlay()
{
   Spawn(Class'HDSkinNotify');
}


However, I can't compile the spawn notifier, due to "Line 11 Type mismatch in 'if'

Code: Select all

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

event Actor SpawnNotification( actor A )
{
   //============================================================
   // PAWNZ
   //============================================================
      if( A.Mesh = Mesh'UnrealShare.Skaarjw' )
      {
         if( A.Skin == Texture'None' )
            A.Skin = Texture'HDSkins2.HDskaarjw1';
         else if( A.Skin == Texture'LesserBruteSkinHere' )
            A.Skin = Texture'YourPackage.YourGroup.YourLesserBruteSkin';
         else if( A.Skin == None )
            A.Skin = Texture'YourPackage.YourGroup.YourBruteSkin';
      }
}


The line with the error is this one:

Code: Select all

      if( A.Mesh = Mesh'UnrealShare.Skaarjw' )


I'm sure I butchered something. Also, thanks for the help, Waff!
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar AlCapowned
Skaarj Elder Skaarj Elder
Posts: 1175
Joined: 19 Dec 2009, 22:25

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 06 Sep 2016, 06:12

You have to add an extra = to the one already in your if statement, and I think you need to change the second Mesh to LodMesh.

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 06 Sep 2016, 06:37

AlCapowned wrote:You have to add an extra = to the one already in your if statement, and I think you need to change the second Mesh to LodMesh.


I think that did it - but now I have another problem. UED won't let me compile code if a texture package is not loaded. In this case, the texture package is DXT1 textures which crash UED if I load them... Isn't there a way to change the driver so it loads them?
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 06 Sep 2016, 07:27

Edit: I got the game to run by adding "return A;" to the bottom of the code, but nothing is being replaced in-game. The skins are still default.

I got the code to compile, but now the game crashes with this:

Code: Select all

ScriptLog: Add mutator HDSkinsMut.HDSkinsMut
Critical: ULevel::SpawnActor
Critical: (HDSkinsNotify)
Critical: UObject::ProcessEvent
Critical: (HDSkinsMut MonsterTest.HDSkinsMut0, Function HDSkinsMut.HDSkinsMut.PreBeginPlay)
Critical: ULevel::SpawnActor
Critical: (HDSkinsMut)
Critical: UObject::ProcessEvent
Critical: (SinglePlayer2 MonsterTest.SinglePlayer0, Function Engine.GameInfo.InitGame)
Critical: BeginPlay
Critical: UGameEngine::LoadMap
Critical: LocalMapURL
Critical: UGameEngine::Browse
Critical: UGameEngine::Init
Critical: InitEngine
Exit: Executing UObject::StaticShutdownAfterError
Exit: Executing UWindowsClient::ShutdownAfterError


This is the Mutator code:

Code: Select all

//=============================================================================
// HDSkinsMut.
//=============================================================================
class HDSkinsMut expands Mutator;

function PreBeginPlay()
{
   Spawn(Class'HDSkinsNotify');
}


And this is the Spawn Notify code:

Code: Select all

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

event Actor SpawnNotification( actor A )
{
   //============================================================
   // PAWNZ
   //============================================================
      if( A.Mesh == LodMesh'UnrealShare.Skaarjw' )
      {
         if( A.Skin == Texture'Skaarjw1' )
            A.Skin = Texture'HDSkins2.HDskaarjw1';
         else if( A.Skin == Texture'SkaarjL' )
            A.Skin = Texture'HDSkins2.HDSkaarjL';
      }
}


Edit: I got the game to run by adding "return A;" to the bottom of the code, but nothing is being replaced in-game. The skins are still default.
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 07 Sep 2016, 05:53

If you window the game, then type "editactor class=scriptedpawn" when you're next to your Skaarj Warrior, and go to the Display submenu of its properties: if you change the skin manually by typing the name of the texture, does it switch, or just blank out?

If it sets the name but doesn't change the skin, you may need to use MultiSkins[1] instead of Skin for that mesh. Some meshes don't have that Skin field mapped properly and only respect MultiSkins[1].

Are the textures imported into the .u file, or housed in a separate .utx? You may need to do some #exec imports at the top of the class if they are in an external file. That's easy, though:

Code: Select all

#exec OBJ LOAD FILE="XFX.utx"   // Example. Put your package here in place of XFX, whether it's a .u or .utx
Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 07 Sep 2016, 07:43

I checked, and I am not able to change skins in the game to anything contained in my HDSkins2.utx package. However, I also noticed that using the mutator and spawnnotify, I am not even able to change the skins to another default skin (although it works in-game of course). For example, I just tried this code:

Code: Select all

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

event Actor SpawnNotification( actor A )
{
      if( A.Mesh == LodMesh'UnrealShare.Skaarjw' )
      {
         if( A.Skin == Texture'UnrealI.Skins.SkaarjL' )
            A.Skin = Texture'UnrealShare.Skins.Skaarjw1';
      }
return A;
}


This code should simply change the Skaarj Lord skin in to a normal Skaarj Warrior, but it does not. I wonder if spawn notify is even being called? Is this code correct?

Code: Select all

//=============================================================================
// HDSkinsMut.
//=============================================================================
class HDSkinsMut expands Mutator;

function PreBeginPlay()
{
   Spawn(Class'HDSkinsNotify');
}


I don't know why I can't even get a default skin to change to another default skin. Should be as easy as pie.
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 07 Sep 2016, 15:40

Yep, the mutator is super simple. Make sure it actually appears ingame - add some log() statements, like:

Put this in your mutator PreBeginPlay:

Code: Select all

log(self$" | Mutator initialized",'SkinSwapperDebuggin');


Put this within the first if() statement before the skin check of the SpawnNotify:

Code: Select all

log(self$" [ > ] Detected actor ["$A$"] with Skaarj Warrior mesh ["$A.LodMesh$"] - going to swap a skin",'SkinSwapperDebuggin');


This goes within the second if() statement:

Code: Select all

log(self$" [>>>] Gonna switch the skin from ["$A.Skin$"] to Skaarjw1",'SkinSwapperDebuggin');


And put this at the end just before the return A; statement:

Code: Select all

log(self$" [\\\] done with "$A$" | A.Mesh = "$A.Mesh$" | A.Skin = "$A.Skin,'SkinSwapperDebuggin');


Once those logs are in place, recompile and retest, and then look at your UnrealTournament.log file to see what comes up. If you don't find ANY log lines beginning with SkinSwapperDebuggin, then the code isn't executing -- probably because the mutator wasn't ever loaded. Make sure you actually have it enabled before you start the game, etc.

Also, are you testing by summoning a Skaarj, or just looking at existing ones already in the map? I think the SpawnNotify may need to be modified to run for all actors at the start, then begin running for new actors thereafter. But that's an easy fix.

Instead of putting all the code directly inside the SpawnNotification() event, you put it into its own function and call that from both PostBeginPlay() and SpawnNotification():

Code: Select all

//============================================================
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 ModifyThing( Actor A )
{
   // Rest of the swapper code goes here
}


That way, you run the swapper code for all actors at initialization, and then run it for each individual spawned actor as it comes.
Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 07 Sep 2016, 19:49

Now we are finally getting somewhere. That last bit of code you gave in your post works. However, there is a new problem. Many of the skins do not have any skin texture set at all (I believe the mesh itself has a default texture). I am unable to set the skin texture as "none", because then there is a compile error "Can't find texture 'None'". How do I replace a skin when there is no skin set? An example is the default Skaarj Warrior.

Code: Select all

//============================================================
function ModifyThing( Actor A )
{
      if( A.Mesh == LodMesh'UnrealShare.Skaarjw' )
      {
         if( A.Skin == Texture'None' ) //Obviously gives a compile error; What do I put here?
            A.Skin = Texture'UnrealShare.Skins.Jvase1';
      }
}
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 08 Sep 2016, 05:44

Skin == None, not Texture'None'
Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: High-Res Skin Project / Request for Skinners!

Post Posted: 08 Sep 2016, 10:46

So far, so good. I have coded in about half of the skins I've made, and I don't see any lag yet. Hopefully the lag doesn't start up once I've added them all!

I do have one minor concern. This code is completely based on the defaults of the Class, but what if someone changes the default skin? For example, the barrel skin is set to "JBarrel1". However, if you remove the skin and set it to "none", the barrel will appear the same. The reverse can apply to the Skaarj Warrior. The skin is set to "none", but you can set it to "skaarjw1" and have the same effect. The problem is that this code only checks for one or the other - not both. I could have the mutator check both ways, but that might start adding too many lines of code for the game to go through.

The bigger problem here is if someone sets a custom skin to a model using MultiSkins[0] instead of the Skin field. My mutator might not know this, because in some cases, it only checks for the skin field. The only way I can think of to prevent this is to have the mutator make sure MultiSkins[0] is set to "None" on top of checking for whatever is in the skin field.

Edit: Well, I guess the game puts MultiSkins[0] as priority over the Skin field, so my mutator does not replace it. The only real issue is if someone decides to add a default skin to a model that is set to "none", or they put an official skin using MultiSkins[0] instead of the Skin field (the HD skins will not show up then). An example would be using the SkaarjBerserker class, and changing the skin to the Ice Skaarj using the MultiSkins[0] field. I guess the chances of that happening are slim...
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

Previous Next

Who is online

Users browsing this forum: No registered users and 39 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited