• 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 Revamped Smuggling [3.3 compatible]

Seems there was a little bug in the code for showing books. if you wanted to open another book without special stuff it crashed
this should fix it:


btw I eneabled some logging functions in this release incase there are problems. These can be disabled by setting the debug variable lower in smuggling.c. But you wont notice it, its only placed in the compile.log
 
Oh I also improved the schedule making a little bit, so it looks nicer (a bit more randomization).
Looking forward to feedback.
 
How ready is this for inclusion in Beta 3.3? Did you manage to do anything with the double Coffee issue, for example?
I am really tempted to include this. But perhaps I should hold off for a little bit longer.... :oops:
 
I can fix the double coffee issue.
in the first post it says what I still wanna do.
I should be able to get this done in 1 day, but I first wanna try to get the fetch quest back now.
january 2 I should have time again to work (in the meantime I might be able to do some small bugfixes). so let me see how easy the fetchquest is to get back and then I will try this.
I'm also a bit tempted ;), it could be included now if I only fix the double coffee bug. a very easy fix would be to remove coffee as contraband for the british or change it on the island so it wont be import export. but I wanna try to write a function which checks the import and export and prevents the contraband from being set if the good is already in import or export.

hmmm...I think I know a "good" way to do it. I think I can fix the problem within an hour, so expect to have an update for this somewhere round friday. then we can include it if you ask me. Altough I prefer at least to have some people test this, so if you include this version already in the internal update so people test it we can see if there are any problems. the double coffee I will then fix. and for 3.4 more features will be added to this.
 
The coffee thing might as well occur for another good next time. So a global prevention would probably be best there.
 
This should make sure no goods are something else also.
For now I placed the functions in smuggling.c when I'm going to revamp the trading it will be moved.

Also I saw a perk image was wrong (the locked smuggling perk) so this has the right locked images for the new introduced perks.

Also I noticed 2 perks which should be unlocked where still locked so fixed now.

Also the locked description for the perk was wrong so this is fixed to.

@Pieter Boelen imo this is good enough to get included altough I prefer to have the option on deck at least so you can wait. But that shouldn't take to long to make also so I should be able to squeze it in somewhere this week.
 

Attachments

  • SMUGGLER_STUFF_2_6.zip
    324 KB · Views: 90
Last edited:
altough I prefer to have the option on deck at least so you can wait. But that shouldn't take to long to make also so I should be able to squeze it in somewhere this week.
Indeed that should not be too hard. Perhaps you can adapt this code from KR_crewmember.c:
Code:
    case "wait_time":
       d.Text = DLG_TEXT[0];
       Link.l1 = DLG_TEXT[1];
       Link.l1.go = "wait_1";
       Link.l2 = DLG_TEXT[2];
       Link.l2.go = "wait_2";
       Link.l3 = DLG_TEXT[24];
       Link.l3.go = "wait_3";
       Link.l4 = DLG_TEXT[25];
       Link.l4.go = "wait_4";
       Link.l5 = DLG_TEXT[3];
       Link.l5.go = "exit";
     break;

     case "wait_1":
       Diag.CurrentNode = Diag.TempNode;
       NPChar.quest.meeting = NPC_Meeting;
       DialogExit();
       WaitDate("", 0,0,1,0,0);
       Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You wait here") + " " + XI_ConvertString("1 day") + " " + LanguageConvertString(tmpLangFileID,"for ship repairs") + ".");
     break;

     case "wait_2":
       Diag.CurrentNode = Diag.TempNode;
       NPChar.quest.meeting = NPC_Meeting;
       DialogExit();
       for(i = 0; i < 5; i++)
       {
         WaitDate("", 0,0,1,0,0);
       }
       Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You wait here") + " " + XI_ConvertString("5 days") + " " + LanguageConvertString(tmpLangFileID,"for ship repairs") + ".");
     break;
     
     case "wait_3":
       Diag.CurrentNode = Diag.TempNode;
       NPChar.quest.meeting = NPC_Meeting;
       DialogExit();
       for(i = 0; i < 10; i++)
       {
         WaitDate("", 0,0,1,0,0);
       }
       Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You wait here") + " " + XI_ConvertString("10 days") + " " + LanguageConvertString(tmpLangFileID,"for ship repairs") + ".");
     break;

     case "wait_4":
       Diag.CurrentNode = Diag.TempNode;
       NPChar.quest.meeting = NPC_Meeting;
       DialogExit();
       for(i = 0; i < 30; i++)
       {
         WaitDate("", 0,0,1,0,0);
       }
       Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You wait here") + " " + XI_ConvertString("all a month") + " " + LanguageConvertString(tmpLangFileID,"for ship repairs") + ".");
     break;
You'd just need to adjust it to hours instead of days and don't need the for loops.

Or adapt this from permanent_crewmember_dialog.c:
Code:
    case "camp_day":
       Dialog.text = DLG_TEXT[10];
       link.l1 = DLG_TEXT[11];
       link.l1.go = "camp_day_wait";
       link.l2 = DLG_TEXT[12];
       link.l2.go = "exit";
     break;

     case "camp_night":
       Dialog.text = DLG_TEXT[10];
       link.l1 = DLG_TEXT[13];
       link.l1.go = "camp_night_wait";
       link.l2 = DLG_TEXT[12];
       link.l2.go = "exit";
     break;

     case "camp_night_wait":
       DialogExit();
       TavernWaitDate("wait_night");
       PlaySound("objects\abordage\abordage_loosing.wav");
       Whr_UpdateWeather(false);

     break;

     case "camp_day_wait":
       DialogExit();
       TavernWaitDate("wait_day");
       PlaySound("NATURE\cricket.wav");
       PlaySound("NATURE\fireplace1.wav");
       PlaySound("AMBIENT\town\cough.wav");
       PlaySound("AMBIENT\tavern\man1.wav");
       PlaySound("AMBIENT\tavern\open_bottle.wav");
       Whr_UpdateWeather(false);
     break;
 
What are all the calendar.c negative values checks for?
And is it correct that this line is being removed?
Code:
  while(GetMonthDays(curMonth, curYear)<nextDay) // KK
   {
     nextDay = nextDay - GetMonthDays(curMonth, curYear); // KK
     curMonth++; // <---------------- THIS LINE
   }
Anyway, I'm adding this to my game now for testing.

And you're right that I definitely need to post a new installer. You are a bit behind on some of the latest updates.... :oops:
 
Yes that is correct. The reason is so I can calculate a time in the past also, its for the init so I can set some historical values.
 
You need to have this version of the game installed first:
http://www.piratesahoy.net/threads/simplified-build-14-beta-3-3-wip-code.23064/

Now here are some improvements again:
- Smuggle quests are now in the questbook
- When a island changes its patrolling schedule this will show up in the town news
- You can talk to the crew members on deck to wait for 1,3 or 8 hours.
- When taking a smuggling quest the smuggler will warn you for the coast guard
- If you dont have the patrolling book there is another way to get it. I sugest talking to guards who are off duty ;).

Some info about the guard chat (spoilers!) I sugest you first try it out yourself before looking at this ;).
If you talk to the guard when a quest is active you can get the info from him. You will try to trick him into believing you want to ask a girl to the beach. This will only work if you actually "slept" with her before. The girl we are talking about is the waiter. This ties into the extra atmosphere mod I made before ;), if you talk a few times with here you can go with her. After that you can trick the guard to tell you the schedule.
Ofcoure you can still get the schedule without sleeping with here. You just need to bribe him then. The amount you need to pay will go up with your level tough...

@Pieter Boelen I've tested this a few times already and I can't find problems with it. But please include it asap so others can test it too. I think these dialog things will explain to the people what is happening and why smuggling can go better or worse at times. I will probally add a few more ways to get the schedule later but this is a start. Maybe I should add a dialog option for the tavern keeper to give you a hint to ask a guard, but I think it's obvious enough isn't it ... ?
 

Attachments

  • SMUGGLER_STUFF_NEW_1_0.zip
    61.7 KB · Views: 109
Last edited:
No you can always do it. You need to ask for information first. then you can ask the time. If he tells you the time you can wait.
It only works for crew members on deck (the ones who also give sword training).
 
Sounds like some awesome work, @Levis! Looking forward to seeing it in action. :cheeky

Some info about the guard chat (spoilers!) I sugest you first try it out yourself before looking at this ;).
If you talk to the guard when a quest is active you can get the info from him. You will try to trick him into believing you want to ask a girl to the beach. This will only work if you actually "slept" with her before. The girl we are talking about is the waiter. This ties into the extra atmosphere mod I made before ;), if you talk a few times with here you can go with her. After that you can trick the guard to tell you the schedule.
Ofcoure you can still get the schedule without sleeping with here. You just need to bribe him then. The amount you need to pay will go up with your level tough...
Comments in spoiler too:
I'm not entirely convinced I would want to encourage players to make use of that option. Especially with characters who aren't hookers.
While I know such things are historically accurate and I am (sort of) OK with the brothels being in the game, I've got to admit my heart isn't quite in it.
Especially not after having seen such things in real life when I was in the Philippines.

Is there any way to make it seem genuine enough to not be creepy/disturbing or make it so funny that you can't take it seriously?
 
Sounds like some awesome work, @Levis! Looking forward to seeing it in action. :cheeky

Comments in spoiler too:
I'm not entirely convinced I would want to encourage players to make use of that option. Especially with characters who aren't hookers.
While I know such things are historically accurate and I am (sort of) OK with the brothels being in the game, I've got to admit my heart isn't quite in it.
Especially not after having seen such things in real life when I was in the Philippines.

Is there any way to make it seem genuine enough to not be creepy/disturbing or make it so funny that you can't take it seriously?

The option to "sleep" with the waiter was already in the stock game I believe. the only thing it does now is detect if you did it or not.
Read the dialogs or try it yourself and I think you will see I made it funny enough (at least I think), at least its not taken seriously.
 
Having read through the actual dialogs, perhaps it isn't quite that bad and I am making more of a fuss than need be.
Thought the point should be at least mentioned, but I'll leave it up to your judgement in the end. :doff
 
Having read through the actual dialogs, perhaps it isn't quite that bad and I am making more of a fuss than need be.
Thought the point should be at least mentioned, but I'll leave it up to your judgement in the end. :doff
I think its fine like this. And like I said I want to introduce some other ways also, but I like it you first need to have done something before you can convince the guard to give the info.
I was thinking to also have a guard play you a game of poker for the info for example.
 
A card game would play well into your changes and improvements to the gambling interface.
Also it is a more familiar method of moving the story along for players, since there is also the Girl Won in a Card Game quest.
I definitely agree that getting the player to actually DO something for the information is a good idea. :yes
 
- Only towns with the same nation as the island will contribute in the coastguard (hence the probally in the line above).
This seems to be causing some issues in Early Explorers (Devlin Opera) since a whole bunch of islands are Spanish there, yet do not have active towns on them at all.

Edit:
Some more details:
Code:
SMUGGLING check ERROR: Aruba town # = 1:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Aruba town # = 2:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Aruba town # = 3:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Curacao town # = 1:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Curacao town # = 2:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Curacao town # = 3:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Curacao town # = 4:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Curacao town # = 5:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Curacao town # = 6:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 1:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 10:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 2:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 3:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 4:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 5:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 6:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 7:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 8:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: Guadeloupe town # = 9:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 1:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 10:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 2:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 3:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 4:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 5:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 6:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 7:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 8:  nation = NONE! Smuggling nation = Spain
SMUGGLING check ERROR: SaintMartin town # = 9:  nation = NONE! Smuggling nation = Spain
Why does the game end up checking 10 towns on islands that have no towns whatsoever? o_O
 
Last edited:
Suggest these changes to fix the above:
Code:
int getIslandCoastGuardNum(ref sisland)
{
   // This function returns the amount of guards on coast guard patrol (in total)
   if(DEBUG_SMUGGLING>2) trace("SMUGGLING get amount of coast guard");
   int townnum = GetIslandTownsQuantity(sisland.id);
   int troops = 0;
   int town_troops = 0;
   int percentage_on_coast_guard = 0;
   //Check all towns on the island
   for(int i = 1; i <= townnum; i++)
   {
     string townid = GetTownIDFromIsland(sisland.id, i);
     ref stown = GetTownFromID(townid);
     //Only towns which have the same nation contribute in the coast guard
     if(CheckAttribute(stown, "nation") && stown.nation == sisland.smuggling_nation)
     {
       //Depending on the state of the island there are more or less in the coastguard
       percentage_on_coast_guard = getIslandSmugglingState(sisland)*5;
       town_troops = (sti(stown.troops)*(percentage_on_coast_guard/100.0));
       troops = troops + town_troops;
       if(DEBUG_SMUGGLING>2) trace("SMUGGLING check town: "+townid+" town nation: "+GetNationNameByType(makeint(stown.nation))+" percentage of troops taken: "+percentage_on_coast_guard+" amount of guards: "+town_troops);
     }
   }
   return troops;
}
Also, the call to InitIslandSmuggling() should be moved from InitGame() into NewGame_continue() .
That way it actually uses the period-correct town and island nationalities. Otherwise it uses the default values. :facepalm
 
Back
Top