A Modding Tutorial: Coding
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:
Example: <ICON>:ICONS/ring.png:ICONS/ringa.png
The second defines the icon’s transparencies:
Example: <ICON>:ICONS/ring.png:ICONS/ringa.png
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.
<take_sound>:
<land_sound>:
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:
- <requires>:strength:70
- <requires>:dexterity:50
<merchant_maximum>:
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:
<type>:
<name>:
<rarity>:
<minimum_depth>:
<maximum_depth>:
<model>:
<animated_model>:
<collideable>:
<icon>:
<value>:
<takeable>:
<armor>:
<drop_sound>:
<take_sound>:
<land_sound>:
<requires>:
<merchant_minimum>:
<merchant_maximuM>:
[/item]
Okay, that's it for armor.
B. Weapons ( and Helmets )
Mostly the same, but some differences.
[item] same
<type>: same
<name>: same
<rarity>: same
<minimum_depth>: same
<maximum_depth>: same
This is the main difference, for weapons this defines how they look on the ground and on your character.
<icon>: same
<value>: same
<takeable>: same
<damage>:14:53
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.
<take_sound>: same
<drop_sound>: same
<land_sound>: same
<strike_sound>:
<strike_sound>:
<attack_sound>:
All four of these define the different sounds the weapon can make when it hits something.
Defines the sound it makes when you miss.
<merchant_maximum>: same
[/ITEM] same
Okay, that's basically it for weapons.
C. Shields and Helms
<type>: same
<name>: same
<rarity>: same
<minimum_depth>: same
<maximum_depth>: same
This defines what it looks like on the ground and on your player, like weapons.
<icon>: same
<value>: same
<takeable>: same
<armor>: same
<drop_sound>: same
<take_sound>: same
<land_sound>: same
<requires>: same
<merchant_minimum>: same
<merchant_maximum>: same
[/item] same
D. Monsters
Tells the program that a monster is being defined.
Defines what basic family the monster is in, spider, undead, insect ect.
<rarity>:same
Defines if the monster is for or against you.
Defines the level youll see the monster on most
<maximum_depth>:same
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.
<TYPE>:SHIRT
<NAME>:Banded Mail
<RARITY>:900
<MINIMUM_DEPTH>:32
<MODEL>:ITEMS/bandedmail.mdl
<ANIMATED_MODEL>:PLAYER/bandedmail.sms
<COLLIDEABLE>:0
<ICON>:ICONS/bandedmail.png:ICONS/bandedmaila.png:96:96
<VALUE>:13571
<TAKEABLE>:1
<ARMOR>:66:71
<DROP_SOUND>:SOUNDS/ITEMS/fall.wav
<TAKE_SOUND>:SOUNDS/ITEMS/plateget.wav
<LAND_SOUND>:SOUNDS/ITEMS/platedrop.wav
<REQUIRES>:STRENGTH:65
<MERCHANT_MINIMUM>:11
[/ITEM]
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:
<ACTIVATION>:PASSIVE
<TYPE>:
<DURATION>:INSTANT
<VALUE>:
[/EFFECT]
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.