• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Need Help Itemstrade.c Line: 1593,1594

DavyJack

Pirate Queen
Staff member
Storm Modder
:ahoySo I keep getting these specific lines as a runtime error(see my attached error.log).
I tried changing the numbers but I still keep getting it. I'm playing the latest version(27th April 2022) on Arcade Mode. I'm currently Level 37.
Screenshot 2022-06-22 033452.jpg


Also, while we're at it, I got this runtime error as well for Josephine Dialog line 72; can also be seen in my error.log. I'm not sure if this is a typo or not. It's been a while. I haven't checked.
Josephine Dialog.jpg
 

Attachments

  • error.log
    1.8 KB · Views: 84
  • system.log
    589.2 KB · Views: 86
The errors in "itemstrade.c" seem to indicate a blade which hasn't been properly defined and lacks the "dmg_max" and "piercing" attributes. Which storyline are you playing?

Try putting this directly above the two lines which are causing the error:
Code:
if(!CheckAttribute(refitm, "dmg_max") || !CheckAttribute(refitm, "piercing")) traceandlog("Item " + itemName + " is missing 'dmg_max' or 'piercing' attribute");
Run the game, sell your junk, see if the same error still appears, and if so, post "compile.log".

"Josephine Bonassieu_dialog.c", line 72: change it to this and see if you still get the same error:
Code:
if (GetAttribute(PChar, "quest.Bonnie_talk") == "Sailing_for_Turks")
Attribute "quest.Bonnie_talk" will only be set if you're playing the newly overhauled "Devlin Opera" storyline, and then probably some way into the story.

There's also this in "error.log":
Code:
RUNTIME ERROR - file: quests\quests_common.c; line: 518
invalid index -1 [size:5]
That comes from part of the code dealing with fetch quests:
Code:
int choosegood = goodoptions[rand((option-1))];
Check the tavern news - what fetch quests are available? Have you accepted one, and is it still active?
 
The errors in "itemstrade.c" seem to indicate a blade which hasn't been properly defined and lacks the "dmg_max" and "piercing" attributes. Which storyline are you playing?

Try putting this directly above the two lines which are causing the error:
Code:
if(!CheckAttribute(refitm, "dmg_max") || !CheckAttribute(refitm, "piercing")) traceandlog("Item " + itemName + " is missing 'dmg_max' or 'piercing' attribute");
Run the game, sell your junk, see if the same error still appears, and if so, post "compile.log".
:ahoyHello @Grey Roger! How are you doing? Thanks for assisting as always. Anyway, I'm playing the main storyline and I think I found the culprit. I never noticed or wasn't paying any attention to it when I was playing yesterday but it was the "blade kit" that was making the error. Can also be found on my compile.log (attached). I don't know why it is reading the blade kit as such but the "bladekit" is currently set to IT_TYPE_BLACKSMITH in initItems.c.
itemstrade error.jpg

EDIT: And yes, I gave my blade kit to Artois Voysey, went to a merchant to sell my loot and no errors were detected.

"Josephine Bonassieu_dialog.c", line 72: change it to this and see if you still get the same error:
Code:
if (GetAttribute(PChar, "quest.Bonnie_talk") == "Sailing_for_Turks")
Attribute "quest.Bonnie_talk" will only be set if you're playing the newly overhauled "Devlin Opera" storyline, and then probably some way into the story.
As for this one. I haven't recreated the error yet but I've inputted your fix.

There's also this in "error.log":
Code:
RUNTIME ERROR - file: quests\quests_common.c; line: 518
invalid index -1 [size:5]
That comes from part of the code dealing with fetch quests:
Code:
int choosegood = goodoptions[rand((option-1))];
Check the tavern news - what fetch quests are available? Have you accepted one, and is it still active?
As for this, I am currently doing a general quest- delivery of goods from store to store. I have been to Grand Turks several times to make a delivery. Right now I'm at the Pirate Fort in Bonaire. Just delivered the supply from Grand Turks I believe, I forgot, but I just accepted another delivery to Tortuga.
 

Attachments

  • compile.log
    3.5 KB · Views: 70
  • error.log
    1.4 KB · Views: 74
:ahoyHello @Grey Roger! How are you doing? Thanks for assisting as always. Anyway, I'm playing the main storyline and I think I found the culprit. I never noticed or wasn't paying any attention to it when I was playing yesterday but it was the "blade kit" that was making the error. Can also be found on my compile.log (attached). I don't know why it is reading the blade kit as such but the "bladekit" is currently set to IT_TYPE_BLACKSMITH in initItems.c.
Yes, that would do it. The equipment type isn't relevant here. "itemtrade.c" tries to figure out what sort of item it's trying to sell based on the first five letters of the item's ID. Almost all blade weapons are "bladeXX", where XX is a number, e.g. the Bosun's Choice is "blade27". (The ones which aren't are special weapons which you won't want to sell as junk anyway, especially the spade and pickaxe which have very low weapon ratings, can be used as weapons, but are more usually used for digging up treasure.) The ID for the blade care kit is "bladekit". So "itemtrade.c" mistakes it for a blade weapon, then gets upset because the kit has no weapon values.

Put the attached file into "PROGRAM\INTERFACE". The offending lines should now check whether the "dmg_max" and "piercing" attributes exist before checking whether they're low enough to qualify as junk. Then take back your blade care kit and try again to sell junk.

For the dialog problem, if you're still at Turks Island - or if you have an earlier savegame at Turks Island - just go to tavern keeper Josephine Bonassieu and talk to her. Then check "error.log". If she still talks normally and "error.log" has nothing about her, that's the problem fixed.

Basic cargo deliveries aren't the problem shown in the earlier "error.log". Fetch quests are the ones you see announced in tavern news where a tailor, shipyard or blacksmith needs help. You go to the shop in question, where you'll have a dialog option "Folks say you got a big order. Need help?" The owner wants you to go and get a certain commodity which is out of stock at the local store, which means you can't simply walk round the corner and buy it - you need to sail somewhere else, get the stuff, then bring it back.
 

Attachments

  • itemstrade.c
    54.9 KB · Views: 79
Yes, that would do it. The equipment type isn't relevant here. "itemtrade.c" tries to figure out what sort of item it's trying to sell based on the first five letters of the item's ID. Almost all blade weapons are "bladeXX", where XX is a number, e.g. the Bosun's Choice is "blade27". (The ones which aren't are special weapons which you won't want to sell as junk anyway, especially the spade and pickaxe which have very low weapon ratings, can be used as weapons, but are more usually used for digging up treasure.) The ID for the blade care kit is "bladekit". So "itemtrade.c" mistakes it for a blade weapon, then gets upset because the kit has no weapon values.

Put the attached file into "PROGRAM\INTERFACE". The offending lines should now check whether the "dmg_max" and "piercing" attributes exist before checking whether they're low enough to qualify as junk. Then take back your blade care kit and try again to sell junk.:
I went ahead and bought a blade kit then proceeded to sell my junk/loot and got the same runtime error again with itemstrade.c line:1594. :nerbz
For the dialog problem, if you're still at Turks Island - or if you have an earlier savegame at Turks Island - just go to tavern keeper Josephine Bonassieu and talk to her. Then check "error.log". If she still talks normally and "error.log" has nothing about her, that's the problem fixed.
I forgot to check this. I'll let you know later.
Basic cargo deliveries aren't the problem shown in the earlier "error.log". Fetch quests are the ones you see announced in tavern news where a tailor, shipyard or blacksmith needs help. You go to the shop in question, where you'll have a dialog option "Folks say you got a big order. Need help?" The owner wants you to go and get a certain commodity which is out of stock at the local store, which means you can't simply walk round the corner and buy it - you need to sail somewhere else, get the stuff, then bring it back.
I see. Thanks for the info. I did indeed do one fetch quest but can't remember when and if it did generate anything in the error.log.
 

Attachments

  • compile.log
    47.8 KB · Views: 83
  • error.log
    154 bytes · Views: 66
I went ahead and bought a blade kit then proceeded to sell my junk/loot and got the same runtime error again with itemstrade.c line:1594. :nerbz
Not quite the same error - it's now complaining about "block" for the same reason. Try this version.
 

Attachments

  • itemstrade.c
    54.9 KB · Views: 70
Back
Top