The Cathedral of Attnam

Iter Vehemens ad Necem (IVAN)
Login
Username
Password


 Valid CSS  Valid HTML 4.01 Strict

coding in new item

The Cathedral of Attnam  >  Programming
Print

View profile
Send message
Find posts Find topics
 
Aug 30, 2009 at 10:26 am #1  !
martys1103
hedgehog


Joined: Aug 30, 2009
Posts: 7
coding in new item
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
 
 
View profile
Send messageSend email
Find posts Find topics
 
Aug 30, 2009 at 11:29 am #2  !
JoKe's Avatar
JoKe
The town crier


Joined: Sep 22, 2008
Occupation: Medic
Location: Army
Interests: Watching others from the woods
Posts: 288
Groups:

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.
 
 
View profile
Send message
Find posts Find topics
 
Aug 30, 2009 at 12:03 pm #3  !
martys1103
hedgehog


Joined: Aug 30, 2009
Posts: 7
well now there is another problem: Fatal error: Unknown exception thrown. i dont know it is because of that code
 
 
View profile
Send messageSend email
Find posts Find topics
 
Aug 30, 2009 at 3:30 pm #4  !
JoKe's Avatar
JoKe
The town crier


Joined: Sep 22, 2008
Occupation: Medic
Location: Army
Interests: Watching others from the woods
Posts: 288
Groups:
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.
 
 
View profile
Send message
Find posts Find topics
 
Aug 30, 2009 at 6:12 pm #5  !
martys1103
hedgehog


Joined: Aug 30, 2009
Posts: 7
yup, i did it before, draconic steel worked perfectly
 
 
View profile
Send messageSend email
Find posts Find topics
 
Aug 30, 2009 at 7:30 pm #6  !
JoKe's Avatar
JoKe
The town crier


Joined: Sep 22, 2008
Occupation: Medic
Location: Army
Interests: Watching others from the woods
Posts: 288
Groups:
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.
 
 
View profile
Send message
Find posts Find topics
 
Aug 31, 2009 at 5:21 am #7  !
4zb4's Avatar
4zb4
archangel


Joined: Dec 11, 2008
Occupation: Not making sense
Location: The Gate
Interests: Magical Cooking!
Posts: 974
Groups:
Materials work fine with straight script editing... Weapons on the other hand, don't. Not for me anyway.
 
image~Desuno!
 
View profile
Send message
Find posts Find topics
 
Aug 31, 2009 at 10:48 am #8  !
martys1103
hedgehog


Joined: Aug 30, 2009
Posts: 7
ok, deleted element and item and it works like before
 
 
 Print


The Cathedral of Attnam  >  Programming  >  coding in new item

Jump to