Indeed.several sources for the same information maybe isn't so bad?
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!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
Indeed.several sources for the same information maybe isn't so bad?
If you're giving the hint at the place where you're doing the selling, another possible source is the soldier who told you the best time to land. Either explicitly ("By the way, I can't stay long because they've got us running extra patrols these days") or by the length of time he says you can go. If it's 1 hour then patrol level is high, if it's 3 hours then patrol level is low, and if it's 12 hours then he's probably lying (I've already figured out that the last one seems to be the case).
Could that be the highest level, maybe? There are 4 patrol states, so there should be more options. I can have a look laterWhat is this 1 hour, 3 hour, 12 hour thing? For me it is 20 minutes.
RUNTIME ERROR - file: smuggling.c; line: 1386
missed attribute: island
RUNTIME ERROR - file: smuggling.c; line: 1386
no rAP data
RUNTIME ERROR - file: smuggling.c; line: 1386
invalid index -1 [size:24]
RUNTIME ERROR - file: smuggling.c; line: 1386
function 'FindCoastGuardLocator' stack error
RUNTIME ERROR - file: smuggling.c; line: 1433
Using reference variable without initializing
int getOpiumCaughtChance()
{
ref Pchar = GetMainCharacter();
if (GetAttribute(Pchar , "vcskip") == true) return 0;
if (GetAttribute(LoadedLocation, "vcskip") == true) return 0;
int chance = 100;
//Take difficulty into account:
chance = chance - (50-GetDifficulty()*10);
float mult = 1;
//Take smuggling perks into account:
if(CheckCharacterPerk(Pchar,"ImproveSmuggling")) mult = mult - 0.10;
if(CheckCharacterPerk(Pchar,"AdvanceSmuggling")) mult = mult - 0.15;
//At night you wont be detected that easy
if(!isDay())
{
mult = mult - 0.5;
} <<<<<< Line 1386 <<<<<<<<
chance = makeint(round(chance*mult));
return chance;
}
void UseOpium(ref User)
{
//Remove 1 opium
ref pchar = GetMainCharacter();
// TakeItemFromCharacter(User, "opium"); // PB: This is already handled elsewhere
//Lets check all effects
OpiumEffects(User);
//Set Opium Sickness
float sickness = 0.2;
if(CheckAttribute(pchar,"quest.opium_use.opiumsickness")) sickness = sickness + stf(User.quest.opium_use.opiumsickness);
User.quest.opium_use.opiumsickness = sickness; <<<<< Line 1433 <<<<<<<
//Remove the opium sickness in X days.
int opiumuses = 0;
if(CheckAttribute(pchar,"quest.opium_use.amount")) opiumuses = sti(pchar.quest.opium_use.amount);
opiumuses++;
int days = makeint(sickness*10/2);
pchar.quest.opium_use.amount = opiumuses;
string questname = "remove_opium_effect_"+opiumuses;
pchar.quest.opium_use.users.(questname).userid = User.id;
pchar.quest.(questname).win_condition.l1 = "Timer";
pchar.quest.(questname).win_condition.l1.date.day = GetAddingDataDay(0, 0, days);
pchar.quest.(questname).win_condition.l1.date.month = GetAddingDataMonth(0, 0, days);
pchar.quest.(questname).win_condition.l1.date.year = GetAddingDataYear(0, 0, days);
pchar.quest.(questname).win_condition = "remove_opium_effect";
}
SMUGGLING Stop event
Quest name Rand_SmugglingRemove FOUND in CommonQuestComplete
Quest name Made First Smuggling Report FOUND in SideQuestComplete
SMUGGLING load Coastguard patrol and pursuit
Oh boy, there goes my weekendError log on a line that has only a bracket?
Agh, those are the worst. Generally means there is an error somewhere, but the game code cannot figure out the actual location.
It might be somewhere else altogether.
string FindCoastGuardLocator(bool BySea)
{
aref reloads, reloadref;
int i;
if(BySea)
{
//By Sea
ref island = &Islands[FindIsland(loadedlocation.island)];
makearef(reloads,island.reload);
for(i=0;i<GetAttributesNum(reloads);i++)
{
reloadref = GetAttributeN(reloads,i);
if(reloadref.go == loadedlocation.id)
{
return reloadref.emerge;
}
}
}
else
{
//By Land
makearef(reloads,loadedlocation.reload);
for(i=0;i<GetAttributesNum(reloads);i++)
{
reloadref = GetAttributeN(reloads,i);
if(reloadref.label == "Jungle.")
{
return reloadref.name;
}
}
}
return "";
}
RUNTIME ERROR - file: smuggling.c; line: 1528
missed attribute: island
RUNTIME ERROR - file: smuggling.c; line: 1528
no rAP data
RUNTIME ERROR - file: smuggling.c; line: 1528
invalid index -1 [size:24]
RUNTIME ERROR - file: smuggling.c; line: 1528
function 'FindCoastGuardLocator' stack error
RUNTIME ERROR - file: smuggling.c; line: 1578
Using reference variable without initializing
string FindCoastGuardLocator(bool BySea)
{
aref reloads, reloadref;
int i;
if(BySea)
{
//By Sea
ref island = &Islands[FindIsland(loadedlocation.island)]; <<<<<< 1528 <<<<<<
makearef(reloads,island.reload);
for(i=0;i<GetAttributesNum(reloads);i++)
{
reloadref = GetAttributeN(reloads,i);
if(reloadref.go == loadedlocation.id)
{
return reloadref.emerge;
}
}
}
else
{
//By Land
makearef(reloads,loadedlocation.reload);
for(i=0;i<GetAttributesNum(reloads);i++)
{
reloadref = GetAttributeN(reloads,i);
if(reloadref.label == "Jungle.")
{
return reloadref.name;
}
}
}
return "";
}
void CreateCoastGuardPatrol()
{
ref PChar = GetMainCharacter();
ref sld;
if(DEBUG_SMUGGLING>1) trace("SMUGGLING load Coastguard patrol and pursuit");
//Levis add smuggling perk -->
float largegroup_chance = 100.0;
if(CheckCharacterPerk(Pchar,"ImproveSmuggling"))
{
largegroup_chance = largegroup_chance*0.5;
}
largegroup_chance = 100;
//<-- smuggling perk
string group = "reload";
string locator;
int fromseachance = 50;
if(CheckCharacterPerk(Pchar,"AdvanceSmuggling"))
{
fromseachance = fromseachance*0.5;
}
if(rand(100)<fromseachance)
{
locator = FindCoastGuardLocator(true); <<<<<< 1578 <<<<<<<
Pchar.quest.contraband.fromsea = true;
}
else
{
locator = FindCoastGuardLocator(false);
Pchar.quest.contraband.fromsea = false;
}
[continues]
-many more variables in calculating chance of officer succeeding in getting patrol times
-more variables for bad info, chance decreases exponentially with stats. ie you still got a large chance with low stats, but it decreases much faster. function also takes a character argument now, so officers got a separate chance from the player. choices!
-more ways to find out the patrol level of the island, eg thru tavern rumours
-more hints and explanations during dialog
-greatly(SRSLY) expanded smuggling book
-higher prices with higher patrol level
-new calculation for chance of getting caught (not entirely happy with it yet, it's still too linear, but I'm bad at math)
-maybe other things
I think there is an attribute you can use for that.pausing the event when in dialog is probably a good idea tho, if I figure out how to do it
Found it in LAI_events, but I didn't quite manage to translate it to my case it was under "bool LAi_Character_CanDialog(aref chr, aref by)" which seems to check if the character is available for talking? I realised rn that probably that returns false when character is in dialog as they can't initiate another.. but oh well, making a note for later I guessI think there is an attribute you can use for that.
Look in AICameras.c (I think) and search for my comment "don't bother me when I'm flying" (seriously! ).
void CheckCoastGuard()
{
ref PChar = GetMainCharacter();
if(PChar.location == PChar.quest.contraband.CurrentPlace)
{
float chance_get_caught = GetEventData();
if(Rand((100*SMUGGLING_TIME_CHANCE_MULT))<=chance_get_caught)
{
if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING Coastguard found you!");
Lai_QuestDelay("Rand_ContrabandInterruption",1.0);
StopCoastGuardCheck();
}
if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING caught chance is "+chance_get_caught+" in "+(100*SMUGGLING_TIME_CHANCE_MULT));
if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING Evaded the Coastguard (for now)");
}
if(dialogRun || dialogSelf){
SetEventHandler("PauseCoastGuardCheck","PauseCoastGuardCheck",1);
PostEvent("PauseCoastGuardCheck",5000,"f",chance_get_caught);
}
else PostEvent("CheckCoastGuard",5000,"f",chance_get_caught);
}
void PauseCoastGuardCheck()
{
if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING paused during conversation");
float chance_get_caught = GetEventData();
if(!dialogRun && !dialogSelf) PostEvent("CheckCoastGuard",5000,"f",chance_get_caught);
else PostEvent("PauseCoastGuardCheck",5000,"f",chance_get_caught);
}
I don't know what this meansFirst snag: that file uses a different character at the end of each line.
That makes a lot of sense, good call! gonna fix thatSecond problem: you have a 'switch(sti(sisland.smuggling_nation))' block which includes 'case AMERICA' and has the option to later include 'case SWEDEN'. As both of these are "guest nation 1", they both translate to number 6. If you include 'case SWEDEN', it will override the settings for 'case AMERICA' as they're effectively both the same. It's not a problem now as 'case SWEDEN' is commented out, but if you want to implement it, you'll perhaps need to check the current period. Use the settings for Sweden in "Spanish Main", "Golden Age of Piracy" and "Colonial Powers"; and use the settings for America in "Revolutions" and "Napoleonic".
no idea why that would happen! maybe I accidentally pushed something and it got saved some weird encoding, I dont even know what carriage is. I'll check and upload a new one in a few minutesIt means if I try to edit the file, it looks like this:
View attachment 31062
It also means WinMerge complains "These files use different carriage return types." I don't know why that happened this time because it hasn't happened with other files that you've uploaded.
It means if I try to edit the file, it looks like this:
View attachment 31062
It also means WinMerge complains "These files use different carriage return types." I don't know why that happened this time because it hasn't happened with other files that you've uploaded.
Definitely, in notepad++ I made formatting characters visible and all line breaks had become LF, and in all other files they were CFLF. I suspect I accidentally changed encoding to UTF-8, that seemed to have that effect.. but I'm not sure. shouldn't be a problem now at leastCarriage return is the character which marks the end of a line. In some systems it's ASCII 10, in some it's ASCII 13, and in some it's both of those.
Looking at the older version of "smuggling.c", and at another random .c file, using Hex Editor, it seems the files normally end their lines with both 13 and 10. Your new version ends lines with just 10.