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

Fixed Bug with skill boost items that require multiple of the item to work

@Jack Rackham remember if you want to test this properly you need to start a new game each time because if you change something in the item array it wont change in game instantly... Altough F11 should fix it too I believe.

@Tingyun could you test for me if the things work well (can't access my game atm).
see what kind of bonusses you get with these items (I've give you some console commands to spawn the items)

This should give a +2 in sailing exectute it twice to get two of those books and it should still give a +2
Code:
GiveItem2Character(pchar, "book4");

This should give a +1 in commerce and a +1 in luck execute it again and it should still be +1
Code:
GiveItem2Character(pchar, "book3");

This should give a +1 in cannons (after executing it 3 times) executing it 3 times again should make it +2 and it should go up untill +4 and not go higher.
Code:
GiveItem2Character(pchar, "mineral1");

note if you give items trough the console it might be possible the mods aren't calculated instantly so you might need to move them in your inventory. altough I expect that not to be the case.
 
F11 should work fine to completely update the items on a savegame.
There was a slight error with that before if you were carrying an Opium List, but that should be fixed now.

The Give Item to Character function calls another function that does update the skill modifiers.
 
Yes I have tested with a new game every time yes. And changed things until they work. :shrug

I would appreciate if someone would test my file as well. I have run so many tests and couldn't find any
bugs.
 
@Levis: As you requested I ran the console code you gave me, and watched the results. With Jack Rackham's fix everything looks good--the books only give their bonuses once, same with the pyrite (only gives a +1 max as soon as you have 3), and the pyrite and book bonuses never go away (I even executed the console 18 times, checking throughout, and no matter what all the skill bonuses were correct).
 
@Levis: As you requested I ran the console code you gave me, and watched the results. With Jack Rackham's fix everything looks good--the books only give their bonuses once, same with the pyrite (only gives a +1 max as soon as you have 3), and the pyrite and book bonuses never go away (I even executed the console 18 times, checking throughout, and no matter what all the skill bonuses were correct).
Pyrite should stack. so it should give +2 if you have 6 or more. Did it do this?
 
Pyrite didn't stack in the test, bonus stayed at +1 throughout, even with 18 of them in inventory.
 
Pyrite didn't stack in the test, bonus stayed at +1 throughout, even with 18 of them in inventory.
Did you try my version also? it should work in there. or is something else going wrong there?
 
But if stack = 1 means repeated bonus all items with stack = 1 should multilpy the bonus. That has not been the case
in the game.

For example 3 of jewelry2 (diamond) doesn't give triple bonus +3 leadership but +1 leadership.
When using the original skill_utils.c.
 
But if stack = 1 means repeated bonus all items with stack = 1 should multilpy the bonus. That has not been the case
in the game.

For example 3 of jewelry2 (diamond) doesn't give triple bonus +3 leadership but +1 leadership.
When using the original skill_utils.c.
but if the stack says how often it can stack then stack 0 should always give a 0 skillbonus, so that's not logical either. That's why I agree with @Pieter Boelen that stack should be a bool value to say if the bonusses stack or not. And like I said we might need to look at some of the items to see if we do want them to stack or not....
 
Levis: Your version did make it stack. I looked back and my test report for your file is on page 2 in the thread here: "Tested, no error log. But it makes the bonus stack. In other words, since 3 pyrite gives a +1 to the skill, 6 garnet now gives +2"

For what it is worth, my personal opinion is that pyrite and other minerals should not stack the bonus (since you mention at looking whether you want them to stack). It is very easy to harvest native items, and stacking just seems too powerful. Better to cap it at +1, to avoid players getting +4 just through minerals.
 
Levis: Your version did make it stack. I looked back and my test report for your file is on page 2 in the thread here: "Tested, no error log. But it makes the bonus stack. In other words, since 3 pyrite gives a +1 to the skill, 6 garnet now gives +2"

For what it is worth, my personal opinion is that pyrite and other minerals should not stack the bonus (since you mention at looking whether you want them to stack). It is very easy to harvest native items, and stacking just seems too powerful. Better to cap it at +1, to avoid players getting +4 just through minerals.
I agree it shouldn't stack, but thats a matter of changing it in the item. The code first needs to do what it is suppost to do. After that we can set the items right.
 
I still think my fix makes what it's supposed to do:

It gives +1 leadership despite how many jewelry2 you've got.
It gives +1 cannons from 3 mineral1 (pyrite) never more.
It handles stack like the int it is. Test case: change mineral8 (+1 commerce) to stack 2 in InitItems.c. It now gives +2 commerce for each mineral8.
(The case with both numneed & stack > 1 is not in the game and also limited by MAX_SKILL_INCREASE so it maybe should be removed.)

to place in console:

case "11":
LAi_SetImmortal(pchar, true);
RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
DeleteAttribute(pchar, "items");//takes all incl fists
TakenItems(Pchar, "mineral1", 9); //pyrite: cannons+1
TakenItems(Pchar, "mineral8", 2); //tormaline: commerce+1
TakenItems(Pchar, "jewelry2", 3);
break;

This should give +1 cannons (from 9 pyrite)
and +1 leadership from 3 dimonds
and +4 commerce from 2 tormaline (if stack = 2)
 
If the stack works as you say it works as it should. but if the stack works as @Pieter Boelen says your code does not work. That's my problem. I still can't find a definitive answer here what do we want stack to do?
Should stack say how many of the bonus can be stacked?

Also @Jack Rackham you should try your code with something which is stack 4, I think you will find it to react very weird then.
 
Also @Jack Rackham you should try your code with something which is stack 4, I think you will find it to react very weird then.
Yes you're right it's wrong. :modding
Already 1 item with numneed 1 and stack 4 gives a +4 bonus. More gives probably more but are limited by MAX_SKILL_INCREASE.

PB:
Compare to the Cursed Coins that do stack: If you have 10, then you do get -10 Luck.
Or should if they gave -1 Luck.
I agree with this explanantion.
 
So were do we stand now? @Levis have you got anything that work or are you still
working on it?
Or do you want me to trying to fix my fix? With skill as an bool or not?
 
I'm pretty darn sure that "stack" is meant to be boolean that controls whether multiple of the same item give extra skills.
It is not a multiplier as that would be even more massively overpowered.

I can think of only one item that should stack: The Cursed Coin because it is evil.
For any other items, I don't see the need. It is too easy to get your skills up through items as it is.

Anyway, if you can't figure it out to everyone's satisfaction, just leave it as is until I get back.
I can't be of any assistance whatsoever for the next few days, but I'll be around again eventually.
 
Back
Top