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

WIP Officer perk contributions

Oh @Grey Roger could you at least take the librarian dialog files from this and add it to the file and the changes to the rumors? That will make the library more useful and makes the job of finding certain skill books less tedious (if you are willing to pay a higher price).
 
Can you create a zip with just those parts, please?

I believe these files should allow you to buy books at the library and it has the interface change for the passengers (so it shows who is in your boarding team).
 

Attachments

  • BooksAndPassengers.zip
    52.9 KB · Views: 199
Can the rumour be kept as the old one if you've disabled locked perks? In such a case, those books are not much use to you and should probably not be there. It would be annoying for a player to read the rumour, go all the way to Turks Island to look at the new books, and find them irrelevant.
 
Can the rumour be kept as the old one if you've disabled locked perks? In such a case, those books are not much use to you and should probably not be there. It would be annoying for a player to read the rumour, go all the way to Turks Island to look at the new books, and find them irrelevant.
hmmm.....not easily. You would need to do an F11 at least after changing it (in a game) and still the states of the rumors are stored and doing an F11 will keep them, so something else needs to be added too.

it would be possible to disable certain rumors if certrain attributes are set. But the locked perks are set in a variable. @Grey Roger do you know how to do variable variable names?
For example:
Code:
int test1 = 100;
int test2 = 200;
int result = ("test1")+("test2");
Now this won't work because the (string) syntax only works in calling attributes. But you know a way of calling this for variables as well?
 
Surely to make the rumour dependent on the variable, all you'd need is something like this:
Code:
if(ALLOW_LOCKED_PERKS) Rumour[i].text = LanguageConvertString(tmpLangFileID,"Recently a library has been opened on the island of Turks.");
else Rumour[i].text = LanguageConvertString(tmpLangFileID,"Recently a library has been opened on the island of Turks. Maybe soon we can get some books there.");
The books themselves are going to have to be dependent on ALLOW_LOCKED_PERKS because their definitions are also dependent in "initItems.c":
Code:
  if(ALLOW_LOCKED_PERKS)
  {
  n = InitItem(n,"skillbook1", "",     13, 4,   0.10,  1,   1875, 0,   0, 0, 0,   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);// Unlock Advance Defence
  n = InitItem(n,"skillbook2", "",     13,14,   0.02,  6,   3165, 0,   0, 0, 0,   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);// Unlock Gun Professional
  n = InitItem(n,"skillbook3", "",     13,10,   0.05,  4,   2550, 0,   0, 0, 0,   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);// Unlock Advance Battlestate
  n = InitItem(n,"skillbook4", "",     13, 8,   0.01, 10,   3715, 0,   0, 0, 0,   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);// Unlock Cannon Professional
  }
So I suspect that if you have ALLOW_LOCKED_PERKS disabled in "InternalSettings.h" when you start a new game, Turks Library is going to spawn some error messages if it tries to use those books...
 
Surely to make the rumour dependent on the variable, all you'd need is something like this:
Code:
if(ALLOW_LOCKED_PERKS) Rumour[i].text = LanguageConvertString(tmpLangFileID,"Recently a library has been opened on the island of Turks.");
else Rumour[i].text = LanguageConvertString(tmpLangFileID,"Recently a library has been opened on the island of Turks. Maybe soon we can get some books there.");
The books themselves are going to have to be dependent on ALLOW_LOCKED_PERKS because their definitions are also dependent in "initItems.c":
Code:
  if(ALLOW_LOCKED_PERKS)
  {
  n = InitItem(n,"skillbook1", "",     13, 4,   0.10,  1,   1875, 0,   0, 0, 0,   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);// Unlock Advance Defence
  n = InitItem(n,"skillbook2", "",     13,14,   0.02,  6,   3165, 0,   0, 0, 0,   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);// Unlock Gun Professional
  n = InitItem(n,"skillbook3", "",     13,10,   0.05,  4,   2550, 0,   0, 0, 0,   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);// Unlock Advance Battlestate
  n = InitItem(n,"skillbook4", "",     13, 8,   0.01, 10,   3715, 0,   0, 0, 0,   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0);// Unlock Cannon Professional
  }
So I suspect that if you have ALLOW_LOCKED_PERKS disabled in "InternalSettings.h" when you start a new game, Turks Library is going to spawn some error messages if it tries to use those books...
that could help. I wanted to disable the message completly. but changing just the text could work. It would need and F11 after you change the variable but I guess that has to be done with more stuff.
I could add a check in the dialog file to disable the dialog options you need when you play without locked perks.
 
The variable is controlled from "InternalSettings.h". Unless you're running in windowed mode with "InternalSettings.h" in one window and the game in the other, F11 won't be needed because you'll change the setting and then start the game. (If you are running in windowed mode with "InternalSettings.h" in one window and the game in the other, and are carelessly changing variables while playing, rumours are probably going to be the least of your problems!)

Besides, I'd imagine ALLOW_LOCKED_PERKS is unlikely to change often. Either you like locked perks and leave it set to 1, or you hate them and have it set to 0. ;)

As for disabling the message entirely if locked perks are disabled, isn't that even easier? Just leave out the 'else' line.
 
The variable is controlled from "InternalSettings.h". Unless you're running in windowed mode with "InternalSettings.h" in one window and the game in the other, F11 won't be needed because you'll change the setting and then start the game. (If you are running in windowed mode with "InternalSettings.h" in one window and the game in the other, and are carelessly changing variables while playing, rumours are probably going to be the least of your problems!)

Besides, I'd imagine ALLOW_LOCKED_PERKS is unlikely to change often. Either you like locked perks and leave it set to 1, or you hate them and have it set to 0. ;)

As for disabling the message entirely if locked perks are disabled, isn't that even easier? Just leave out the 'else' line.

wasn't able to test it yet, but this should work.
Edit: had some time left so tested it, and it works
 

Attachments

  • BooksAndPassengersV2.zip
    53 KB · Views: 188
Last edited:
first, you still got the "å"-less utils.c :p

concerning the perk power, I definitely think they should have a drastic effect, especially the melee ones. call me a casual godmodder, but I like feeling like a swashbuckling movie heroine when I get to high levels.

Im still not convinced of the new perk cost colors.. the dark red costs for things you cant afford or that are locked is very hard to make out and I can imagine its next to impossible for ppl with color blindness. red/green is tricky overall. Id really prefer the old ones

I did some fights and boardings and captains seem to work fine!

however, I encountered another problem. Im not sure its to do with your updates, because it happened in a situation I havnt been in before afaic remember, ie I asked the captain to teach me a skill. I met an english trading fleet and attacked them as a pirate. I boarded a ship and got to the cabin, I told the captain we were to be civilized about it and he offered to teach me a skill. I said I wanted to be better at boarding. then I got to the boarding victory screen and took the booty as usual without problems. but when I returned to sea, the other ships decided that the ship I boarded was hostile and opened fire at it. it was a gruesome sight, as she just stood there as boarded ships are wont to do. actually now that I think about it it sounds vaguely familiar.. I mightve had a similar enc before. anyway, seems rare, but good to keep a lookout for. attaching the logs and a save after it happened if you wanna have a look. they stopped chasing me to murder their comrade

it also changed to the wrong music after I got out of battle range
Code:
== Directsail called at 12:44
** Whr: CreateWeatherEnvironment - iCurWeatherhour = 12, theHour = 13
Whr_UpdateWeather finish weather update
SETTING MUSIC: music_sea_battle
ResumeAllSounds
SETTING MUSIC: music_spokplavanie
SETTING MUSIC: music_abordage
== Directsail called at 13:14
but cant imagine thats related to the fixes, feels like a standard engine mixup because some things with sound happened at once? but mentioning it if it could be a clue. :ninja

also got the "integer function return float value" over and over in the error log:eek:

Ill report more as I keep playing during the week xD
 

Attachments

  • -=Player=- Open Sea October 31st, 1674.rar
    529.6 KB · Views: 192
  • compile.log
    95.8 KB · Views: 193
  • error.log
    246.9 KB · Views: 192
Which versions of "utils.c" and "skill_utils.c" are you using?

From "error.log":
Code:
RUNTIME ERROR - file: utils.c; line: 395
integer function return float value
RUNTIME ERROR - file: Characters\skills\skill_utils.c; line: 423
integer function return float value
The current versions of those files which I have do not have any 'return' statements on those line numbers.

I noticed an error in "utils.c", though it was on a different line number which was the 'return' for function 'iclamp'. The report and suggested fix are here:
Fix in Progress - Error from 'iclamp' returning float result
 
@DeathDaisy are you using the latest version of my files? This error which @Grey Roger shows was in one of my pervious files but should be fixed by now.
 
Which versions of "utils.c" and "skill_utils.c" are you using?

From "error.log":
Code:
RUNTIME ERROR - file: utils.c; line: 395
integer function return float value
RUNTIME ERROR - file: Characters\skills\skill_utils.c; line: 423
integer function return float value
The current versions of those files which I have do not have any 'return' statements on those line numbers.

I noticed an error in "utils.c", though it was on a different line number which was the 'return' for function 'iclamp'. The report and suggested fix are here:
Fix in Progress - Error from 'iclamp' returning float result
thanks! xD I use iClamp weirdly often, so applied the fix!
@DeathDaisy are you using the latest version of my files? This error which @Grey Roger shows was in one of my pervious files but should be fixed by now.

I had installed the 20171126 files, but seems I failed to copy over the changes in skills_utils, so nevermind that! :onya
 
I had installed the 20171126 files, but seems I failed to copy over the changes in skills_utils, so nevermind that! :onya
good :).

@Grey Roger the problem was because a float was also send in. just like with the iclamp. it was fixed later.
 
when I returned to sea, the other ships decided that the ship I boarded was hostile and opened fire at it.
What flag were they flying after the boarding? You might want to start a new Bug Tracker entry for that.
 
my traders dont have any personal items. could that be something with this update/something I have missed to apply from this update like with the skills_utils before? or is it something entirely else Ive done?

getting lots of errors from line 198 in utils.c too
Code:
RUNTIME ERROR - file: utils.c; line: 198
float function return integer value
Code:
float roundto(float num, int decimals)
{
    return round((num*pow(10,decimals))/100); <--- Line 198
}
and one from dialog.c
Code:
RUNTIME ERROR - file: dialog.c; line: 415
incorrect argument index
Code:
void ProcessAllDialogEvent(ref Character)
{
    if(DIALOG_DEBUG) Trace("Dialog: Process all files for Character: " + Character.ID + " Current Node: " + Dialog.CurrentNode);
    //Here we open all dialog files so dialog options are stored
    int i, dn;
    string DFile, DPath;
    aref DialogFile, ParentDialog;
    makearef(ParentDialog,Character.LoadedDialog);
    dn = GetAttributesNum(ParentDialog);
    if(DIALOG_DEBUG) Trace("Dialog: Number of dialog files = " + dn);
    //Little bit of cleaning up
    if(CheckAttribute(&Dialog,"PreLinks")) DeleteAttribute(&Dialog,"PreLinks");
    //Check the files
    for(i=0; i<dn; i++)
    {
        DialogFile = GetAttributeN(ParentDialog,i); <---- Line 415
        DFile = GetAttributeValue(DialogFile);
        DPath = LoadDialogFile(DFile);
        //Only process if there is a file, just to be sure.
        if(DPath != "")
        {
            DialogFilesLoaded = i;
            if(DIALOG_DEBUG) Trace("Dialog: Start Process");
            ProcessDialogEvent();
            //Make sure links aren't overwritten unless specified.
            ProcessLinks(dn, i);
            if(DIALOG_DEBUG) Trace("Dialog: Process Done");
            //Check if the dialog is already closed because of dialog exit, else close it.
            if(DialogFilesLoaded > -1)
            {
                UnloadDialogFile(DPath, DFile);
                DialogFilesLoaded = -1;
            }
        }
    }
    //Levis add attribute for easy checking where we are in the dialog
    Character.Dialog.Lines = sti(Character.Dialog.Lines) + 1;
}
 

Attachments

  • compile.log
    43.3 KB · Views: 165
  • error.log
    6.4 KB · Views: 191
my traders dont have any personal items. could that be something with this update/something I have missed to apply from this update like with the skills_utils before? or is it something entirely else Ive done?
This is a know problem which can happen sometimes.

getting lots of errors from line 198 in utils.c too
Code:
RUNTIME ERROR - file: utils.c; line: 198
float function return integer value
Code:
float roundto(float num, int decimals)
{
    return makefloat(round(num*pow(10,decimals)))/100;
}

Hmmm .... weird I must have uploaded something wrong somewhere.
This is what is should say:
Code:
float roundto(float num, int decimals)
{
    return makefloat(round(num*pow(10,decimals)))/100;
}
and one from dialog.c
Code:
RUNTIME ERROR - file: dialog.c; line: 415
incorrect argument index
Code:
void ProcessAllDialogEvent(ref Character)
{
    if(DIALOG_DEBUG) Trace("Dialog: Process all files for Character: " + Character.ID + " Current Node: " + Dialog.CurrentNode);
    //Here we open all dialog files so dialog options are stored
    int i, dn;
    string DFile, DPath;
    aref DialogFile, ParentDialog;
    makearef(ParentDialog,Character.LoadedDialog);
    dn = GetAttributesNum(ParentDialog);
    if(DIALOG_DEBUG) Trace("Dialog: Number of dialog files = " + dn);
    //Little bit of cleaning up
    if(CheckAttribute(&Dialog,"PreLinks")) DeleteAttribute(&Dialog,"PreLinks");
    //Check the files
    for(i=0; i<dn; i++)
    {
        DialogFile = GetAttributeN(ParentDialog,i); <---- Line 415
        DFile = GetAttributeValue(DialogFile);
        DPath = LoadDialogFile(DFile);
        //Only process if there is a file, just to be sure.
        if(DPath != "")
        {
            DialogFilesLoaded = i;
            if(DIALOG_DEBUG) Trace("Dialog: Start Process");
            ProcessDialogEvent();
            //Make sure links aren't overwritten unless specified.
            ProcessLinks(dn, i);
            if(DIALOG_DEBUG) Trace("Dialog: Process Done");
            //Check if the dialog is already closed because of dialog exit, else close it.
            if(DialogFilesLoaded > -1)
            {
                UnloadDialogFile(DPath, DFile);
                DialogFilesLoaded = -1;
            }
        }
    }
    //Levis add attribute for easy checking where we are in the dialog
    Character.Dialog.Lines = sti(Character.Dialog.Lines) + 1;
}
this error seems to happen if dialogs are called wrong. Did you try to hire an enc_walker?
 
Last edited:
Back
Top