coding in new item

https://attnam.com/topics/coding-in-new-item

The Cathedral of Attnam > Other Coding

#1 Aug 30, 2009, 5:26 am Hide

martys1103

im newbie coder and i need help with making item, this is my code:


Config SPIKED_SWORD;
{
DefaultSize = 70;
Possibility = 25;
WeaponCategory = SMALL_SWORDS;
DefaultMainVolume = 100;
DefaultSecondaryVolume = 50;
BitmapPos = 111, 46;
FormModifier = 50;
StrengthModifier = 100;
NameSingular = "spiked sword";
MainMaterialConfig = { 10, BRONZE, IRON, STEEL, METEORIC_STEEL, ADAMANT, DRACONIC_STEEL; }
SecondaryMaterialConfig = { 10, BRONZE, IRON, STEEL, METEORIC_STEEL, ADAMANT, DRACONIC_STEEL; }
MaterialConfigChances = { 10, 100, 75, 50, 25, 10, 5; }
Roundness = 5;
AttachedGod = CRUENTUS;
WieldedBitmapPos = 177, 378;
EnchantmentPlusChance = 5;
DamageFlags = SLASH|PIERCE;
}


when i try to run game it says odd numeric value "}". it seems there is no problems in this code. thanks for help

draconic steel is my customize material
#2 Aug 30, 2009, 6:29 am Hide

JoKe

martys1103 wrote
MainMaterialConfig = { 10, BRONZE, IRON, STEEL, METEORIC_STEEL, ADAMANT, DRACONIC_STEEL; }
SecondaryMaterialConfig = { 10, BRONZE, IRON, STEEL, METEORIC_STEEL, ADAMANT, DRACONIC_STEEL; }
MaterialConfigChances = { 10, 100, 75, 50, 25, 10, 5; }

There's the mistake. The first number tells the game how many material possibilites the item has. Since you have 10 there, it thinks the } is also a material and produces the error. Try this:

MainMaterialConfig = { 6, BRONZE, IRON, STEEL, METEORIC_STEEL, ADAMANT, DRACONIC_STEEL; }
SecondaryMaterialConfig = { 6, BRONZE, IRON, STEEL, METEORIC_STEEL, ADAMANT, DRACONIC_STEEL; }
MaterialConfigChances = { 6, 100, 75, 50, 25, 10, 5; }

I'm bad with handling the script, but that's what I think the problem is.
#3 Aug 30, 2009, 7:03 am Hide

martys1103

well now there is another problem: Fatal error: Unknown exception thrown. i dont know it is because of that code
#4 Aug 30, 2009, 10:30 am Hide

JoKe

Have you defined draconic steel and the sword in define.dat? If not, find the line #define ADAMANT (IRON_ALLEY_ID + 4) and add #define DRACONIC_STEEL (IRON_ALLEY_ID + 5) below it and #define SPIKED_SWORD 17 below #define HAMMER 16.
#5 Aug 30, 2009, 1:12 pm Hide

martys1103

yup, i did it before, draconic steel worked perfectly
#6 Aug 30, 2009, 2:30 pm Hide

JoKe

Hmm. I tried adding that by myself, it worked just fine. Couldn't use draconic steel for it, but since it worked for you it shouldn't matter.

You've probably messed something up by accident. If you haven't added anything else to the game yet, grab a fresh copy of the script and plug the sword in it.
#7 Aug 31, 2009, 12:21 am Hide

4zb4

Materials work fine with straight script editing... Weapons on the other hand, don't. Not for me anyway.
#8 Aug 31, 2009, 5:48 am Hide

martys1103

ok, deleted element and item and it works like before