Page 1 of 1

Question On Armors.dfn files

Posted: Mon Jan 16, 2012 9:43 pm
by dragon slayer
Okay i was going though them as i decided to make new armors and noticed we had duped ids

example

in bone.dfn you have all the bone armor both ids for each peice. Then in base_armor.dfn you have bone armor using one of those ids and its got all the stats.

I don't know if this was the plain or you just havent had time to remove the duped ids. after making base.

because i went though and removed the duped id left the base_armor.dfn

example

// Bone Armor
[bone_arms]
{
get=base_item
name=bone arms
id=0x144e
weight=200
value=100 50
layer=0x13
def=30
hp=30
str=40
decay=1
good=14
}

You have this one and a nother one using same id but refering to this item. so i removed the one refering to this one.

so i only ended up with this in my bone.dfn
[0x1453]
{
get=bone_arms
name=bone arms
id=0x1453
}

Then again to me that makes much more since then having the server search though and grab item after item. plus it shrinks down the dfn files some.

Re: Question On Armors.dfn files

Posted: Wed Jan 18, 2012 3:28 am
by Xuri
It's setup like this intentionally, both to make it easier to maintain and to make creation of custom items easier. You just get the base version of whatever item you're customizing, and then only add the things you want to customize (which will override what is set in the base-item).

I guess it makes more sense when looking at the metal armors rather than the bone armor, though. Instead of having 9 complete entries for a platearmor chest (one for each ore-type), all with the exact same stats and settings (originally the only thing that made them different were the colors), you have one base-item with all the default stats already set, then each version just contain the differences while keeping the base stats.

Also, keep in mind that the unique part is the [item header], not the id= tag. The base-items don't use the IDs in the headers, so there are no actual dupes. When doing 'ADD ITEM 0x#### (or add through menu, or CreateDFNItem JS method) you're adding a DFN item based on its header-iD, in this case [0x####], while when you're doing 'ADD 0x#### (or CreateBlankItem JS method) you're adding the blank/tiledata version of an item based on the actual GFX-id of that item.

Re: Question On Armors.dfn files

Posted: Wed Jan 18, 2012 3:53 am
by dragon slayer
oh hehe okay hehe. well items files kinda confused me a lot with all the ids being doubled up like that. but its understandable now :)