• 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!

Unsellable items

Aconcagua

Sailor Apprentice
Storm Modder
The following weapons cannot be sold:

<ul><li>Blunderbuss</li><li>Borgiablade</li><li>Stinkpot</li><li>Etherbottle</li><li>Grenade</li><li>Poisoned Throwingknife</li><li>Sandbag</li><li>Thief's Knife</li><li>cobblestone</li></ul>

Fixed it by adding "skiptrade = false;" (i put it directly below skipsell = true);

Exception: Cobblestone - there was skiptrade set to true - I set it back to false and added
skipsell = true.

Eventually, however, skiptrade = true might make more sense (who would buy simple stones???), but then the comment ("you can't by them") should be changed to "you can't trade them" so that it is clear that this is the desired behaviour. Eventually my changes might be carried over, but the price set from 10 to 0 (or are these stones especially rare or pretty, that someone would pay for them some money?).

(Find the locations by searching the weapon name, there is a comment for each item.)

Unsellable items:
<ul><li>Fine Wine</li><li>Bottle 'o Rum</li><li>Leeche</li><li>Tincture of Laudenum</li><li>Confectio Damocritis</li><li>Acetum Saturninum</li></ul>

I renamed the parameter skiptrade to skipsell and changed the code as below for these methods:
<ul><li>InitSpyglass</li><li>InitPotion</li><li>InitApothItem</li></ul>

<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>itm.skiptrade = false;
itm.skipsell = skipsell;
itm.skiprand = skiprand;
itm.skipequip = skipequip;</div>

Note that itm is called spyitm/potionitm in the corresponding methods.

The change in InitSpyglass was not necessary, as there was no glass marked as unsellable, but I preferred to have it adapted analogously.

InitItem has two separate parameters, so I left this one unchanged. (Exception: I removed the if clause and assigned skipsell direcly, as this worked fine for the others and appears more readable).

I suggest, however, to check for all items generated by using this method to be checked for the skiptrade parameter, as for some I do not see why they should not be sellable (e. g. the holy crosses - tattoos however I'd certainly leave unsellable...), there might be some legacies...

Yet two other bugs:

<ul><li>Some items (mainly quest items, i suppose, concretly e. g. the "Navy Papers") cannot be put into chests directly - however, I can get them there by swapping them with another item!

I have no fix for that (so far), so this is up to you modders... </li><li>I have an officer using the "Old_mat1" model. When thalking to him, there is no picture of him available (however, in the characters view, there is). Tried to reproduce it, but so far did not meet another person using this model. Will report, as soon as this happens.</li></ul>
 
Could you upload your initItems.c file by any chance? Indeed those items are supposed to be sellable. Apart from the cobbleston, that is.
That might also explain why the grenades can't be bought, even though I tried to make them so.

We should make it fully impossible for certain items to be put in chests and such. For example the tattoos, but also the albatross and cursed coins. <img src="style_emoticons/<#EMO_DIR#>/whippa.gif" style="vertical-align:middle" emoid=":whipa" border="0" alt="whippa.gif" />

"Old_mat1" head model problem confirmed. You can fix it by taking RESOURCE\animation\Heads\h_Old_man1.ani and copying it as h_Old_mat1.ani.
 
Here it is: View attachment initItems.c

Cobblestone is made unsellable again (with better comment), grenades can be bought.

Apart from that all changes included.

Fix for old_mat1 woked fine (thanks - was somehow annoying...). By the way, there was already such a file, but obviously corrupt...
 
It seems there's some head files that stopped working for whatever reason; I'm pretty sure they did work in the past.
So we should just go and fix them as we encounter them. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />

Thanks for the file; I'll add it to the next update. <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />
 
<!--quoteo(post=327670:date=Jun 12 2009, 12:58 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Jun 12 2009, 12:58 AM) <a href="index.php?act=findpost&pid=327670"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Thanks for the file; I'll add it to the next update. <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->
Off topic, but when will the next update be Pieter?
 
NO idea. I'd like to get all location-specific loading screens done first, but that might still take a couple of weeks.
 
The quest items I could now fix, too:

in PROGRAM\INTERFACE\itemsbox.c, you find at line 92:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if(isQustUsedItem(itmName1))
{
   SetSelectable("ONEDOWN_BUTTON", false);
   SetSelectable("ALLDOWN_BUTTON", false);
}<!--c2--></div><!--ec2-->

Add in the brackets the line

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->SetSelectable("SWAP_BUTTON", false);<!--c2--></div><!--ec2-->

If the other items (tattoos, cursed coins, ...) are quest items, this will work, too.

If not, I suppose there must be added an extra if clause catching these items (eventually, this can be done easier/more effectively by defining a new attribute for the objects to be checked then). I haven't yet discovered these items, so I won't try to check and if need be apply a fix yet.
 
Brilliant! You sure it's supposed to be line 92? It's line 2007 for me. <img src="style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" />
Those items are not quest items though. We could make them quest items, but I'm not sure if that makes sense... <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
<b>Attention!!!</b> Accidentally posted a version with a bug in it!!!

Have corrected it already, you'll get now the correct file via the link above.

Sorry for the inconvenience.
 
Redownloaded. Thanks again. <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />
 
Ah, yes, you're right, it's 2007 (which is at 92 % - had a too quick look for it, both values are side by side in emacs...).
 
Found two other models without head animation: Pirtt7 and Sailor17 (tt: type error in file name, not here).

Can be solved by copying h_Pirat7.ani as h_Pirtt7.ani (replace the old one) as well as as h_Sailor17.ani (which was missing before) (both models look alike).

(I had a crew member using one of the models - which one, I do not know... -, copied first pirtt7 head as the missing file, which did not help, so pirtt7 was corrupt, too)
 
Thanks for that! We'll get that fixed in the next update too! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />
 
I'm having a very bad problem with the apothecary items. I noticed that when I got some leeches from the apothecary, I didn't actually get them.
After a lot of messing around, I discovered that the problem applies to the first apothecary item being initialized:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    //-----------------------------------------------------------------------------------------------------------------
    // Alan_Smithee Apothecary Meds -->
    //-----------------------------------------------------------------------------------------------------------------
    // APOTHECARY:                               picIndex           Price   ispotion   antidote           skiptrade
    //              ItemIndex        picTexture   |   rare            |     | pic      |   health         | skiprand
    //                  |  itmID   modelID    |   |    |  MinLevel |     |  | tex   |   |              | | skipequip
    //----------------|--|----------|-------|---|----|-----|-----|-----|--|--|----|---|--------------|-|-|-------------
    n = InitApothItem(n,"leeches",     "",       "AS",1,    0.80,  1,    0,    1, 0, 2,   1, -20.0,          1,1,1);// Leeches
    n = InitApothItem(n,"meds1",     "",       "AS",4,    0.30,  1,  350,    0, 0, 0,   0,   0.0,          1,0,1);// Meds 1
    n = InitApothItem(n,"meds2",     "",       "AS",6,    0.20,  1,  450,    0, 0, 0,   0,   0.0,          1,0,1);// Meds 2
    n = InitApothItem(n,"meds3",     "",       "AS",5,    0.40,  1,  250,    0, 0, 0,   0,   0.0,          1,0,1);// Meds 3
    n = InitApothItem(n,"meds4",     "",       "AS",3,    0.10,  1,  500,    0, 0, 0,   0,   0.0,          1,0,1);// Meds 4
    //-----------------------------------------------------------------------------------------------------------------
    // Alan_Smithee Apothecary Meds <--
    //-----------------------------------------------------------------------------------------------------------------<!--c2--></div><!--ec2-->
If I move the leeches down, they'll work fine but "meds1" will not exist anymore.

If I replace:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    itmIndex++;
    return itmIndex;<!--c2--></div><!--ec2-->With:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    return itmIndex++;<!--c2--></div><!--ec2-->In the InitApothItem function, similar to the other item init functions, none of the items will work.
What is WRONG here??? And worse still... does this problem apply to other items too...? <img src="style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" />
 
That problem is solved now, thanks to Pirate_KK. In function InitPickUpItem replace:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->return itmIndex++;<!--c2--></div><!--ec2--> itmIndex++;
return itmIndex;[/CODE]The game doesn't seem to like the first.
BTW: Has anybody recently seen any pickup gold? I don't recall any and this might explain why... <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
<!--quoteo(post=328620:date=Jun 14 2009, 11:48 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Jun 14 2009, 11:48 AM) <a href="index.php?act=findpost&pid=328620"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->That problem is solved now, thanks to Pirate_KK. In function InitPickUpItem replace:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->return itmIndex++;<!--c2--></div><!--ec2--> itmIndex++;
return itmIndex;[/CODE]The game doesn't seem to like the first.<!--QuoteEnd--></div><!--QuoteEEnd-->

Just a hint why the first version did not work - preconditioned that this is the same as in C:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->int n = 0;
n++; // n is evaluated BEFORE it is incremented
++n; // n is incremented, and then evaluated; is this available at all in the engine, too?<!--c2--></div><!--ec2-->
This is not yet of any matter, but if you have an assignement (and returning a value indeed IS an assignment, too), then you get:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->int n = 0;
int n1 = n++; // n1 is 0 (as n was still while assigning), n is 1
int n2 = ++n; // n is 2, n2 is 2, too<!--c2--></div><!--ec2-->
So, as returning is an assignement, return n; and return n++; result in the same return value...
 
Ah; thanks for explaining. <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />
 
Back
Top