A Modding Tutorial: Coding
This is a basic modding tutorial. It explains how to recolor items, monsters, and armor, how to program, how to pack items when you're finished, and how to use Paint in detail.
Part I: this page covers the *.dat file “tags” and explains what they are defining about the item or monster.
1. Recoloring Items and Monsters
B. Recoloring Without Replacing the Original
2. Reflections and Transparencies
1. A Mushroom Example
A. Basic Way
B. Material Override
C. How To Do It With Weapons, Helms, and Shields
D. How To Do It With Armor
PART I: CODING
1. What Everything Means
A. Armor (not including helmets or shields)
Here is a basic idea of what an armor definition file looks like for armor:
(This only applies to chest plates, gloves, and boots. Helmets and shields are coded like weapons... Why? I dont know.)
All items start with this tag. This tells the game that this is an item, not a spell or monster.
Next, this tag defines whether this is petfood, a helmet, a sword, ect.
- 0 = very common
- 500 = reasonably common
- 700 = reasonably rare
- 900 = very rare
- 1000 = this will not appear in the game unless you summon it. It is used on things like a creature you want only to be able to see when summoned, or an item you want not to appear.
Next on the list is this tag, which is the minimum dungeon level you must be on to see the item.
And after that, this tag is the maximum dungeon you will see the item on. This is so you stop seeing easy monsters and weak items as you go on.
Then this tag is what an item looks like on the ground.
Then this tag is what the item looks like on your character.
Next tag is whether you can run into it: 0 for no, 1 for yes. ( Props you can; weapons and armor you can’t ).
Next is, which defines what the item will look like in you inventory. There are two icons.
The first defines the color of the icon:
The second defines the icon’s transparencies:
How much gold the item is worth
This is whether you can take it or not; items are takeable, props are not. 1 = yes 0 = no.
How much protection this item is worth when worn, done in minimum:maximum format.
Tells the computer what sound to play then the item is dropped, taken, or lands.
For stat, level, renown, or skill, this defines how good your character has to be to use the item.
You need to add a ‘requires’ tag for every requirement, so if you want some gloves to require 70 strength and 50 dexterity, it’ll look like this:
These are the same as dungeon min/max, except with merchants. The merchant’s items gain levels as you gain levels.
All items end with this closing tag.
So, we have this:
Okay, that's it for armor.
B. Weapons ( and Helmets )
Mostly the same, but some differences.
This is the main difference, for weapons this defines how they look on the ground and on your character.
Defines the min and max damage.
Defines radius of circle a target must be within to start an attack.
Defines radius of circle a target must be within to succeed in an attack.
Defines how fast the weapon is: slowest, slow, normal, fast, or fastest.
All four of these define the different sounds the weapon can make when it hits something.
Defines the sound it makes when you miss.
Okay, that's basically it for weapons.
C. Shields and Helms
This defines what it looks like on the ground and on your player, like weapons.
Tells the program that a monster is being defined.
Defines what basic family the monster is in, spider, undead, insect ect.
Defines if the monster is for or against you.
Defines the level youll see the monster on most
Defines what the monster looks like in gameplay as far as modeling, not texture.
This defines clipping planes for the monster; never change this when you make new monsters.
Defines how big the monster is. It appears like this: #:#. Don’t change the first number. The second number you can change like this: 2 is 2 times as big as original model, 4 is 4 times, .5 is half, and so on.
How fast the creature walks.
How fast the creature runs.
How fast the creature turns.
How far the creature can see.
How close a monster has to be to react to your movements.
How close a monster has to be for it to react to your presence.
How far away a monster has to get for the it to stop following.
The min and max hit points this monster has, laid out like this: min:max.
How much natural armor the monster has.
Defines a creatures’s chance of hitting an opponent.
This block defines the parameters for the creatures unarmed attack
Opens the unarmed attack block.
Selects the creature’s attack animation.
The monster’s reach.
The min and max damage when unarmed.
The unarmed damage type
Closes the unarmed attack block.
How much strength a monster has.
How much dexterity a monster has.
How much vitality a monster has.
How much magic a monster has.
How much experience a monster is worth.
Sound a monster makes when it dies.
Sound a monster makes when it’s not doing anything.
Sound a monster makes when it roars.
Sound a creature makes when it steps.
Sound it makes when it strikes.
Sound a monster makes when it attacks.
Sound it makes when it attacks armed.
What color a creature’s blood is.
How close you have to be to hear a monster’s various noises.
What weapons it can equip ( you can take away weapon types, but as far as I know you cannot add weapon types to this ).
What weapons a creature is most likely to appear with.
Monster files end with this.
2. An Example
A. Banded Mail
Say you want to make a piece of armor that looks like banded mail, has 100-102 defense, costs 30,000, and is on dungeon levels 45 and up.
Here's what to do:
Copy the banded mail file into a new document in Notepad.
Change the armor to <armor>:100:102
Change the value to <value>:30000
Change the minimum depth to <minimum_depth>:45
GOOD, now save this in your mods folder in a mod folder called whatever you want. In that mod folder, save it in a folder called “ITEMS” and name it “items.dat”. Make sure you save it as “all files” instead of a text document, or else you’ll get items.dat.txt.
Now, open Mod Manager. Apply your mod and your armor will appear!
You can do the same with monsters and weapons, spells are a little trickier.
B. Adding Effects
You can add effects to all items you can equip. Here’s how.
After all the other stuff but before the [/ITEM] add this:
Then fill in the <type>: with any skill or effect. When you put in skills, the word skill goes first. like this: skillsword, not swordskill. You can also add strength, percentstrength, hprecharge, or any other effect.
Then fill in <value>: with an amount you want to increase your <type>: entry by. For example, if your “type” entry is “percentstrength”, you can enter <value>:10 to get a 10 percent increase to your strength stat.