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

Mod Release Changing Face of the Caribbean

fudge dragon

Landlubber
Storm Modder
Well to start with, I'm back. I doubt anyone remembers me that well, I've been hear a few times, but never for that long.

Great news on the source code, I wish more game developers gave their source code away when the get out of the business. I'm a believer that it is a great shame when the source code to any game is lost, due to all the time and effort that programmers have but into it.

Onto the subject of this thread. A couple of years ago now, I wrote a section of code I called "Changing face of the Caribbean". And released it onto this forum as an add on to the build.
I was never quite happy with it, and coded a new version about a year later, when I went on a canal boat holiday (It got me in a nautical mood). Unfortunately the holiday was a disaster and I forgot all about it, so I don't know if I ever released version 2.0 (it was a complete rewrite from scratch).

Last week (funnily enough while on holiday), I rediscoved my code on an old laptop, and It got me itching to play, (and therefore mod, I've never quite managed to do one without the other).
Once I got home I installed Build 14 Beta 1 Patch 3.1 on my main PC, and was surprised to find my code still stitched into DaliyCrewUpdate.c, as I was expecting it to have caused problems with Storylines.

Anyway, I'm back working on my new version, key features include, different customised able diplomatic leanings, corruption, different settings per storyline, basic modelling of alliances and customisation of the rate of change

The things that I intend to complete before release:

1. Overhaul Shifting framework - 100%
2. Perform Example Integration into standard storyline - 85% - Need to track down all governors, basic code all written, just need substituting into the 4 places per governor dialogue.
3. Localise Governor Dialogues - 0% - yea I'm gonna need help with this one
4. Fully Document Functions and integration - 100%

Overall Progress until release - 100%

The first thing I am working on is getting the localisation off the ground. Generation of governor dialogues for my mod is currently done by the function GetNationRelationWithMe() (its one of mine)
This uses iteration to work out every ally and every enemy, and string them together to make A dialogue in the form of "NATION currently considers Nation, Nation and Nation as its allies. In addition we are at war with Nation, and of course pirates are to be sunk on sight". The problem is I original coded this for myself, so its hard-coded in English. Please could someone lend a mind to the problem, Do I have to make my function take language as in input and write multiple versions in a switch statement, or is there a pre-establised was of localising text outside of the dialogue files. If it helps here is the function in question

Code:
String GetNationRelationWithMe(int iTrueNationNumber)
{
String Temp = ""
String ReturnString = ReturnNationName(ReturnFudgeNationNumber(iTrueNationNumber)) + " currently considers "
int Count
int NationsAdded= 0
for (Count = 1; Count <= 5; Count++)
{
if (Count == ReturnFudgeNationNumber(iTrueNationNumber))
{
if (Count == 5)
{
break;
}
else
{
Count += 1;
}
}
if (GetNationRelation(iTrueNationNumber, ReturnTrueNationNumber(Count)) == RELATION_FRIEND)
{
if (NationsAdded < 2)
{
ReturnString = ReturnString + Temp
}
else
{
ReturnString = Returnstring + ", " + Temp
}
Temp = ReturnNationName(Count)
NationsAdded += 1
}
}
if (NationsAdded > 0)	
{
if (NationsAdded > 1)
{
ReturnString = ReturnString + " and " + Temp + " as its allies. In addition we are at war with "
}
else
{
ReturnString = ReturnString + Temp + " as its sole ally. In addition we are at war with "
}
}
else
{
ReturnString = ReturnString + "no great power as its ally. In addition we are at war with "
}
NationsAdded = 0
Temp = ""
for (Count = 1; Count <= 5; Count++)
{
if (Count == ReturnFudgeNationNumber(iTrueNationNumber))
{
if (Count == 5)
{
break;
}
else
{
Count += 1;
}
}
if (GetNationRelation(iTrueNationNumber, ReturnTrueNationNumber(Count)) == RELATION_ENEMY)
{
if (NationsAdded < 2)
{
ReturnString = ReturnString + Temp
}
else
{
ReturnString = Returnstring + ", " + Temp
}
Temp = ReturnNationName(Count)
NationsAdded += 1
}
}
if (NationsAdded > 0)	
{
if (NationsAdded > 1)
{
ReturnString = ReturnString + " and " + Temp
}
else
{
ReturnString = ReturnString + Temp
}
}
else
{
ReturnString = ReturnString + "no great power"
}
if (GetNationRelation(iTrueNationNumber, PIRATE) == RELATION_ENEMY)
{
if (NationsAdded == 0)
{
ReturnString = Returnstring + ", but of course pirates are always to be sunk on sight."
}
else
{
ReturnString = Returnstring + ", and of course pirates are always to be sunk on sight."
}
}
else
{
ReturnString = Returnstring + ". In addition captain, It would be in " + ReturnNationName(ReturnFudgeNationNumber(iTrueNationNumber)) + "'s best interest if you did not bother pirates while in our service. We have come to an arrangement."
}
return (ReturnString)
}

Fudge Dragon

EDIT: Of course. thinking about it, It was written to be grammatically correct in English, It'll probably make for a horrid translation.

EDIT: Updated Progress
 
Hey, welcome back Fudge Dragon; I DO remember you, yes! No idea why you were never promoted to Modder, so I'll do that right now! :woot

This sounds absolutely brilliant! It's something that could add a lot to the game and you might be able to get these guys interested to give you a hand:
http://forum.piratesahoy.net/topic/16529-nations-ranks-new-ideas/

As far as localization is concerned, I can't quite care about that.
There's quite a lot of non-localized code in the modpack again already and I don't think we'll ever get any finished translation packs done.
 
Ok. I'll proceed without the localisation for now. I did have a look at that thread, although I was planning to have a look at Item generation after I had finished this off, I got one too many flintlock pistol, and I'm gonna guess the Mercenary's Pistol was also supposed to be unique?

The thread mentions concerns changing the ranking system to provide better rewards at higher ranks, mine concerns making ranking up more interesting as you might not always be shooting the same ships. Although that brings something to mind, If a nation has no other enemies, they usually offer you a pirate mission, but if a corrupt governor has signed as ceasefire with the pirates? I might need to add a handler for that to the governor dialogues.

Without worrying about localisation, we're 59% done.

Oh, and thanks for the modder promotion.
 
...I was planning to have a look at Item generation after I had finished this off, I got one too many flintlock pistol, and I'm gonna guess the Mercenary's Pistol was also supposed to be unique?
Very much so. See your PMs! :woot

Oh, and thanks for the modder promotion.
You're welcome, mate. You deserved it a long time ago already. :facepalm
 
Quick question that has always confused me about POTC, what determines if something goes in quests_reaction.c or both_reaction.c


EDIT: There seems to be some funny stuff going on. I distinctly remember there being a quest during the mainquest that involves taking a letter to the leader of the Quasbequos Constelas Pirates (whatever name they go by these days), I was gonna up sliehards corruption during that quest and then drop it again when he gets removed from office and replaced by Clifford Brin. The problem? I cant find the Quests_Reaction.c entry for it. It's still all present in both leaders dialogues, but not in the quests file (strangely I'm getting related entries in the legend of jack sparrow, but I expect that was due to a dialogue copy paste. Was this part of the mainquest removed, or have I stumbled across a bug.


EDIT: Noticed that they were not present in Build 13 Final either. I am going to proceed as if it is the intended behaviour (I think someone would have noticed between build 13 and now.)

EDIT: Have continued to mod, Need advice on randomly generated "Pirate Missions". I'm assuming that these are picked from nations hostile to the nation in question. Need where to find the function that handles it, as my mod introduces the possibility of a nation having no enemies.

Also, Should I stop a nation giving out Letters of Marque if it has no enemies, I doubt nations take on privateers outside of wartime.
 
Quick question that has always confused me about POTC, what determines if something goes in quests_reaction.c or both_reaction.c
NO idea. It seems to me its two files for the same thing.
For the Jack Sparrow storyline, we decided to use quests_reaction.c for the main quest and both_reaction.c for the sidequests. :shrug

EDIT: There seems to be some funny stuff going on. I distinctly remember there being a quest during the mainquest that involves taking a letter to the leader of the Quasbequos Constelas Pirates (whatever name they go by these days), I was gonna up sliehards corruption during that quest and then drop it again when he gets removed from office and replaced by Clifford Brin. The problem? I cant find the Quests_Reaction.c entry for it. It's still all present in both leaders dialogues, but not in the quests file (strangely I'm getting related entries in the legend of jack sparrow, but I expect that was due to a dialogue copy paste. Was this part of the mainquest removed, or have I stumbled across a bug.

EDIT: Noticed that they were not present in Build 13 Final either. I am going to proceed as if it is the intended behaviour (I think someone would have noticed between build 13 and now.)
It's still there, but it seems it's handled fully through dialog. This is where it's started in Robert Christopher Silehard's dialog file:
Code:
		case "blaze_return_to_silehard_6":
dialog.text = DLG_TEXT[261] + GetMyName(Pchar) + DLG_TEXT[262];
Link.l1 = DLG_TEXT[263];
Link.l1.go = "exit";
pchar.quest.main_line = "letter_to_Isenbrandt";
AddQuestRecord("blaze_search_rheims", 11);
CloseQuestHeader("blaze_search_rheims");
SetQuestHeader("Blaze_to_Isenbrandt");
AddQuestRecord("blaze_to_Isenbrandt", 1);
Diag.TempNode = "first time";
break;
The same in the Jack Sparrow storyline code is leftovers from copying, but isn't used.

EDIT: Have continued to mod, Need advice on randomly generated "Pirate Missions". I'm assuming that these are picked from nations hostile to the nation in question. Need where to find the function that handles it, as my mod introduces the possibility of a nation having no enemies.
In PROGRAM\QUESTS\quests_common.c:
Code:
void InitQuestPirate(int iNation)
{
ref mchr = GetMainCharacter(); // KK
ref ch = CharacterFromID("Quest Pirate");
int idx = sti(ch.index);

int HostileNation = LotHostileNation(iNation);
And in PROGRAM\dialog.c:
Code:
int LotHostileNation(int iNation)
{
int nat;
nat = Rand(NATIONS_QUANTITY - 1);
while (GetNationRelation(iNation, nat) != RELATION_ENEMY) {
nat = Rand(NATIONS_QUANTITY - 1);
}
return nat;
}
Looks like you indeed will need to change something there, otherwise I can see an infinite loop happening there! :shock

Also, Should I stop a nation giving out Letters of Marque if it has no enemies, I doubt nations take on privateers outside of wartime.
That does sound like it makes sense to me. :yes
 
Well, Documentation is finished now, so we're on the final steps. I'm going to assume however that we have more than the 5 governors now with all our new Islands.

Edit:

Seaching through the games files seems to reveal the following governors

Felipe Cisneros
Cole Arkwright
Joseph Claude Le Moigne
Jacinto Arcibaldo Barreto
Sao Feng
Arendt Dickman
Robert Christopher Silehard
Edmund Christobel Shaw
Hans Kloss
Hendrick van der Kuylen
Isabelle de Cussy
Javier Balboa
John Clifford Brin
Micheal Wainwright
Philippe de Rivarol
Reynard Grueneveldt
Salvador Allende
Thomas Modiford
Remy Gatien

Which is a lot of governors, some of which exist in multiple places. I plan to modify the ones for the standard storyline, but I may also need to modify some in the main folder, so it would greatly help if someone was to tell me which governors are in use for the standard storyline.
 
These are the stock islands' governors:
Joseph Claude Le Moigne - Martinique
Jacinto Arcibaldo Barreto - Grenada
Robert Christopher Silehard - Jamaica
John Clifford Brin - Jamaica (replacement)
Reynard Grueneveldt - Bonaire
Christofor Manuel De Alencar - Puerto Rico

There's some others used by Bartolomeu's sidequests in the Standard storyline though.
 
In the standard storyline the governors for the other islands are, at the end of the main quest:

Eleuthera - Governors harbour - Cole Arkwright
Eleuthera -Alice Town - Michael Wainwright ( no dialog file assigned )

Cayman - Edmund Christobel Shaw

Cuba - Santiago - Dionisio Martinez De la Vega
Cuba - Havana - Vincente De Raja

Hispaniola - Port au Prince - Isabelle de Cussy
Hispaniola- Santo Domingo - Salvador Allende

Curacao - Hans Kloss

Aruba - Hendrick van der Kuylen

Guadeloupe - Remy Gatien ( is part of Search for Bartolomeu's crew Side Quest )

Nevis - Sir William Stapleton

St Martin - Marigot - Chavalier Martinez de Rionville
St Martin - Philipsburg - Jan Simonszoon de Buck

Turks ( pirates ) - Dante Siciliano Shaw ( Diplomat dialog )
Tortuga ( Pirates ) - Bertrand Ogeron ( Diplomat dialog )

Antigua - NAVAL Base ( specific dialog )

:drunk
 
The same characters are used in all storylines with the same IDs and the same dialog files.
They just might have their names changed based on the time period.
The sole exception is Brin/Silehard, which are two seperate characters,
with Silehard only being in the Standard storyline and Brin in all others.
 
So this mod will now be automatically ON in various storylines. To try to clearly communicate this to players, I am adding the following QuestBook entry upon starting a new game with this mod enabled:
Turbulent Times
There is unrest brewing in the Caribbean. Nations make and break alliances at their slightest whim. I had better keep an eye on all recent developments, lest I find myself caught in the middle of a war.
 
Good idea. That should make things a bit clearer, especially for players that might consider the changing relations as a bug in the game.
 
Back
Top