• 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 Rumours don't use current nation

Levis

Find(Rum) = false;
Staff member
Administrator
Creative Support
Programmer
Storm Modder
If you look at the dialog files for a certain citizen you see a line like this:
Code:
d.Text = SelectRumour("Oxbay", "England");

You'll see the nation is hardcoded in there
I think instead of that it should use:
Code:
GetNationIDByType(sti(NPChar.nation))
If these nation are updated at least. Else it should use:
Code:
GetLocationNationFromID(NPChar.location)

So if someone can confirm the nation of all citizens is updated at the start of the game depending on the period and when a town is captured we can use the first. Else the seccond would be easier I guess (altough I prefer to use the first one cause it might be used at other points too).

Could someone take a look at this? It probably needs to be changed in all citizen dialog files.

---

While someone is at it he might be able to look into this too:
Code:
if(Rand(1)==0)

You will see multiple instances of this.
These should be changed to:
Code:
if(Rand(99)<50)

if you wanna know why take a look here:
Solved - Random or Quasi Random Numbers? | PiratesAhoy!
 
Last edited:
The character attributes should indeed already be updated through town captures.

But is that code written to use a string or int as input?
Because I see a string in the code you post, but the character attribute is an int.
 
The character attributes should indeed already be updated through town captures.

But is that code written to use a string or int as input?
Because I see a string in the code you post, but the character attribute is an int.
Ah then it should use a conversion function first I guess.
It should use:
Code:
GetNationNameByType(sti(NPChar.nation))
 
Make sure to get the nation ID!
The name may differ between periods and throw things out of whack for you. :shock
 
Make sure to get the nation ID!
The name may differ between periods and throw things out of whack for you. :shock
Changed it in the first post now.
Here you can find a list of all citizens dialog files where it probably needs to be changed:
Low Priority - Asking for Directions Unlocks Fast Travel | PiratesAhoy!
But I advice just searching for:
SelectRumour
everywhere and changing it.

@Mirsaneli could you maybe look at this? I think it's a pretty straight forward mod and it shouldn't be that hard :). Maybe by doing it you will get to know the coding a bit more :).
 
I just did the usual "search entire PROGRAM folder" trick and found also these instances:
Code:
ref lcn = &Locations[FindLocation(PChar.location)];
[...]
dialog.text = SelectRumour(lcn.island, GetNationNameByType(GetCurrentLocationNation()));
And:
Code:
d.Text = SelectRumour("Oxbay", GetNationNameByType(GetTownNation(GetTownIDFromLocID(NPChar.location)))); // KK
So looks like SOME of the dialogs already have something in place for this. But by far not all!

These also notably use GetNationNameByType, while I would definitely recommend using GetNationIDByType instead!

Because "name" may be England/Britain depending on the period, but ID is NOT period-dependent.

That being said, all of this makes virtually no difference whatsoever.
There is exactly ONE rumour that is defined with a nation:
Code:
   Rumour[i].text = LanguageConvertString(tmpLangFileID,"People say that some kind of aboriginal cemetery was found inside the Oxbay mine. A lot of bones, crockery, spikes and clay plates were found... but not a grain of gold!");
   Rumour[i].state = "active";
   Rumour[i].loc = "England";
   Rumour[i].chance = 35; //We should be sparse with this info -levis
   i++;

But of course the function calls should still be correct.
Simplest might actually be to rewrite the function itself like this:
Code:
string SelectRumour()
{
   //build available rumor table, borrowed from build encounter table. ;)
   int AvailRumors[256]; //temp, should be [TOTAL_RUMOURS];
   int NumRumours = 0;
   bool questavail = false;
   bool qonly = false;
   bool qungiven = false;

string rIsland = FindIslandByLocation(LoadedLocation.id);
string rNation = GetNationIDByType(GetCurrentLocationNation());

   for(int i = 0; i < TOTAL_RUMOURS; i++)
   {
Then you can just call that function WITHOUT input variables and it just determines the island and nation from the current location.
That would make this a simple search-and-replace.

Sounds like a plan?
 
Changed it in the first post now.
Here you can find a list of all citizens dialog files where it probably needs to be changed:
Low Priority - Asking for Directions Unlocks Fast Travel | PiratesAhoy!
But I advice just searching for:
SelectRumour
everywhere and changing it.

@Mirsaneli could you maybe look at this? I think it's a pretty straight forward mod and it shouldn't be that hard :). Maybe by doing it you will get to know the coding a bit more :).

So you are just asking me to change the Nation to ID? o_O
 
So you are just asking me to change the Nation to ID? o_O
The idea was basically to replace something like this:
Code:
d.Text = SelectRumour("Oxbay", "England");
With this:
Code:
d.Text = SelectRumour("Oxbay", GetNationIDByType(sti(NPChar.nation)) );
But if @Levis agrees with my suggestion above, it would only require replacing with:
Code:
d.Text = SelectRumour();
So you may want to hold off until we've confirmed how exactly we would want to see it done.
 
The idea was basically to replace something like this:
Code:
d.Text = SelectRumour("Oxbay", "England");
With this:
Code:
d.Text = SelectRumour("Oxbay", GetNationIDByType(sti(NPChar.nation)) );
But if @Levis agrees with my suggestion above, it would only require replacing with:
Code:
d.Text = SelectRumour();
So you may want to hold off until we've confirmed how exactly we would want to see it done.

Ok, no problem. Should be easy task :)
 
@Pieter Boelen I think its better to keep it as arguments. I can imagine quest cases where a character might give rumours about other islands or other nations then the place he actually is. And changing all the functions shouldn't be that hard.
using FindIslandByLocation as argument does sound good. so incase something gets copied it will still work.
 
So use this then?
Code:
d.Text = SelectRumour(FindIslandByLocation(LoadedLocation.id), GetNationIDByType(GetCurrentLocationNation()) );
That is probably the shortest and most dynamic logic we could apply.
 
Sounds fine to me :).
so @Mirsaneli could you do a search in all dialog files for the SelectRumour function and replace it with above code? (mind that some will have something else instead of d.Text so just search for SelectRumour and only change that part).
And afterward try to test it in on few islands. The normal citizens (the ones who give directions) should also be able to give rumours (50% chance I believe).
I would be nice if you could also look at the second part of the first post and replaces that also in the dialog files and test it. It should make the 50% more like and actual 50%.
 
So I shall go ahead and NOT do this search-and-replace then. :doff

This point does still stand though:
That being said, all of this makes virtually no difference whatsoever.
There is exactly ONE rumour that is defined with a nation:
Code:
   Rumour[i].text = LanguageConvertString(tmpLangFileID,"People say that some kind of aboriginal cemetery was found inside the Oxbay mine. A lot of bones, crockery, spikes and clay plates were found... but not a grain of gold!");
   Rumour[i].state = "active";
   Rumour[i].loc = "England";
   Rumour[i].chance = 35; //We should be sparse with this info -levis
   i++;
 
So I shall go ahead and NOT do this search-and-replace then. :doff

This point does still stand though:
We want to tie in this system more into the game and use it more. If so we are probably going to use more nation specific rumours. I can imagine the nation relation stuff generating rumours based on the current relations ("I hear the governor will like you if you sink some french ships" or something like that).
 
Sounds fine to me :).
so @Mirsaneli could you do a search in all dialog files for the SelectRumour function and replace it with above code? (mind that some will have something else instead of d.Text so just search for SelectRumour and only change that part).
And afterward try to test it in on few islands. The normal citizens (the ones who give directions) should also be able to give rumours (50% chance I believe).
I would be nice if you could also look at the second part of the first post and replaces that also in the dialog files and test it. It should make the 50% more like and actual 50%.

I could do it, but since I'm busy these days in school with grades and everything (the end of first semester is close) I cannot complete it very fast. I need 3-4 days and then I will report back. OK?
 
I could do it, but since I'm busy these days in school with grades and everything (the end of first semester is close) I cannot complete it very fast. I need 3-4 days and then I will report back. OK?
No problem. It has no rush. If you can't do it pieter or I could do it. but I think we can spend our time better and you wouldn't mind to be credited a bit also right ;).
 
We want to tie in this system more into the game and use it more. If so we are probably going to use more nation specific rumours. I can imagine the nation relation stuff generating rumours based on the current relations ("I hear the governor will like you if you sink some french ships" or something like that).
Well, I DID also say right after:
"But of course the function calls should still be correct." ;)

I could do it, but since I'm busy these days in school with grades and everything (the end of first semester is close) I cannot complete it very fast. I need 3-4 days and then I will report back. OK?
If you know how to do it, it should be about a 10-minute job, I think? 5 if you're fast.
 
So, these are the files that I need to edit?

Untitled.jpg
 
either use windows search to search inside the files for "SelectRumour"
Or use Notepad++ to search in the files.
If you know the files find the cases in the files and replace it :).

edit: argh ninja'd :ninja
 
Back
Top