How to create your own Torchlight monster varieties, using existing Torchlight models

This article is an Island. It cannot be linked to using wiki BB-codes.
How create your own monster varieties in Torchlight, using existing Torchlight models. This guide assumes you have little to no Torchlight modding experience...


This guide is written using Windows XP with the game purchased directly from Runic, there may be slight differences in the modding process for other Operating Systems and other game purchase sources.

Attached to this guide is a zip file of the working mod created using htis guide, for your reference. (http://www.runicgamesfansite.com/mis...chments&t=3189)

[top]1. Mod Preparations

To get Torchlight ready for mods I recommend generating the Bebop's Torchlight modding file preparations ".bat" file as described here (http://forums.runicgames.com/viewtopic.php?f=6&t=4911)

A. From Bebop:
Instead of running torchlight.exe just make sure you run testtorchlightmods.bat first. If you just want to create the bat file here is the code...

Code:
del "%appdata%\runic games\torchlight\*.adm" /Q/F/S
del "%appdata%\runic games\torchlight\*.cmp" /Q/F/S
del "%appdata%\runic games\torchlight\massfile.dat"
del "%appdata%\runic games\torchlight\masterresourceunits.dat"
del "%appdata%\runic games\torchlight\mods\mods.dat"
torchlight.exe
i. Take the above code and paste it in a NOTEPAD text file. If you are not sure what or where notepad is then just type NOTEPAD into the Windows START>RUN prompt and click OK.

ii. Save this Notepad file as testtorchlightmods.bat (not a txt file) in your Torchlight root directory, typically (C:\Program Files\Runic Games\Torchlight). This file must be in the same location as your Torchlight.exe game executable.

iii. Right click on your Torchlight desktop shortcut and select Properties.
1. On the Shortcut tab paste the link to your newly created bat file in the Target field (C:\Program Files\Runic Games\Torchlight\TorchlightModRefresh.bat) and click OK.
2. From now on when you start Torchlight all the compiled mod files will be cleaned out and then recompiled to ensure no new mods are skipped (do not be frightened by a black dos prompt window that will now open). Note that this does not prevent mod file conflicts or modding errors.

[top]2. Open the folders we will be using throughout this mod.

A. Typically the easiest way to get to your mod folder is by typing %appdata% in your Windows START>RUN prompt and clicking OK.

B. In the folder that opens find your way to your "mods" folder, my directory is (C:\Documents and Settings\HP_Administrator\Application Data\runic games\torchlight\mods), where %appdata% should bring you directly to the Application Data directory.

C. We are also going to want to open our TorchED media folder (C:\Program Files\Runic Games\TorchED\media). You will be accessing the "mods" folder and (TorchED\media) folder frequently for most modding purposes so I suggest creating shortcuts for quick access in the future.

[top]3. Make the base folder for our mod to call home.

A. In the mods folder we opened create a new folder and name it whatever you want. I am going to name it MonsterGuide. (...\Application Data\runic games\torchlight\mods\MonsterGuide) Note that mod files take alphabetically folder precedence if there are conflicts, so if you have a mod in folder POOPER with monster unit file BROWNDUMPER and the same unit file name in mod folder TROOPER, Torchlight with select the file from POOPER and ignore the file in TROOPER.

B. In the new folder "MonsterGuide" create a folder and name it media. (...\mods\MonsterGuide\media) All our mod files and folders will have to be inside this media folder. It is generally good practice to keep your mod folder structure exactly the same as the folder structure used in the TorchED folder we opened earlier.

[top]4. Creating a new SKIN.

A. Most monsters are generally edited the same way, but we are going to stick with the simplest monster here, the skeleton. All the skeleton model and texture files can be found in the skeleton models folder in TorchED (C:\Program Files\Runic Games\TorchED\media\models\skeleton).

B. To determine which image file the skeleton is currently using we need to open the "skeleton.material" file using Notepad or some other simple text editor (...\TorchED\media\models\skeleton\skeleton.material).
i. In the "skeleton.material" we see two things of importance. First is "material 15_-_Defaultaaa" that gives the material a name within Torchlight, which we will be using later on in this guide. Second is of immediate interest, "texture skeleton_diffuse.png" tells us that "skeleton_diffuse.png" is the image file currently being used as the skeleton skin, so this is what we want to use. You might notice that the actual file in this location is "skeleton_diffuse.dds", which will not impact us at this point.

ii. In the mods media folder we created create a new folder called models followed by another folder with the name of your new skeleton monster, I will call it blueskeleton (...mods\MonsterGuide\media\models\blueskeleton).

iii. Copy the "skeleton_diffuse.dds" file over from the TorchED directory into the new folder you just created (...\blueskeleton). We will edit this copied file and leave the original file in TorchED alone.

iv. Rename this image file in the mods folder tree to "skeleton_diffuse_blueskel.dds", or something else.

v. We will now open this new image file and edit it. I use Photoshop to edit my images, but any program that can handle DDS files will work. If your version of Photoshop can not interpret DDS file you may need to download and install the plugin at http://developer.nvidia.com/object/photoshop_dds_plugins.html
1. Once the image is open edit it however you want. For this guide I am simply going to change the tint to blue. Note that there are several ways to frequently see the image you are editing appear on the model while you are editing it so you don't have to wait for the final product to see if you image looks good on the model, but I will not be covering that here. If you are curious you need to import the base model into a 3D program like blender, unwrap the model, and apply the texture, then just reload the texture as you save changes.

2. Note that DDS files have an embedded ALPHA channel that Torchlight uses to set transparency. I will not be adjusting that here, but know that if you paint on this channel you will altering what part(s) of the image are set to transparent, as seen in red on the screenshot below.

3. We are now going to save the file. You can save it as a PNG, but for best results I recommend saving it as a DDS file. When saving it as a DDS ensure that you use the setting shown in the attached screenshot.

[top]5. Creating the new unit file

A. Locate the basic skeleton unit file in TorchED. The file is C:\Program Files\Runic Games\TorchED\media\units\monsters\SkeletonWarrior\skeletonwarriorunarmed.dat

B. Create a folder tree in your mod folder the mirrors this TorchED folder tree, but feel free to rename the folders. Your added folder structure should be something like the following (...MonsterGuide\media\units\monsters\Skeletonblue).

C. Copy the "skeletonwarriorunarmed.dat" file from TorchED and paste it in your newly created mod folder structure.

D. You must rename this file, I will rename it "skeletonwarriorunarmedblue.dat"

E. Open the new file with Notepad or some other simple text editor.

F. There are many different variable that can be changed here (including several not showcased in this unit file), but I will only be touching on a few of them. Most of the variables are pretty self explanatory, but note that values in the units file are generally multipliers, so a hp of 60 is 60% of the base health for the unit at a given level, not simply 60 hit points.
i. Change <STRING>NAME:Skeleton to <STRING>NAME:SkeletonBlue or some other unique name. If you do not give the unit file a unique name it will take the place of all the existing basic unarmed skeletons in the game. If you are adding monsters to a spawnclass, as addressed later, or directly into a level using the TorchED program this NAME is how Torchlight references the unit.

ii. Delete the numbers at the end of <STRING>UNIT_GUID:-3195029610964119074 so that it simply is displayed as <STRING>UNIT_GUID: as each of these numbers must be unique within the game and for unit files Torchlight will automatically set this number to an unused value for us once we start the game. Note that certain files within Torchlight must be have this unique number set manually, but for our purposes here we do not need to set it manually.

iii. Change the display name <TRANSLATE>DISPLAYNAME:Skeleton to whatever you want it to show up as in game, I will set it as follows <TRANSLATE>DISPLAYNAME:Frosty Skeleton

iv. Set the ice armor to a high value so that it takes very little damage from ice effects. Change <INTEGER>ARMOR_ICE:50 to <INTEGER>ARMOR_ICE:200

v. Give the monster a special skill by adding the following lines just before the [/UNIT] tag at the end of the file text.
Code:
[SKILL]
<STRING>NAME:Elemental Frostball
<STRING>ANIMATION_OVERRIDE:Rslash2
<INTEGER>LEVEL:1
<INTEGER>LEVEL_REQUIRED:1
<INTEGER>CHANCE:10
<INTEGER>CANCEL_CHANCE:20
[/SKILL]
vi. Tell the unit to use our custom image file by adding the following on the lines just before the [/UNIT] tag at the end of the file text. MAKE SURE YOU DELETE THE SPACES ON skeleton_diffuse_blueskel.dds IN THE BELOW CODE, FOR SOME REASON THE SITE IS INJECTING SPACES...
Code:
[TEXTURE_REPLACE]
<STRING>NAME:15_-_Defaultaaa
<STRING>TEXTURE:media\models\blueskeleton\skeleton _diffuse_blueskel.dds
[/TEXTURE_REPLACE]
You may notice that that name is the material name we saw earlier and the texture is our custom texture file. We are basically telling Torchlight to use our custom texture file instead of the default one. There is an alternative way of doing this, but to keep things simple just use this technique for now. You can technically place these lines anywhere in the unit file so long as they do not fall within another tag, like in-between [Treasure] and [/Treasure].

G. Now save and close this unit file.

[top]6. Modifying Spawnclasses to get the monster into the game

A. Locate the Spawnclass you want the new monster to show up in. For this Guide we will edit the basic unarmed skeleton spawnclass that tells the unarmed skeleton to spawn on occasion when you kill one of the armed skeleton warriors. Our spawnclass of interest is C:\Program Files\Runic Games\TorchED\media\Spawnclasses\SKELETON_TREASURE.dat

B. Create a folder tree in your mod folder the mirrors this TorchED folder tree. Your added folder structure should be something like the following (...MonsterGuide\media\Spawnclasses)

C. Copy the "SKELETON_TREASURE.dat" from the TorchED folder and paste it in our newly created mod spawnclass folder.

D. Rename this file in the new mods spawnclass folder; this file must have a unique filename for it not to cause any problems in Torchlight. I will rename it "SKELETON_TREASURE_GUIDE_AG.dat"

E. Open this spawnclass file we renamed.
i. Delete the last two objects in this file so that contents are as follows:
Code:
[SPAWNCLASS]
<STRING>NAME:SKELETON_TREASURE
[OBJECT]
<STRING>UNIT:Skeleton
<INTEGER>WEIGHT:3
<INTEGER>MINCOUNT:1
<INTEGER>MAXCOUNT:3
[/OBJECT]
[/SPAWNCLASS]
ii. Now change the unit string to reference our new unit. Change <STRING>UNIT:Skeleton to <STRING>UNIT:SkeletonBlue

iii. You can adjust the WEIGHT value as you desire, but I will leave it at 3. The weight determines how likely it is that this event with occur, so our previous weight of 92, 8, and 3 plus out newly added object with weight 3 means that our new monster has a likelihood of (3/(92+8+3+3)) to spawn when the game calls the SKELETON_TREASURE spawnclass.

Note that we want to keep the spawnclass NAME unaltered for this purpose as Torchlight will merge our custom file with that of the existing Torchlight game file of the same NAME for spawnclasses, which is why we removed the other objects.

Now it is time to start the game and see the new monster in action. For more advanced monster modifications I recommend looking at the other monster unit files within TorchED to see what monsters are capable and just proceed by example. Or seek answers to specific question on the official Torchlight forums.
Attached Images How to create your own Torchlight monster varieties, using existing Torchlight models-nvidiaoptions-jpg 
Attached Files
Created by , 10-05-2010 at 07:41 PM
Last edited by , 10-18-2010 at 10:09 PM
Last comment by on 10-19-2012 at 02:39 PM
3 Comments, 12,064 Views

Posting Permissions

Posting Permissions

  • You may not post new pages
  • You may not post comments
  • You may not post attachments
  • You may not edit your posts
  •