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

Included in Build Distinguish between different playstyles

Could anyone give me some hints as to where these codes reside concerning relations, promotion, and land grants?
 
PROGRAM\Characters\CharacterUtilite.c or PROGRAM\NATIONS\nations.c are what springs to mind from memory.
 
there's a line on removeLandFromCharacterNation in LeaveService. Not sure why the in game total amount of land is not modified accordingly thoughts?

There's also an attribute on landIsland. so the land owned is actually attached to particular islands?
 
Last edited:
I am not very familiar with the land owning system, but I do know that land given is indeed related to the governor of a certain island for some reason.
Perhaps this is what confuses things. Of course when the feature was added, we were still using the stock game worldmap and that only had a single governor per nation.
Of course that is now no longer the case.
 
that would be great to have it tied to island, so the economy would influence revenue of land. but still, why is the land amount not decreased when the character left service/became hostile to own nation?
 
Can you show a section of code with removeLandFromCharacterNation used?
 
Code:
void RemoveLandFromCharacterNation(ref _refCharacter, int iNation)
{
    if (iNation < 0 || iNation >= NATIONS_QUANTITY) return;
    iNation++;
    string n = "n" + iNation;
    for (int i = 0; i < ISLANDS_QUANTITY; i++)
    {
        if (!CheckAttribute(&Islands[i], "id")) continue;
        string sIsland = Islands[i].id;
        if (CheckAttribute(_refCharacter, "land." + sIsland + "." + n)) DeleteAttribute(_refCharacter, "land." + sIsland + "." + n);
    }
}

used in ...
Code:
bool LeaveService(ref char, int iNation, bool override)
{
   bool leavebad = false;
   if(sti(char.reputation) < REP_LEAVEMIN) leavebad = true;
   if(override) leavebad = true;
   string sNation = iNation;
   int curRank = GetRank(char, iNation);
   char.nations.(sNation).Rank = 0;
   char.nations.(sNation).OldRank = 0;
   if(curRank)
   {
     aref arTmp; // KK
     if(leavebad)
     {
       RemoveLandFromCharacterNation(&char, iNation); // KK
       curRank = 0;
     }
// KK -->
     makearef(arTmp, char.nations.(sNation));
     arTmp.OldRank = curRank;
// <-- KK
   }
   //UpdateTitle(&char);
   if(leavebad)
   {
     if(GetRMRelation(&char, iNation) > REL_WAR) SetRMRelation(&char, iNation, REL_WAR);
// KK -->
     if (ENABLE_FLAGS == 1)
       if(GetActualRMRelation(iNation) > REL_WAR) SetActualRMRelation(iNation, REL_WAR);

// <-- KK
     //if(GetRMKills(&char, iNation) < RM_GROUP_MINKILLS) SetRMKills(&Char, iNation, RM_GROUP_MINKILLS);
     LAi_group_SetRelation(GetSoldiersName(iNation)+"_SOLDIERS", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
     //SetAllSoldierGroups(&char);
   }
   else {
     if(GetRMRelation(&char, iNation) > REL_AFTERATTACK) SetRMRelation(&char, iNation, REL_AFTERATTACK);
// KK -->
     if (ENABLE_FLAGS == 1) {
       if(GetActualRMRelation(iNation) > REL_AFTERATTACK) SetActualRMRelation(iNation, REL_AFTERATTACK);
     }
// <-- KK
   }

// KK -->
   // Lost LoM
   if (ENABLE_FLAGS == 1) {
     LooseLetterOfMarque(iNation);
     HoistFlag(sti(char.nation));
   }
// <-- KK

   //choose new flag
// KK -->
   if (ENABLE_FLAGS == 0) {
     if(sti(char.nation) == iNation && iNation != PIRATE) ChooseBestFlag(&char);
   }
// <-- KK

   // PB: Reset Crew -->
   Characters[GetCharacterIndex("Crewmember_01")].model = "bocman";
   Characters[GetCharacterIndex("Crewmember_01")].headmodel = "h_bocman";
   Characters[GetCharacterIndex("Crewmember_02")].model = "black_corsair";
   Characters[GetCharacterIndex("Crewmember_02")].headmodel = "h_black_corsair";
   Characters[GetCharacterIndex("Crewmember_03")].model = "man5";
   Characters[GetCharacterIndex("Crewmember_03")].headmodel = "h_man5";
   Characters[GetCharacterIndex("Crewmember_04")].model = "man4";
   Characters[GetCharacterIndex("Crewmember_04")].headmodel = "h_man4";
   Characters[GetCharacterIndex("Crewmember_05")].model = "capitan";
   Characters[GetCharacterIndex("Crewmember_05")].headmodel = "h_capitan";
   Characters[GetCharacterIndex("Treas_Crewmember_1")].model = "Bocman";
   Characters[GetCharacterIndex("Treas_Crewmember_1")].headmodel = "h_Bocman";
   Characters[GetCharacterIndex("Treas_Crewmember_2")].model = "Sailor4";
   Characters[GetCharacterIndex("Treas_Crewmember_2")].headmodel = "h_Sailor4";
   Characters[GetCharacterIndex("Treas_Crewmember_3")].model = "Sailor5";
   Characters[GetCharacterIndex("Treas_Crewmember_3")].headmodel = "h_Sailor5";
   Characters[GetCharacterIndex("Treas_Crewmember_4")].model = "Sailor6";
   Characters[GetCharacterIndex("Treas_Crewmember_4")].headmodel = "h_Sailor6";
   Characters[GetCharacterIndex("Treas_Crewmember_5")].model = "Sailor7";
   Characters[GetCharacterIndex("Treas_Crewmember_5")].headmodel = "h_Sailor7";
   Characters[GetCharacterIndex("Treas_Crewmember_6")].model = "Pirtt7";
   Characters[GetCharacterIndex("Treas_Crewmember_6")].headmodel = "h_Pirtt7";
   Characters[GetCharacterIndex("Treas_Crewmember_7")].model = "Sailor1";
   Characters[GetCharacterIndex("Treas_Crewmember_7")].headmodel = "h_Sailor1";
   Characters[GetCharacterIndex("Treas_Crewmember_8")].model = "Bocman3";
   Characters[GetCharacterIndex("Treas_Crewmember_8")].headmodel = "h_Bocman3";
   Characters[GetCharacterIndex("Treas_Crewmember_9")].model = "Black_corsair";
   Characters[GetCharacterIndex("Treas_Crewmember_9")].headmodel = "h_Black_corsair";
   Characters[GetCharacterIndex("Treas_Crewmember_10")].model = "50evl2in";
   Characters[GetCharacterIndex("Treas_Crewmember_10")].headmodel = "h_50evl2in";
   DeleteAttribute(char, "boardingmodels");
   // PB: Reset Crew <--
   if(leavebad) return true;
   return false;
}

PS: in adding land during promotion, there's a quantify() called. perhaps that's what's missing when taking land away? Maybe we can just mirror the addingLand function and call quantify() and set it to zero? I'm refering to...

Code:
int AddLandToCharacter(ref _refCharacter, string sIsland, int iNation, int quantity)
{
   if (FindIsland(sIsland) < 0) return 0;
   if (iNation < 0 || iNation >= NATIONS_QUANTITY) return 0;
   int newland = GetCharacterLandIslandNation(_refCharacter, sIsland, iNation) + quantity;
   if (newland < 0) newland = 0;
   iNation++;
   string n = "n" + iNation;
   _refCharacter.land.(sIsland).(n).quantity = newland;
   return newland;
}
 
Last edited:
Looking at the code, it may be working. You should use some trace or LogIt lines to see what code is actually executed.
For example, I'm not sure if the whole LeaveService function is even triggered at all if you turn hostile at sea; it may be only if you actually tell a governor you are leaving the service in dialog.
Of course that should then be addressed, since it should ALWAYS be called if appropriate.

Also we may have to think on what to do with that "Reset Crew" section there now that Beta 3.4 changed some stuff.
Didn't remember I wrote that. :cheeky
 
it looks to me that the land is only taken away if you "leave bad". I dont know when this is triggered tough. Look for the call of this function and see how the overwrite varaible is set.
 
Leavebad happens:
if(sti(char.reputation) < REP_LEAVEMIN)
if(override)


I don't know when "override" happens, but searching the PROGRAM folder for LeaveService should tell us.
 
For example, I'm not sure if the whole LeaveService function is even triggered at all if you turn hostile at sea; it may be only if you actually tell a governor you are leaving the service in dialog.
Of course that should then be addressed, since it should ALWAYS be called if appropriate.
Yes, it IS called when attacking at sea through the AttackRMRelation function.
If your relation was previously neutral with the ship/fort attacked, then "leave bad" also occurs and you should lose your land as well.

So it looks like just about everything for this is already in place.
@andyandy, can you describe exactly the situation where you noticed you do NOT lose your land?
Re-reading your opening post, perhaps you are referring to a "random relation change" in the Free Play storylines.
 
So with Beta 3.4, @Levis made the gameplay for smugglers a fair bit more interesting and involving.
We have also started on improving privateer and navy gameplay as per this thread: http://www.piratesahoy.net/threads/distinguish-between-navy-and-privateer-gameplay.24511/
But that leaves out one other method of making an honest living, being that of a proper merchant!

We did discuss this briefly a few weeks back and the following points cropped up:
- There is already an EITC office on Jamaica and a WIC one in Willemstad.
- These serve only very short-lives quest purposes and otherwise are "just there".
- Adding an office for each nation's main trading company would therefore make sense.
- These offices would then allow you to officially join one of these trading consortiums.

But what difference would this make in gameplay?
What advantages and disadvantages would this bring with it?
And how we would avoid players doing that AND being a privateer at the same time?
Should we even avoid that at all?


Here are some things that were mentioned before (plus some that just now spring to mind):

- Being a "professional trader" disables the "crew getting grumpy due to plenty money" feature.
The reason for that feature being there at all is to encourage players to switch to "Divide the Plunder" mode.
Yet this makes no sense for traders, only for pirates and privateers.
Plus as a trader you NEED a lot of money and being penalized for that doesn't help matters.
@Hylie Pistof knows all about that. :facepalm

- As professional trader, perhaps you would get enhanced profit margins at stores of friendly nations?

- Perhaps you need to pay a commission to the trading company and therefore see your profit reduced again?

- Alternatively, perhaps you are required to carry a certain amount of cargo per time period to retain your commission?


So that's it from my side. What do you guys think?
Would especially be valuably to hear from people who indeed do a lot of trading during regular play.
What would you like to see improved to make your trading more interesting and less annoying?
 
With all the different play styles being discussed, it is easy to skip over the most obvious one of them all.
But the game is called PIRATES of the Caribbean! And never has actual pirating been really encouraged in any way.

There are some storylines that have the player as a pirate, but officially joining the pirates is just about useless.
The only advantage is that it should be the only way to make the pirates actually friendly to you.
At the expense of all other nations instantly hating you.
Which is a pretty tough price to pay, since that basically makes the entire Caribbean a no-go area!

Not to mention that it is quite hard to join the pirates.
You need a certain Fame level, which you cannot easily accomplish.
In fact, you may need to do some privateering to even get there in the first place!

So there are two things to consider here:
1. When should the pirates accept you as one of them?
and
2. What advantages should there be to playing as a proper enemy to all nations? And how would this remain interesting?
In fact, how would you even survive at all without being able to make use of the resources that large towns provide?
 
Since this feature IS already in place but may not be working as intended or not in certain situations, I moved this to the "Bug Tracker".

A the moment, we need more information on exactly when this does/does not occur.
 
If you become a member of any of these trading compagnies we need to make sure it wont interfere with the jack sparrow storyline where you also do that.
I think Being a member of the trading compagny means:
- They will buy all cargo you bring for the normal price, even contraband cause they will resell it again.
- You can get food and rum and ammo very cheap from them to make sure your ship stays afloat.
- You get a discount at the local shipyard.
- You can get a convoy of a warship if you are doing a high value trade run
- You get assignements do deliver specific goods at places
- Maybe there should be some kind of ranks in it also which grand ships etc, just as with the gouvenor.

That's what I can think of right now what isn't to hard to implement cause most system are in place already.
 
All sound pretty good to me! I especially like how your suggestions sound quite doable too. :onya

Adding a ranking system here as well, you say? Perhaps we should end up adding different ranking systems for the various play styles?
We already noticed how Privateer and Navy ranks being used interchangeable basically makes no sense.
But how hard would it be to do this? Perhaps we should, for simplicity's sake, at least NOT make these extra ranks be nation-dependent.
So you get one set of nation-dependent Navy Ranks and Privateer, Merchant and Pirate ranks could be generic.

If you become a member of any of these trading compagnies we need to make sure it wont interfere with the jack sparrow storyline where you also do that.
True. Should not be too hard to sort that out, though.
In fact, we could take that instance as our starting point and actually build on that.
Make the Jack Sparrow storyline USE this new proposed functionality instead of requiring exceptions to it. ;)
 
I'd say we should have a set of rank for Pirvateer, Navy and Merchant yes. And depending on what playtype you are playing at the moment that rank should count.
I think we should have something like this:

A character has 3 attributes for the rank:
PChar.privateerrank
PChar.navyrank
PChar.merchantrank
And it has a attribute like:
PChar.currentplaytype

Then there is a function to get the rank, it checks which playtype you are atm and it takes the right rank accordingly.
We could then later expand on this and add a
PChar.currentnationrank

Where the nation of the rank is added (altough this could be added instantly already).
The function then could check a textfile where the ranks are stored and we make it work kind of like translation. It just looks for
ENGLAND_RANK_MERCHANT
or
HOLLAND_RANK_PRIVATEER

etc, so in those files we could then insert the names of the ranks.
The way it is programmed at the gouvernor is kinda sloppy but it works. Personally I would like to see something like this for the rewards.
We have a folder in the POTC folder called RANKS\REWARDS
in here there are different C files, for example PRIVATEER_HOLLAND_KAPITEIN, the game looks for the [playtype]_[nation]_[rank].c file and executes this when you promote. This way we could easily add stuff etc.

How do you like that @Pieter Boelen ? I could make those functions who look for the files etc and make a first set up for it. But implenting it in the different dialogs etc should be done by someone else cause I like to use my time on other things :p.
 
The only way we can making as a pirate be really attractive is if we penaltize players when they attack other ships (which they shouldn't attack) when playing as an other playstyle.
pirate playstyle should be unrestricted but also you wont get any bonus or help.
 
Indeed I was also thinking of moving the GivePromotionReward functionality into a different file.
That one is going to get pretty large soon and will only clutter NK.c .

You propose a separate file for each type, nation and rank, eh? That will be a lot of files! :shock

What is your proposed purpose of currentnationrank as opposed to the others? I'm a bit confused....
 
So any other player type attacking non-hostile ships?
I suppose any such action should technically turn you pirate.

There should perhaps also be the possibility of not following any play style at all.
For example if you just follow a storyline or make your money through treasure quests or something.
We can consider that some sort of "freebooter adventurer" type thing.
 
Back
Top