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

initItems.c: maxQuantity/maxQuanity?

buho

Privateer
Storm Modder
Doing some lurking in initItems.c:

Code:
void InitRandItems()

[...]


makeref(rnditem,RandItems[44]);
rnditem.id = "potionrum";
rnditem.maxQuantity = 4;

//// maxQuantity till here

makeref(rnditem,RandItems[45]);
rnditem.id = "bookleader_1";
rnditem.maxQuanity = 5;

//// maxQuanity from here to end

makeref(rnditem,RandItems[46]);
rnditem.id = "booklight_1";
rnditem.maxQuanity = 5;

(The "realistic" version is ok).

Out of curiosity: how the runtime reacts with such an error? Is iniItems.c used actually or it is a dormant source?

Or I'm getting all wrong?

Cheers.
buho (A).
 
Actually it is not the "realistic" source "being ok". The realistic initItems.c does'nt initialize any book in InitRandItems.

When the initItems.c routines run? When starting a new game? When loading a game?

Cheers.
buho (A).
 
I'm not too familiar with the book code, but I believe the items initialize at the start of a new game.
 
If I'm correct, you're saying that in realistic, books aren't set to random drops by enemies? If so, then I believe that was done on purpose by us for realisim. It's not like every other pirate you kill is carrying a book or two with him; he probably doesn't even read ;)

There are subtle differences between the original inititems and the realistic one, most notibly the spyglass. In GoF! 1.2, this difference is further enhanced. We've removed the piercing ability to all axes except one (for now) because realisticly, an axe is a slashing weapon, not a thrusting one.
 
Out of curiosity: how the runtime reacts with such an error?
What's wrong with this code?
Could you please explain where error is?

The code is, apparently, initializing a collection/array of objects of the same kind:

Code:
makeref(r, a[n]);
r.x = x;
r.y = y;

But for every item till "potionrum" the code addresses a field named maxQuantity, while in the objects for books (same objects, I think) the field name is written maxQuanity (no "t" between "n" and "i"). Every not book record code is addressing maxQuantity, while every book record code is addressing maxQuanity.

Code:
void InitRandItems()
{
ref rnditem;

makeref(rnditem,RandItems[0]);
rnditem.id = POTION;
rnditem.maxQuantity = 4;
^

[...like 40 recs snipped...]

makeref(rnditem,RandItems[44]);
rnditem.id = "potionrum";
rnditem.maxQuantity = 4;
^


makeref(rnditem,RandItems[45]);
rnditem.id = "bookleader_1";
rnditem.maxQuanity = 5;
^^^

[...like 40 more recs snipped...]


makeref(rnditem,RandItems[90]);
rnditem.id = "bookheavweapman";
rnditem.maxQuanity = 5;			
^^^ 
// boal <--
}

Cheers.
buho (A).
 
Ah, I see. I can't answer your question then buho, we'll need a coder to comment on this thread. :shrug
 
If I'm correct, you're saying that in realistic, books aren't set to random drops by enemies? If so, then I believe that was done on purpose by us for realisim. It's not like every other pirate you kill is carrying a book or two with him; he probably doesn't even read ;)

[...]

I'm playing with everything in realistic but a) the spyglass I have as "stock" and b) the damage model that I have as "intermediate".

And I'm finding books in corpses. If the idea is not having books in corpses then it is not working as intended, I fear.

I've killed pirates, spanish captains/sailors and dutch captains/sailors and I'm pretty sure all of them dropped books one time or another. Even the sailors, or at least some crew officers/mates. The captains for sure. And the town soldiers are walking bookshelves (the best way to get books).

Cheers.
buho (A).
 
Well from what I see it's fine. Since the code works the spelling error isn't a big deal as it doesn't make that big of a difference when you code something, usually, if the parameters are set in a way to read the code with the spelling error. As far as I am aware this code is working as intended. Also I don't find books on realistic so perhaps there is an error in your game?
 
Well from what I see it's fine. Since the code works the spelling error isn't a big deal as it doesn't make that big of a difference when you code something, usually, if the parameters are set in a way to read the code with the spelling error. As far as I am aware this code is working as intended. Also I don't find books on realistic so perhaps there is an error in your game?

Aeterna, I have no idea about what parameters you are refering to. Can you elaborate, please?

On the NPC dropping books issue, I'm only reporting that in my game it appears not to be WAI. Why it is not WAI I can't say, really.

Cheers.
buho (A).
 
Ok, I did a search through the code, and neither the maxQuantity or maxQuanity are actually used anywhere!

So I think they are holdovers from AOP1 or POTC or old mod code, and should be deleted.


Also, for general reference. The "initItems_REALISTIC.c" file is not actually used anymore; the realistic vs non-realistic change for spyglasses is done in the code. So that file should be deleted as well.
 
Ok, I did a search through the code, and neither the maxQuantity or maxQuanity are actually used anywhere!

So I think they are holdovers from AOP1 or POTC or old mod code, and should be deleted.


Also, for general reference. The "initItems_REALISTIC.c" file is not actually used anymore; the realistic vs non-realistic change for spyglasses is done in the code. So that file should be deleted as well.


Noted.

Jonathan, do you know where the skill books weight is defined/handled, please?

Cheers.
buho (A).
 
OK i just checked and the change logs and found one for GOF 1.0 which for some reason appeared empty in GOF 1.0.exe version. The fix you made was included in GOF 1.2 from the looks of it or at least you was credited in that version even though the fix was included in GOF 1.1. Not to worry though you was already credited for it and thats all that matters. :yes
 
...
Jonathan, do you know where the skill books weight is defined/handled, please?

Cheers.
buho (A).

Yup, it's in ITEMS/initItems.c. It's the "itm.Weight" field, which is set for each item in the game.
 
Also, for general reference. The "initItems_REALISTIC.c" file is not actually used anymore; the realistic vs non-realistic change for spyglasses is done in the code. So that file should be deleted as well.

I was wondering about this. I'll have to use winmerge on the two files and upload an updated init items for GoF 1.2.
 
Back
Top