• 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 How not to be a pirate - tutorial on relations

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
Having captured a Spanish ship as part of my "Ardent" storyline, I got the questbook entry about the tutorial on relations, warning that capturing ships could affect relations. Presumably I'm supposed to then visit a governor and get the book which tells me how to avoid becoming a pirate.

How Not To Be A Pirate:
1. Don't start the game as a pirate. xD

Perhaps if you start as a pirate, whether by picking a storyline which casts you as a pirate or by picking free-play and choosing to be a pirate, the tutorial should be skipped? Capturing the Spanish ship (and subsequently someone else's merchant which wasn't part of the storyline, just part of being a pirate) didn't have much effect on relations as all nations already hate me anyway. :rpirate
 
:rofl @Grey Roger!

Indeed logically if you start the game as a pirate, you ARE a pirate with Served Nation PIRATE.
On account of starting the game as a pirate. ;)

I deliberately wrote the Nations Relations Tutorial so that it should get triggered regardless of how you start the game.
Even if you ARE a pirate, you might as well end up knowing what exactly makes a pirate, right?
If I recall, I ensured the wording would suggest that you could also become a pirate on purpose ("If I so choose, that is...." is in there somewhere, no?).

When starting the game as a pirate, a player might want to later get amnesty from one of the nations and become a privateer instead.
In that case, they would definitely need to know.

Which part seems inappropriate to you?
 
I deliberately wrote the Nations Relations Tutorial so that it should get triggered regardless of how you start the game.
Even if you ARE a pirate, you might as well end up knowing what exactly makes a pirate, right?
If I recall, I ensured the wording would suggest that you could also become a pirate on purpose ("If I so choose, that is...." is in there somewhere, no?).
Yes, in the bit after you've visited a governor and got the book:
I have received a book containing various details about nation relations. That should help me avoid being branded a pirate. If I so choose, that is...
Of course, a pirate who doesn't care much about international relations due to having started out as a pirate hated by all nations probably won't be much interested in the book...

Which part seems inappropriate to you?
It seems my last action at sea has met with some important consequences.
Well, yes - it's the conclusion to one of the storyline quests. Apart from that, no - Spain already hated me and still does.
As I do not want to make enemies by accident, I had better find out how to deal with the various nations I will encounter at sea.
They're already all enemies.
Perhaps I can convince one of the towns' governors to provide me with some advice.
By paying lots of money for an amnesty. Though I do like the idea of pirating lots of Spanish ships to get the money, then asking the Spanish for an amnesty and using their own money to pay for it. :rpirate
In the meantime, I may want to tread more carefully.
True, though that has absolutely nothing to do with relations and more to do with how you go about tackling another quest which has been foreshadowed already but is currently nowhere near completely written... Any pirate other than Ardent can probably ignore that bit entirely. :g2
 
Of course, a pirate who doesn't care much about international relations due to having started out as a pirate hated by all nations probably won't be much interested in the book...
True. But even pirates should at least know that the explanatory book exists and how to get it.
If they then don't, that is their own choice. Nobody is enforcing it.

Well, yes - it's the conclusion to one of the storyline quests. Apart from that, no - Spain already hated me and still does.
Indeed then the "some important consequences" doesn't quite apply. Maybe that should be made more generic to become "consequences".
But then I'm afraid when those consequences ARE important, people won't care.
Maybe that particular questbook update could indeed be skipped if there ARE no consequences.
Relevant section is UpdateRMRelation in PROGRAM\NATIONS\nations.c .

They're already all enemies.
That is why I mentioned the "As I do not want to make enemies by accident". If you're a pirate, then you'd be doing it on purpose. ;)

By paying lots of money for an amnesty.
If I recall, the governors should give you the book even if they're of a hostile nation.
They (read: I) figure that it does no harm and if you're aware, maybe you'll realise they can better buy amnesty and serve them.
Of course that decision still lies fully with the player.

True, though that has absolutely nothing to do with relations and more to do with how you go about tackling another quest which has been foreshadowed already but is currently nowhere near completely written... Any pirate other than Ardent can probably ignore that bit entirely. :g2
Treading carefully is always good advice, no? Though indeed it doesn't apply very much to deliberate pirates.

Once I add the "kill everyone>no consequences" logic, then this becomes more relevant.
Then "treading carefully" as a pirate means "leaving as few survivors as possible". Bit evil, but... pirate! :wp

Of course that will also require a situation where "more hostile = worse". At the moment it doesn't matter if you're at -60 or at -119.
But eventually, I imagine that it should. So once you drop below -100 or so, you'll get chased or get Hitmen sent after you or something.

That is all still hypothetical though.
 
Perhaps have a different tutorial book for pirates, or at least for those who have started out as pirates? Try this. There's already a book for sale, "Pirating with Petros", so maybe this could be its text...
 

Attachments

  • pirating_book.txt
    2 KB · Views: 206
Perhaps have a different tutorial book for pirates, or at least for those who have started out as pirates? Try this. There's already a book for sale, "Pirating with Petros", so maybe this could be its text...
Adding texts to books should be easy enough. Just add a line like for some of the other books in initItems.c .

But having some text in a book doesn't serve as a "tutorial" unless players are actively made aware of its existence.

If you'd like to make more sensible behaviour for explaining the pirate relations, I'd very much welcome you to do so!
The code related to it is fairly straightforward and I think you would be quite capable to make changes to it. :onya
 
If you'd like to make more sensible behaviour for explaining the pirate relations, I'd very much welcome you to do so!
I thought that's what I'd just done. ;)
The code related to it is fairly straightforward and I think you would be quite capable to make changes to it. :onya
Any serious code time I have goes on "Ardent". Besides, I'm very reluctant to do anything to main game files in case I end up breaking something which will affect other people's games outside that storyline.
 
I thought that's what I'd just done. ;)
You added text to a book. But to make it a tutorial, players need to be made aware that the book exists. Otherwise it is in theory in the game, but virtually invisible.
The current Nations Relations Tutorial takes care of that for most situations, but you aren't happy with how that fits with pirate players.
So some tweaks would need to be made to that.

I myself have got much bigger fish to fry (dealing with getting Beta 4 functional and ready for release!),
so would prefer to not also have to do fine-tuning work on a system that is technically operational.

The relevant files are:
- PROGRAM\Characters\characters_init.c where the tutorial gets set for the first time
- PROGRAM\NATIONS\nations.c in the UpdateRMRelation function where it shows again based on consequences from sea battles
- PROGRAM\QUESTS\quests_common.c where the related quest cases are
- RESOURCE\INI\TEXTS\English\QUESTBOOK\Relations_Tutorial.txt for the actual questbook text
- PROGRAM\SEA_AI\AIShip.c in case I had any extra relations notes being triggered by certain on-sea actions (I cannot remember now if that was the case....)
- PROGRAM\DIALOGS\governor.c is where the governors give the relation book (you probably don't need to change this)

I think that is pretty much all of it. It is only a small amount of code and should be fairly simple and straightforward.
As usual, I wrote this from memory so there may be some slight inaccuracies in my above description.
Simplest is to search for the relevant questbook text file name and the quest case names and see where those are references.

Besides, I'm very reluctant to do anything to main game files in case I end up breaking something which will affect other people's games outside that storyline.
That shouldn't be a huge concern. For starters, you can see if you can find all the relevant code and just have a look at that.
And before adding new stuff to the main game files, I always WinMerge them myself to reduce the chance for unintended consequences.
 
@Grey Roger: Were you able to make any sense of the above? Do you need more details?

Or are you fine with just having your text as a readable book and leaving the regular nations relations tutorial as-is for pirates as well?
While the wording may seem a bit odd, the given information itself isn't technically untrue. So I suppose there isn't really any harm in keeping it like it is.

The main query is that players would be unlikely to know that "Pirating with Petros" has extra text in it to help them out.
Maybe an extremely simple solution could be to just give that book for free to players who decide to join the Brotherhood.
That would require only a tiny amount of code changes.
 
I knocked up the pirate book text in a bit of spare time in the hope that someone could make some use of it. But I'm still reluctant to even alter one main game file, let alone six of them! It would make sense for pirates to get the pirate manual and everyone else to get the normal tutorial, though if it's easier to simply leave the standard tutorial for everyone and have the extra manual for pirates specifically, so be it. (If I do try to alter the game files, I'm going to arrange that navy and privateer get the tutorial as currently seen, merchants get a shorter version which basically says "you're a peaceful merchant so you're not allowed to attack anything", and pirates get the pirate book. )

The idea of giving the pirate manual free when you join the Brotherhood makes sense. Maybe also make it available for looting from chests or for sale from sneaky traders so pirates who haven't joined the Brotherhood have a chance of getting it. (And maybe encourage those who aren't already pirates to become pirates. :rpirate)
 
I'd suggest you at least have a look at the current code and see if any sensible changes spring to mind.
There is nothing wrong with you changing main game files.
In fact, since you've got plenty good ideas, I'd very much welcome you to join in their implementation.

My personal priority is to get stuff functional, with the least possible time and effort spent on my part.
Having your support on the fine tuning of this would be really quite valuable.
 
The relevant files are:
- PROGRAM\Characters\characters_init.c where the tutorial gets set for the first time
- PROGRAM\NATIONS\nations.c in the UpdateRMRelation function where it shows again based on consequences from sea battles
- PROGRAM\QUESTS\quests_common.c where the related quest cases are
- RESOURCE\INI\TEXTS\English\QUESTBOOK\Relations_Tutorial.txt for the actual questbook text
- PROGRAM\SEA_AI\AIShip.c in case I had any extra relations notes being triggered by certain on-sea actions (I cannot remember now if that was the case....)
- PROGRAM\DIALOGS\governor.c is where the governors give the relation book (you probably don't need to change this)
And RESOURCE\INI\TEXTS\ENGLISH\ItemsDescribe.txt which gives things a more friendly entry in the inventory than "itmname_piratebook". ;)

OK, try this, but be warned, it's completely untested! I've tried to arrange that the newly defined pirate book, alias "Under The Jolly Roger", will be available from treasure chests and sneaky traders. There's not much point in including advice to go and join the Brotherhood if the only way to get the book is to go and join the Brotherhood. :facepalm

Next: if this actually works, and if someone who knows about merchanting can write up a similar book, I can try to arrange for merchants to have their own separate tutorial as well. After all, they don't need to know the intricacies of international relations, all they need to know about attacking ships is that they're not allowed to do it! What they can get is a hint about the merchant licences and possibly a reference to smuggling, though that's covered in more detail in @Levis' books.
 

Attachments

  • pirate_tutorial.zip
    133.8 KB · Views: 224
OK, try this, but be warned, it's completely untested!
Thanks very much! I'll install that in my game very soon. :woot

Next: if this actually works, and if someone who knows about merchanting can write up a similar book, I can try to arrange for merchants to have their own separate tutorial as well.
At the moment "merchanting" is still quite underdeveloped. The only thing "special" about it is the Merchant License you can buy.
When you have it, you always buy/sell for maximum profit regardless of your skills and abilities.
And if you have a LoM as well, the License will prevent crew morale from deteriorating if you've got plenty money.
You lose your license when you get into any piracy.

Eventually I'd like to see that expanded. But that won't happen until after Beta 4 is released.
 
It didn't. I'd made a stupid typo in "nations.c". :oops: Line 776, 'if (GetServedNation() = PIRATE)', should of course be 'if (GetServedNation() == PIRATE)'. As it is, the game refuses to start. With that line corrected, it seems to work, at least as far as generating the questbook entry - I haven't managed to find a pirate book yet to verify that the quest completes properly.

The next thing I'm planning to do is set timers in both 'case "relationbook"' and 'case "piratebook"' so that they both expire after a month and don't stay in your questbook permanently until you find the relevant book.
 
It didn't. I'd made a stupid typo in "nations.c". :oops: Line 776, 'if (GetServedNation() = PIRATE)', should of course be 'if (GetServedNation() == PIRATE)'. As it is, the game refuses to start.
I already caught and fixed that. Didn't mention it on the forum, because it was already sorted. ;)

With that line corrected, it seems to work, at least as far as generating the questbook entry - I haven't managed to find a pirate book yet to verify that the quest completes properly.
:onya

The next thing I'm planning to do is set timers in both 'case "relationbook"' and 'case "piratebook"' so that they both expire after a month and don't stay in your questbook permanently until you find the relevant book.
Interesting! Maybe something like that might be appropriate for the regular tutorial too? :cheers
 
I already caught and fixed that. Didn't mention it on the forum, because it was already sorted. ;)
It might be already sorted in the new 7-Zip archive but not everyone will see that, and anyone who installs what I uploaded earlier in this thread is going to have trouble.
Interesting! Maybe something like that might be appropriate for the regular tutorial too? :cheers
Which is why I said:
both 'case "relationbook"' and 'case "piratebook"'
;)
As it's approved, I'll see what I can do.
 
Updated "nations.c" with typo corrected - tested, now works.
Updated "quests_common.c" with expiry timers added - not tested, use at your own risk!
 

Attachments

  • nations.c
    60.7 KB · Views: 224
  • quests_common.c
    216.2 KB · Views: 261
Which is why I said:
Sorry.... missed that. :oops:

As it's approved, I'll see what I can do.
Thanks! :cheers

Updated "quests_common.c" with expiry timers added - not tested, use at your own risk!
What is beginning players deliberately keep out of sea battles for a substantial amount of time until after the timers are expired.
Would they then accidentally skip the tutorial altogether?
Just asking the quesion; I don't actually have time to look at your code.
 
What is beginning players deliberately keep out of sea battles for a substantial amount of time until after the timers are expired.
Would they then accidentally skip the tutorial altogether?
Just asking the quesion; I don't actually have time to look at your code.
Here's how the relationbook section looks now:
Code:
    case "relationbook":
       SetQuestHeader("relations_book");
       AddQuestRecord("relations_book", 1);
       if (HasMerchantPassport(PChar)) AddQuestRecord("relations_book", 2);
       PChar.quest.relation_tutorial = 1;
       PChar.quest.relationbook_timeout.win_condition.l1 = "Timer";
       PChar.quest.relationbook_timeout.win_condition.l1.date.day = GetAddingDataDay(0, 1, 0);
       PChar.quest.relationbook_timeout.win_condition.l1.date.month = GetAddingDataMonth(0, 1, 0);
       PChar.quest.relationbook_timeout.win_condition.l1.date.year = GetAddingDataYear(0, 1, 0);
       PChar.quest.relationbook_timeout.win_condition = "relationbook_timeout";
     break;

     case "relationbook_timeout":
       CloseQuestHeader("relations_book");
       DeleteQuestHeader("relations_book");
       PChar.quest.Got_Relation_Book.over = "yes";
     break;

     case "Got_Relation_Book":
       if (!CheckActiveQuest("relations_book")) SetQuestHeader("relations_book");
       AddQuestRecord("relations_book", 3);
       PChar.quest.relation_tutorial = 1;
       PChar.quest.relationbook_timeout.over = "yes";
     break;
The piratebook section is similar but refers to "pirate" instead of "relation" or "relations".

I thought these tutorials were only activated when you sink a ship? So you can't keep out of battle to wait for the timers to expire because they only start after a battle.

But I had to make a slight change, cancelling the timer if you get the book to complete the tutorial. So once you've received the initial message and questbook entry, the timer starts. If you ignore the message then one month later it disappears. If you go after the book and complete the tutorial then it should stay. I've put the updated version place of the old version in post 18. If you already downloaded "quests_common.c", please download it again.
 
Back
Top