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

Continuing bugs in the new Beta

I may have introduced that bug myself, Pieter. There's a line that needs to be changed: Look in PostInit.c, near the top:

for (int i=0 ; i<MAX_CHARACTERS ; i++)

...should be...

for (int i=0 ; i<TOTAL_CHARACTERS ; i++)

Not all the characters were getting postinitted. <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Hook
 
Thanks for that one, Hook. But I still think that TOTAL_CHARACTERS should not be lower than MAX_CHARACTERS. Anyway: With both these things changed, it should now work excellently again. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
urrm sadly it doesnt! in my current game i changed the 1500 value to 2000, then loaded my last save. All my party Officers now no longer follow me!

I ran 'I' to re-initialise just in case, still same problem. I walked through a town gate to load in a new location and still same problem - your officers load with you, but dont follow you - they just stand around doing the normal idle animations.

I changed the value back to 1500 and they all worked as usual? maybe you need a new game for this to work?

I'll try Hooks suggestion and see how that goes.....where is PostInit.c? <img src="style_emoticons/<#EMO_DIR#>/bookish.gif" style="vertical-align:middle" emoid=":mm" border="0" alt="bookish.gif" />
 
I didn't test this with officers at all. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Ehm. Never mind about my previous posts. MAX_CHARACTERS was always lower than TOTAL_CHARACTERS and that IS the way it's supposed to be. I've been messing up big time here. Thankfully Hook DID find the REAL fix. Sorry, people. <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
 
It happens <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Its just cool we are finding these things - good news for a great new build release <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

Oh and i found PostInit.c >Progam/Characters/Init

And Arrggghhh! at Hooks comment above <img src="style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" /> <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
 
You'll need to do the same fix in Upgrade.c as well.

Change MAX_CHARACTERS to TOTAL_CHARACTERS.

I can't believe Hook messed up like that. Not only once, but twice. As punishment, I suggest we make him bunk with the women. <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

Hook
 
yeah that will teach him! <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />

oh is that the first instance of MAX_CHARACTERS near the very top of Upgrade.c - i can see another MAX_CHARACTERS about 15 lines down?
 
Change both. But it's not like this function will get a lot of use... it does a complete dump on every character in the game.

For missing the second instance of MAX_CHARACTERS in the Update.c file, we need to add two weeks additional "incarceration". <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Hey... don't mind me, I'm in a good mood after finding the problem with the fleet going neutral if the fleet commander surrenders. <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

Hook
 
no worries - still some of us have our doubts over how effective two weeks incarceration bunking with the women will be <img src="style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" /> . is that normal 'punishment' for bugs? if so i should have joined the industry years ago <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

oh and i need to ask you if you can add line numbers to these fix suggestions - i'm not that familar with the code of PotC(or C in general) so its all pretty much greek to me - line numbers will help me greatly in finding the right bit to edit, thanks and keep up the good work - build13 has the potential to be the best pirate game ever imho <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
I could add line numbers, but if there are any changes elsewhere in my code making it different from yours, the line numbers won't match. And in this case, you found an additional place that needed to be changed, for which I am grateful.

Most of the time I'll do a search for one of the lines or for the variable name that's getting changed. That's usually the easiest way to find something.

From now on I'll put in a line number, at least a general suggestion on where to find some code that needs to be changed.

Hook
 
<!--quoteo(post=167523:date=Oct 14 2006, 06:02 PM:name=Hook)--><div class='quotetop'>QUOTE(Hook @ Oct 14 2006, 06:02 PM) [snapback]167523[/snapback]</div><div class='quotemain'><!--quotec-->
.....

Most of the time I'll do a search for one of the lines or for the variable name that's getting changed. That's usually the easiest way to find something.

From now on I'll put in a line number, at least a general suggestion on where to find some code that needs to be changed.

Hook
<!--QuoteEnd--></div><!--QuoteEEnd-->

what do you use to do a search like that? something within notepad++ or the regular windows 'find' function? but yeah a general suggestion/rough line numbers would be great <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

I think for the surrender commander fix its to replace the last few lines in that 'Character Relation' section(lines 65-71 in the default nation.c file). I think pirate_kk had already done some stuff here? My previus guess at changing the lines further up was wrong....i think. see i need help, aint no coder but happy to test <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
<!--quoteo(post=167521:date=Oct 14 2006, 06:53 PM:name=Black Bart)--><div class='quotetop'>QUOTE(Black Bart @ Oct 14 2006, 06:53 PM) [snapback]167521[/snapback]</div><div class='quotemain'><!--quotec-->
no worries - still some of us have our doubts over how effective two weeks incarceration bunking with the women will be <img src="style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />
<!--QuoteEnd--></div><!--QuoteEEnd-->
Depends on the looks and the fancies of the women <img src="style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" /> <img src="style_emoticons/<#EMO_DIR#>/whippa.gif" style="vertical-align:middle" emoid=":whipa" border="0" alt="whippa.gif" />


Thank's everybody, that was a great bughunting party, good teamwork <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" /> Let's drink on the death of this bug <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
<!--quoteo(post=167534:date=Oct 14 2006, 06:47 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Oct 14 2006, 06:47 PM) [snapback]167534[/snapback]</div><div class='quotemain'><!--quotec-->
<!--quoteo(post=167521:date=Oct 14 2006, 06:53 PM:name=Black Bart)--><div class='quotetop'>QUOTE(Black Bart @ Oct 14 2006, 06:53 PM) [snapback]167521[/snapback]</div><div class='quotemain'><!--quotec-->
no worries - still some of us have our doubts over how effective two weeks incarceration bunking with the women will be <img src="style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />
<!--QuoteEnd--></div><!--QuoteEEnd-->
Depends on the looks and the fancies of the women <img src="style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" /> <img src="style_emoticons/<#EMO_DIR#>/whippa.gif" style="vertical-align:middle" emoid=":whipa" border="0" alt="whippa.gif" /> <!--QuoteEnd--></div><!--QuoteEEnd-->

After months at sea and a few casks of rum i'd ner by worrying <img src="style_emoticons/<#EMO_DIR#>/danse1.gif" style="vertical-align:middle" emoid=":dance" border="0" alt="danse1.gif" />

<!--quoteo(post=167534:date=Oct 14 2006, 06:47 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Oct 14 2006, 06:47 PM) [snapback]167534[/snapback]</div><div class='quotemain'><!--quotec-->
Thank's everybody, that was a great bughunting party, good teamwork <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" /> Let's drink on the death of this bug <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
<!--QuoteEnd--></div><!--QuoteEEnd-->

And the drinks to Mr.Hook - when he gets out of his two weeks with the lasses....poor man. yar! <img src="style_emoticons/<#EMO_DIR#>/buds.gif" style="vertical-align:middle" emoid=":drunk" border="0" alt="buds.gif" />
 
I've got a question. Should this line be changed?
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->bool DumpCharacterSlot(int n)
{
// b13level only if(n >= CHARACTERS_QUANTITY) return false;
<b>if(n >= MAX_CHARACTERS) return false; // b12 line</b>
ref ch;
makeref(ch, Characters[n]);
if(ch.id == "0") return true; // we don't want any gaps--so we keep going even if one is blank. There never should be any gaps...but you never know.
trace("************************");
trace("character "+ch.id); // go by id, not index, because in b13 we may not have same order!
DumpAttributes(GetCharacter(n));
return true;
}<!--QuoteEnd--></div><!--QuoteEEnd-->I know this line was not changed by Hook and this line has been like this for ages. So is this correct or not? <img src="style_emoticons/<#EMO_DIR#>/wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" />
The commented out line above doesn't make things clearer either. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

This code was changed by Hook and I suppose this does need to be changed to TOTAL_CHARACTERS, right? <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->void DumpCharacters()
{
bool btmp;
<b>for (int i=0 ; i<MAX_CHARACTERS ; i++)</b>
{
btmp = DumpCharacterSlot(i);
if (!btmp) return;
}<!--QuoteEnd--></div><!--QuoteEEnd-->
 
To Hook: Can you please send the properly fixed files to me or put them on the FTP or something? For some reason, I keep getting this bug today, even if I do change all instances of MAX_CHARACTERS and I am now greatly confused. <img src="style_emoticons/<#EMO_DIR#>/wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" />
 
dito Pieter - i've sadly come across doubled chars also(i posted in the other thread) - ah well it was a good bug-hunting party for 12hrs or so <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" /> computers....cant live with em, cant live without em!

I think we are going to have to be patient for the build13 release - All you coders are doing the best you can, in your own time for free - so well lets just be happy its going in the right direction, but dont rush it before its ready?
 
That's in the file Upgrade.c. Look at what the code does: it does a DumpAttributes() on *every* character in the game. Have you ever seen this? It would take forever... it already takes several seconds just to dump just one character. This code isn't going to get executed much.

Just change two instances of MAX_CHARACTERS to TOTAL_CHARACTERS and the code should work as intended. If it's ever run.

I have no idea what the "b13" comments in that file are about. In any case a character without an ID will not get dumped, so as long as the limit at the top of that file will catch all characters (that is, if it's TOTAL_CHARACTERS and will go through the entire character array) then the code should work as intended.

PostInit.c will require TOTAL_CHARACTERS to work properly.

If you're really concerned, then take out the loops I added and uncomment the lines in the code that said there was no need to do all this manually.

Hook
 
Ok, I found the problem with the doubling characters. It's going to be an easy fix, and saved games may still work.

TOTAL_CHARACTERS is the total number of character slots available. MAX_CHARACTERS is the number of permanent characters the game creates. LOC_FANTOM_CHARACTERS is the starting index in the Characters array for fantom characters.

We were getting the doubling because the current Globals.c file has more MAX_CHARACTERS than before, but LOC_FANTOM_CHARACTERS was not changed. The game would log in all the MAX characters, then start logging in FANTOM characters. Since the MAX character index was higher than the FANTOM starting index, the fantoms would get logged in twice.

I changed MAX characters back to 1150, which was smaller than the FANTOM 1160, and did not get the doubling. We need to find out exactly how many permanent characters are actually being created and set MAX characters accordingly. If we're creating more permanent characters than the current setting of 1160 for FANTOM characters, then the FANTOM starting index will have to be increased to above MAX_CHARACTERS. If we change LOC_FANTOM_CHARACTERS then a saved game probably won't work.

Let me see what I can figure out with MAX_CHARACTERS and I'll post results later. But at least we know the cause and can find a fix now.

Hook
 
Back
Top