punto_vert.gif (43 byte)
Materials Area

Materials->Clive Barker's Undying->Scripting: Assigning new skins to Undying Meshes [ Search ]

Scripting: Assigning new skins to Undying Meshes
Title Scripting: Assigning new skins to Undying Meshes
Description Using UnrealScript to set new skins to existing meshes
Sent by burt


This is a brief step-by-step tutorial explaining how to create a Pawn with new skin.

PART I - Creating Zombie Maid pawn

1. Go to your "Undying\System" folder with an Explorer and open System.ini file there with a Notepad.

2. Scroll down to [Editor.EditorEngine] section, at the end of this section you'll see a couple of strings like


3. Add new line "EditPackages=LivingDead" right after the last line of this section:


This will tell the editor to open new script package called "LivingDead.u" each time it starts. We'll create this package below.

4. Scroll up to the beginning of the file and look for "SourceDir=..." line in section [URL].
At the right part of this line (after "=") you'll see a folder where Undying will search for any new scripts you can make. So, you should create a folder on your hard-drive, which WILL NOT CONTAIN SPACES in its name. I can recommend you to use "C:\UndyingScripts".

Now you should modify "SourceDir=..." line to "SourceDir=C:\UndyingScripts".

5. Save the file and close Notepad.

6. Go to "C:\UndyingScripts" folder. Now here you should create a subfolder for your new package, let's call it "LivingDead". Go inside this folder after you create it and create two subfolders there: one called "Textures" and other called "Classes".

7. Go inside "Classes" folder, and create a new file there named "ZombieMaid.uc", ".uc" extension is required. Open this file with Notepad.

8. Paste the following in Notepad:

// ZombieMaid.
class ZombieMaid expands Maid;

// This function is called right before game begins, so this is a right place to
// set new skin.
function PreBeginPlay()
    local Texture t; // local variable in which we'll load new textures
    Super.PreBeginPlay(); // don't forget to call this function from PreBeginPlay()
    // load new texture, full path to texture is "Aeons.Meshes.ServtBEaten01",
    // and this one is a texture of eaten servant.
    t = Texture( DynamicLoadObject( "Aeons.Meshes.ServtBEaten01", class'Texture' ) );
    // assing this texture to our Pawn (ZombieMaid). We should replace two textures,
    // as Maid's mesh uses two different textures for skinning. So this is the first one:
    SetTexture( 1, t );
    // now load next texture and assign it
    t = Texture( DynamicLoadObject( "Aeons.Meshes.ServtBEaten02", class'Texture' ) );
    SetTexture( 2, t );

And do not wrap lines!

9. Save the file and close Notepad.

10. Call "Run..." from your Windows Start Menu, and browse for "Undying\System\ucc.exe" file. Click "Open" and add word "make" to the command line so it looks like "...Undying\System\ucc.exe make", space before "make" is required. Now run it. It should find new scripts and create a package "LivingDead.u" in your "Undying\System" folder.

11. Open UndEd or UndEd2 and create a simple map, then open Actor Browser and select Visible->Pawn->ScriptedPawn->ScriptedBiped->ScriptedNarrator->Servant->Maid->ZombieMaid actor.

12. Insert this actor in your map, build map and save it.

13. Run the map and you should see zombie maid staring at you!

If you'll encounter any troubles, please carefully check if you missed to do something.

PART II - creating Zombie Trsanti pawn

14. As you did in Part I, go to "C:\UndyingScripts\LivingDead\Classes" folder.

15. Create a new file called "TrsantiZombie.uc" and open it with Notepad.

16. Fill it with the following:

// TrsantiZombie.
class TrsantiZombie expands Trsanti;

#exec Texture Import File=Textures\MaleZombie01.pcx Group=Skins
#exec Texture Import File=Textures\MaleZombie02.pcx Group=Skins

function PreBeginPlay()
    local texture t;
    t = texture( DynamicLoadObject( "LivingDead.Skins.MaleZombie02", class'Texture' ) );
    SetTexture( 1, t );
    t = texture( DynamicLoadObject( "LivingDead.Skins.MaleZombie01", class'Texture' ) );
    SetTexture( 2, t );

// Animation trigger functions.

function PlayRun()

// def props


This is a script for TrsantiZombie pawn. It has some new stuff we should discuss:

  • "#exec Texture Import" statement

    This statement allows us to import different textures right inside our LivingDead.u package, so we shouldn't distribute a separate .utx file for our scripts.
    Texture files for import should be stored in "C:\UndyingClasses\LivingDead\Textures" folder, as Undying will search for them in that folder.
    You should set a name of texture file in "File=" and point a group in "Group=". Group is not required, but it's better to use it. Set "Group=Skins" for skins, and it'll be just fine.

    In the attached archive you'll find two texture files: MaleZombie01.pcx and MaleZombie02.pcx. Place them inside your "C:\UndyingClasses\LivingDead\Textures" folder.
  • t = texture( DynamicLoadObject( "LivingDead.Skins.MaleZombie01", class'Texture' ) );

    As you can see here, full path to newly imported texture is combined of three parts:


    Our PackageName is LivingDead, GroupName is Skins (as you set in "#exec Texture Import") and TextureName is "MaleZombie01" and "MaleZombie02" as you set in "File=..." property of "#exec...", without .pcx extension.
  • defaultproperties section

    Well, I've played around with this ZombieTrsanti and he won't have a revolver anymore, and will only be able to walk slowly and hit you with his sword. Also he will become less intellectual.
    You shouldn't bother about this section now, I've included it just for fun, along with PlayRun() function.

17. Well, now save the file and close Notepad.

18. Call "Run..." from your Windows Start Menu, and browse for "Undying\System\ucc.exe" file.
Click "Open" and add word "make" to the command line so it looks like "...Undying\System\ucc.exe make", space before "make" is required. Now run it. It should find new scripts and update your "LivingDead.u" package.

19. Open the Editor and as in Part I add Visible->Pawn->ScriptedPawn->ScriptedBiped->Trsanti->TrsantiZombie actor in your map. Build, save and run and you should be attacked by a dead Trsanti!

Hope you'll make it and have no troubles, good luck!

You can download all the scripts, textures and package itself here.

(c) burt, 2005

Votes Votes: 2 - Average: 4.5

Add a Comment Rate

There are 6 materials on the Database
Most Viewed: Undying Timeline
Most Rated: Interview: Clive Barker Talks About Undying

Total users browsing Materials Area: 0 (0 Registered Members 0 Guests and 0 Anonymous Members)
Visible members are:

MKPReviews - ©2004 All Rights Reserved
modified by burt ©2005 - All Rights Reserved
punto_vert.gif (43 byte)

[Send a letter to Webmaster]

Undying Italia is powered by

MKPortal M 0.5 ©2003-2004 - All Rights Reserved
modified by burt ©2005 - All Rights Reserved