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

Unfixed Bugs in Build v11

Status
Not open for further replies.
Someone suggested making a new thread for just _unfixed_ bugs.
I, lazy beggar that I am, think that's a very good idea. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

So, if you all would kindly post just unfixed bugs here, I (and many others I'm sure) would be much obliged.
 
I think there's a slight error in seadogs.c around line 821:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "NK_LogsToggle":

     LogsToggle = !LogsToggle;

     ToggleLog("Various logs are now on");

     else Log_SetStringToLog("Various logs are now off");

 break;<!--c2--></div><!--ec2-->Looks like there should be an if statement; I think it was meant to be:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "NK_LogsToggle":

     LogsToggle = !LogsToggle;

     if ( LogsToggle ) Log_SetStringToLog("Various logs are now on");

     else Log_SetStringToLog("Various logs are now off");

 break;<!--c2--></div><!--ec2-->
That's just guesswork on my part, though. Sorry if this has been covered already <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />
 
<!--`QuoteBegin-dchaley`+--><div class='quotetop'>QUOTE(dchaley)</div><div class='quotemain'><!--QuoteEBegin-->I think there's a slight error in seadogs.c around line 821:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "NK_LogsToggle":

     LogsToggle = !LogsToggle;

     ToggleLog("Various logs are now on");

     else Log_SetStringToLog("Various logs are now off");

 break;<!--c2--></div><!--ec2-->Looks like there should be an if statement; I think it was meant to be:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "NK_LogsToggle":

     LogsToggle = !LogsToggle;

     if ( LogsToggle ) Log_SetStringToLog("Various logs are now on");

     else Log_SetStringToLog("Various logs are now off");

 break;<!--c2--></div><!--ec2-->
That's just guesswork on my part, though. Sorry if this has been covered already  :D[/quote]

That would be the case, but if you look at the bottom of <span style='color:red'>PROGRAMReinit.c</span>, you'll see that "ToggleLog()" is a called function:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->bool ToggleLog(string ltext) //ditto, but based on LogsToggle

{

    if(LogsToggle) Log_SetStringToLog(ltext);

    return LogsToggle;

}<!--c2--></div><!--ec2-->

So the use of "ToggleLog()" in seadogs.c is proper, and for a specific reason.
 
Regardless, there is a dangling else that has no matching if. In that case, it should be:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if ( LogsToggle ) ToggleLog("Various logs are now on");

        else Log_SetStringToLog("Various logs are now off");<!--c2--></div><!--ec2-->
 
<!--`QuoteBegin-dchaley`+--><div class='quotetop'>QUOTE(dchaley)</div><div class='quotemain'><!--QuoteEBegin-->Regardless, there is a dangling else that has no matching if. In that case, it should be:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if ( LogsToggle ) ToggleLog("Various logs are now on");

        else Log_SetStringToLog("Various logs are now off");<!--c2--></div><!--ec2-->[/quote]

Okay, I see what you're saying. I'm not sure exactly why that function call has a dangling 'else' statement, but it's never given me an error in any of my logs, so it must be another derivation of POTC from standard C/C++ code.
 
Thanks for catching that. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/oops3.gif" style="vertical-align:middle" emoid=":eek:ops2" border="0" alt="oops3.gif" />
{sheepish explain mode on} That's because it _was_ originally an if(LogsToggle).... but I added ToggleLog and did a global searchreplace for all if(lt) statements.

Again, thankee muchly!
 
Eep. Global search and replace sounds like an evil thing to do in an environment that doesn't have strict syntax checking. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/pirate2.gif" style="vertical-align:middle" emoid=":p:" border="0" alt="pirate2.gif" />
 
I don't know if it's been fixed, or if it's even a <i>bug</i> and not one of those singular quirks that seems to happen to some games, but the one time I've experienced the "marriage" mod, it didn't work at all like it's been described on this forum.

For one, when I talked to the governor and he introduced his niece/daughter, the <i>only</i> way I could keep her from vanishing when I left the town hall was to marry her on the spot. My only options with her on first meeting were to have a conversation or marry her. Here's the kicker: <i>no matter what I selected,</i> the next time I spoke to her, she'd say, "If you must go, I will always remember our time together [paraphrased]." Even my character's wife said this every time I talked to her.

I know from reading various reports and descriptions on the forum that this is <i>not</i> the way the marriage mod should be acting, but yet it's the way mine did. I'm not familiar with the code that created the mod, so I wouldn't know where to start looking for a solution, but I'm hoping that <i>someone</i> has at least an idea.
 
Do you have a save near there? If so, please send it over and I'll have a `look-see`.

And this is the _first_ n/d you've _ever_ talked to?
 
I'm not sure I have one anymore, but I'll check. It was the first game I'd played long enough to be introduced to nieces/daughters, but I spoke to at least four before I actually married one. Every girl I spoke to disappeared the moment I left the town hall, with the exception of the one I married.

In addition to that, my rumors don't seem to be working. They stopped working in my last game, and after starting an entirely new game (after reinstalling the whole game), I'm still getting the annoying "Everything's running smooth lately, wonder how long that'll last, yadda yadda" from <i>everyone</i> I talk to. I've run through the code, and can't find a reason why it isn't producing other rumors.

EDIT: The only nearby save I have is one in Redmond town hall <i>after</i> I married a daughter. It does show that the 'wife' always says "If you must go, I'll always remember our time together." I don't know how much good it'll do, but I'll send it along.
 
Regarding my "no rumors" problem, I've been looking through the code that sets default rumors in the game, and something just isn't adding up.

The function that does this is called from <span style='color:red'>PROGRAMReinit.c</span>:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->SetRumourDefaults(true); //states added, this will only change text, not state<!--c2--></div><!--ec2-->

The function itself exists separately in two files: <span style='color:red'>PROGRAMRumour_data.c</span>. I assume the latter is the original function, and isn't used in build 11, so I've been digging through the former. Here's the beginning of the code:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->int MAX_RUMOURS = 0;

#define TOTAL_RUMOURS    256



object    Rumour[256]; //temp





void SetRumourDefaults(bool isreinit)

{

    for(int j = 0; j < TOTAL_RUMOURS; j++)

    {

 DeleteAttribute(&Rumour[j],"id"); // NK

 Rumour[j].text="";

 Rumour[j].state="inactive";

 Rumour[j].loc="";

 Rumour[j].chance = 0;

 Rumour[j].given = false;

    }



...



    int i = 0;

    if(!CheckAttribute(&Rumour[0],"tmpfix")) { DeleteAttribute(&Rumour[0],"reinit"); } // because I screwed up.

    //DEFAULT RUMOR:

    Rumour.text = "Nothing interesting happens lately. Life goes on smoothly. I wonder how long that'll last!";

    if(!CheckAttribute(Rumour[0],"reinit")) Rumour.state = "active";

    Rumour.loc = "all";

    Rumour.chance = 100;

    i++;

    

    Rumour.text = "Come to think of it, I didn't really have any gossip.  I'm just so terribly, terribly lonely...";

    if(!CheckAttribute(Rumour[0],"reinit")) Rumour.state = "active";

    Rumour.loc = "all";

    Rumour.chance = 100;

    i++;



...<!--c2--></div><!--ec2-->

Okay, I'm not sure what the original for() loop is for, but beneath it, I see an if() statement checking to see if "Rumour[0].tmpfix" exists/is true, and if it <i>isn't</i>, delete the "Rumour[0].reinit" attribute. Later, it checks to make sure that attribute doesn't exist, and if it doesn't, the rumor is set to "active." Sounds great so far, but at the bottom is this code:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->...



    if(isreinit)

    {

 Rumour[0].reinit = true; // tempfix

 Rumour[0].tmpfix = true; //because I screwed up

    }

}<!--c2--></div><!--ec2-->

So when the function is called from Reinit.c (at the beginning of the game, and every time the 'I' key is pressed), both tmpfix and reinit are reset to <i>true</i>. I don't see tmpfix being reset to false anywhere else in the code, so how does the rumors system work at all? It's a chain reaction: if tmpfix is set to true, "if(!CheckAttribute(&Rumour[0],"tmpfix")) { DeleteAttribute(&Rumour[0],"reinit"); } " won't happen, and thus "if(!CheckAttribute(Rumour[0],"reinit")) Rumour.state = "active";" won't happen, either. So how does this work, and is this why I'm not getting any rumors in my game?
 
First, did you get my email re: the wife bug?

Second, re: rumors. Yeah, my code there is _way_ screwed up. Just before I dropped off the edge of the world I sent a package of fixes to scheffnow but I sadly haven't heard from him; this was one of the fixes. I forgot about it til now, though, thanks for the headsup! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

The _idea_ here was that, when first loading the game, there would be no reinit attrib and thus rumor states would be set correctly.
But, what if the player, halfway through the game, hits I? You don't want to overwrite the states of rumors whose states have been changed (i.e. via quests), so I added an attribute to check if this was the first init, or a reinit. And if the latter, not to mess with states.
However, over a period of 3+ months, I never noticed that I _was_ setting _all_ rumors inactive at the top.
Argh! <img src="http://forum.piratesahoy.net/images/smiles/modding.gif" border="0" class="linked-image" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
So instead, I kept adding _more_ attributes to check, so that (since people had already reinited, and stuck in the old attributes) it'd check the new one and reinit properly.
But of course they kept getting stuck inactive.

Moral of the story: start at the _beginning_ of your code and read _that_ too. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/oops3.gif" style="vertical-align:middle" emoid=":eek:ops2" border="0" alt="oops3.gif" />

Now, the _best_ thing to do in this would be, to on reinit of rumors, create a table of all the ids which have states assigned, and the states; then, reinit all rumors with the default states; then, reload the saved states of the ID'd rumors.

Let me go write that down... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bookish.gif" style="vertical-align:middle" emoid=":mm" border="0" alt="bookish.gif" />
 
Here. Let me test this, but it should (heh) work:
{EDIT: I'm being too fancy. Goodbye, GetAttr* functions, hello more work.}
{EDIT2: Working now.}
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void SetRumourDefaults(bool isreinit)

{

    // NK `04-08`-30

    //save old states

    object oldstates;

    int i,j;

    string tmp;

    if(isreinit)

    {

 i = 0;

 for(j = 0; j < TOTAL_RUMOURS; j++)

 {

     if(CheckAttribute(&Rumour[j],"id"))

     {

   tmp = "r"+i;

   //GetAttribute method (unworking ATM): oldstates.savestates.(tmp) = Rumour[j].state;

   oldstates.(tmp).id = Rumour[j].id;

   oldstates.(tmp).state = Rumour[j].state;

   //trace(i + ": rumor " + Rumour[j].id + " has state " + Rumour[j].state);

   i++;

     }

 }

 oldstates.max = i;

    }

//snip.......

    i = 0;

    //DEFAULT RUMOR:

    Rumour.text = "Nothing interesting happens lately. Life goes on smoothly. I wonder how long that'll last!";

    Rumour.state = "active";

//snip.......(remove all the CheckAttribute lines)

MAX_RUMOURS = i;



    // Restore old states

    if(isreinit)

    {

 /*GetAttribute method, unworking ATM:

 aref tmpattr;

 makearef(tmpattr, oldstates.savestates);

 for(j=0; j < GetAttributesNum(tmpattr); j++)

 {

     Rumour[GetRumourIndex(GetAttributeName(GetAttributeN(tmpattr, j)))].state = GetAttributeValue(GetAttributeN(tmpattr, j));

     trace("rumor " + GetAttributeName(GetAttributeN(oldstates, j)) + " with state " + GetAttributeValue(GetAttributeN(tmpattr, j)) + "restored");

 }*/

 for(i = 0; i < sti(oldstates.max); i++)

 {

     tmp = "r" + i;

     Rumour[GetRumourIndex(oldstates.(tmp).id)].state = oldstates.(tmp).state;

     trace("Restore " + i + ": rumor " + oldstates.(tmp).id + " had state " + oldstates.(tmp).state);

 }

    }

}<!--c2--></div><!--ec2-->
 
<!--`QuoteBegin-NathanKell`+--><div class='quotetop'>QUOTE(NathanKell)</div><div class='quotemain'><!--QuoteEBegin-->First, did you get my email re: the wife bug?

Second, re: rumors. Yeah, my code there is _way_ screwed up. Just before I dropped off the edge of the world I sent a package of fixes to scheffnow but I sadly haven't heard from him; this was one of the fixes. I forgot about it til now, though, thanks for the headsup! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

The _idea_ here was that, when first loading the game, there would be no reinit attrib and thus rumor states would be set correctly.
But, what if the player, halfway through the game, hits I? You don't want to overwrite the states of rumors whose states have been changed (i.e. via quests), so I added an attribute to check if this was the first init, or a reinit. And if the latter, not to mess with states.
However, over a period of 3+ months, I never noticed that I _was_ setting _all_ rumors inactive at the top.
Argh! <img src="http://forum.piratesahoy.net/images/smiles/modding.gif" border="0" class="linked-image" />  :facepalm  
So instead, I kept adding _more_ attributes to check, so that (since people had already reinited, and stuck in the old attributes) it'd check the new one and reinit properly.
But of course they kept getting stuck inactive.

Moral of the story: start at the _beginning_ of your code and read _that_ too.  :eek:ops2  

Now, the _best_ thing to do in this would be, to on reinit of rumors, create a table of all the ids which have states assigned, and the states; then, reinit all rumors with the default states; then, reload the saved states of the ID'd rumors.

Let me go write that down...  :mm[/quote]

RE: the wife bug--yeah, I got it. I haven't had a chance to test it, because I installed Cat's `Fred-Bob` quest, which makes the old save incompatible with my new game. I'm keeping it on file, just in case the wife bug shows itself again in my new game--if that happens, I'll definitely use it. On that note, is there any explanation for why daughters/nieces that I <i>didn't</i> marry always disappear? I've gotten the impression that those girls are supposed to stay in the town hall once they've been introduced, but none of them ever did for me.

The weird thing about the rumors is that I've got two more or less identical POTC folders: one for me, another for a friend of mine who plays the game on my computer. The rumors don't seem to work on mine, but they <i>do</i> work on his game. I've checked the code, and it's identical. What gives?
 
One question about your code fix: there are a few `quest-based` rumors that are apparently set to "inactive", like this:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    Rumour.id = "Brin_here";

    Rumour.text = "I hear there's a new governor on Redmond...came all the way from Britain, on express orders of the king! And he's got orders to send back Silehard in chains!";

    if(!CheckAttribute(Rumour[0],"reinit")) Rumour.state = "inactive";

    Rumour.loc = "all";

    Rumour.chance = 100;

    i++;<!--c2--></div><!--ec2-->

Should "Rumour(i).state" be "active" or "inactive" for these? I assume "inactive", but I don't know if something in quests_reaction.c or the like changes that state later. I'll go with "inactive" for now, but let me know if that's wrong.

EDIT: I tried your code, but it caused a <i>serious</i> slowdown (`5-10` seconds) every time I asked someone about a rumor.
 
Curiouser and curiouser..

Okay, this is just weird. I couldn't figure out the cause of the slowdown, so I reloaded the backup <span style='color:red'>Rumour_data.c file</span> working, either. Oy.
 
Sorry, took me a while to test this.
Re: n/ds:
The way it's set up now, or at least is _supposedly_ set up now, what happens is:
If(some_chance) n/d spawned.
if, on exit residence, n/d has 0 talkpoints (i.e. you neither chatted with nor proposed to the n/d) then she is removed and her slot cleared for the next.
If you _did_ her slot stays hers until and unless you dump her (dumping sets talk points to 0).

The way it works is a quest is run on leaving the residence that checks the talk points of all n/d slots. If the tp is 0, the location attribute is cleared.

So if you like the n/d, choose the talk or propose options and she'll persist.

The reason for the clearing is because there's a limited amount of space in the models and a limited number of slots, and to allow the use of all the different models.

{Jeez, this is rather a cold way of talking about romance... : <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> }

As to the rumors:
Your surmise is correct: rumors with IDs and states are quest rumors, and can be (and are) activated and deactivated via code.
The brin_here rumor is activated when you sail to Khael Roa and fight Silehard.
(The various `quest-start` rumors are deactivated once you begin the quest, and the quest hint rumor(s) are activated at their appropriate places).
Also, quest rumors have "given" flags, which are set the first time someone tells you the rumor. This is so an "ungiven" quest rumor has priority when searching for rumors to return.

Re: slowdown: very weird. I finally tested it, and noticed no slowdown whatsoever.
Oh, maybe you have tracefiles still set to 0, and I forgot to uncomment the trace() statements?
 
Okay, then that wasn't working for me, either. Every time a n/d was introduced, I had two options: have a conversation, or propose. If I proposed, she accepted (after a fight with a suitor) and persisted. If I didn't speak to her <i>or</i> chose 'conversation,' she would disappear upon exit. I tested this two or three times, because I was sure it wasn't supposed to work like that. I've started a new game, so when I get back to that point, I'll let you know if it was just a bit of weirdness in my game like the rumor deal.

Yeah, I had tracefilesoff set to 0, and didn't comment out the <b>trace()</b> statements, so if that's a common slowdown culprit, it was likely it. I'll give it another try with the pertinent lines commented out.
 
1. Thanks, I'd appreciate it! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
2. Yah, trace chugs, and debug mode puts overhead on executing functions (and findrumor() does a lot of looping, which tracing slows down more than straight execution IIR scheffnow's explanation correctly).
 
Just two bugs.

<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" /> Sea Dogs,

My apologies if these bugs were already fix, but I'm new here and I can't read all the topics <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />

Here there are what I found:

Quest: Nigel Blythe,
In Quebradas Costillas this Pirate killed a man, and then I hired him.
Well, this quest is never ending, not even I kill Nigel and save the man.
When I played this quest with the original game this finished with a treasure in doutchland.

Quest: The French Pirate in the Tavern,
In this case I was able to escape for the Larouse ship and open the map for leave Oxbay. Well when I returned at sea I can't open the map again, even if I start a new game, I had to reinstall the build11.

If these bugs are already fixed, please could you tell me where I can find the patch?

Thanks a Lot,
Jack Aubrey
 
Status
Not open for further replies.
Back
Top