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

Fixed Kralendijk women from stranger things might cause problems as opium buyers.

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
She is a special case. She's sort-of "half" a quest character, because she's also a sort-of regular citizen.
Quest characters don't change their name if a town is owned by a different nation in a different period.
Because Kralendijk is Spanish in Early Explorers, we deliberately REMOVED that attribute from those three towngirls.
So the game doesn't consider her to be a "quest character".

I'm not sure what is the best solution there....
As far as I can tell, once she has been placed, she remains there for the entire game and never is removed again.
No harm in it then?
@Grey Roger: Did you not say today that the Strange Things ladies at Bonaire leave once the quest has completed?
If so, there is a slight chance that this WILL be an issue now.

I'm not quite sure of the best approach to prevent that.... I don't want to add the "questch" attribute since that was removed from them on purpose.
 
@Grey Roger: Did you not say today that the Strange Things ladies at Bonaire leave once the quest has completed?
If so, there is a slight chance that this WILL be an issue now.

I'm not quite sure of the best approach to prevent that.... I don't want to add the "questch" attribute since that was removed from them on purpose.
well a very simple solution is just to place those characters in one of the houses or something like that. Or just don't remove them.
 
The women who stand outside Kralendijk town hall during "Strange Things Going On" do indeed disappear when you talk to them at the end of the quest.

A better solution would be to use someone who isn't involved with an existing side quest. That way the opium smuggling doesn't interfere with any side quest. The same problem will apply, though, and not just in Kralendijk. If the character is marked as a "questch" then that character will have the wrong name in any period in which the town belongs to a different nation. Kralendijk isn't the only one which changes hands, and not all the changes are limited to "Early Explorers".
 
The women who stand outside Kralendijk town hall during "Strange Things Going On" do indeed disappear when you talk to them at the end of the quest.

A better solution would be to use someone who isn't involved with an existing side quest. That way the opium smuggling doesn't interfere with any side quest. The same problem will apply, though, and not just in Kralendijk. If the character is marked as a "questch" then that character will have the wrong name in any period in which the town belongs to a different nation. Kralendijk isn't the only one which changes hands, and not all the changes are limited to "Early Explorers".
If you know a way to determine if a character is not in any quest...
 
If you know a way to determine if a character is not in any quest...
Normally checking the "questch" attribute is OK for that.
Problem is that ALSO stops those characters being renamed if the town belongs to a different nation in another period.
In the case of those three ladies, that is not wanted (if Bonaire is Spanish, they should be too).

We could add a separate attribute for "exclude from opium" and add that to whichever characters we think should be skipped.
Then we can add that to those three ladies and that's the end of it.

With a choice from hundreds of characters in the game, the chance of these specific ones being chosen is quite small.
But it still happens, as @Talisman noticed.
 
Normally checking the "questch" attribute is OK for that.
Problem is that ALSO stops those characters being renamed if the town belongs to a different nation in another period.
In the case of those three ladies, that is not wanted (if Bonaire is Spanish, they should be too).

We could add a separate attribute for "exclude from opium" and add that to whichever characters we think should be skipped.
Then we can add that to those three ladies and that's the end of it.

With a choice from hundreds of characters in the game, the chance of these specific ones being chosen is quite small.
But it still happens, as @Talisman noticed.
I would actually sugest to DO give the the questch attribute but we should add an attribute where a questch still can get a name depending on the country.
Something like questch.changename = true;
The value is default false, so normally it isn't change (as it is now) but you can set it for a character so the names do get changed.

That sounds more logical to me and shouldn't be that hard right?
 
Use Windows Search. Get the whole PoTC folder indexed, then Search can look for your choice of word or phrase inside all the files of that folder. For example, I've got the folder indexed, so typing "Rian Dekkers" into Search (with quote marks, so it looks for that specific phrase) shows that "Rian Dekkers" appears in "PROGRAM\QUESTS\quests_side.c", "PROGRAM\Characters\init\SideQuest.c" and "PROGRAM\Storyline\JackSparrow\StartStoryline.c". That last one removes all three women from Kralendijk town hall as "Hoist The Colours" apparently has its own version of the side quest, which incidentally means if you're relying on Rian Dekkers for the opium smuggling then Jack Sparrow might not be able to do it.

Of course, there's an even easier way to have a character who is not in any quest. Define your own character. ;)
 
I would actually sugest to DO give the the questch attribute but we should add an attribute where a questch still can get a name depending on the country.
Something like questch.changename = true;
The value is default false, so normally it isn't change (as it is now) but you can set it for a character so the names do get changed.

That sounds more logical to me and shouldn't be that hard right?
I think both solutions are quite equivalent. Whichever one is chosen should be OK, I imagine.

"PROGRAM\Storyline\JackSparrow\StartStoryline.c". That last one removes all three women from Kralendijk town hall as "Hoist The Colours" apparently has its own version of the side quest, which incidentally means if you're relying on Rian Dekkers for the opium smuggling then Jack Sparrow might not be able to do it.
Good catch! Those should indeed better be fully excluded then.

They are removed in Jack Sparrow because the Strange Things version there doesn't make use of those ladies.

Of course, there's an even easier way to have a character who is not in any quest. Define your own character. ;)
The fancy (and complicated and risky) thing with the Opium Smuggling is that randomly existing characters are chosen.
That way it is different every time you start a New Game and you will probably end up travelling all over the Caribbean.
 
That's the whole idea indeed.
The script checks if a character is placed somewhere. So if those ladies are removed in hoist the colors they shouldn't be picked by the script.
 
Where does the script look for characters, and when? If it's searching "PROGRAM\Characters\init\SideQuest.c" (which it must be if it's picking up the Kralendijk ladies) then it could get into all sorts of trouble if it picks on any of the other side quest characters at a time when they're active. I can imagine Angelique Moulin causing similar problems to Rian Dekkers, for example.
 
it runs in runtime so it can't check folders etc.
this is how it works:
Code:
void GetSmugglingGuildMembers(int NumMembers, string Category, string Dialog)
{
    int chosen = 0;
    int chridx = 0;
    ref pchar = GetMainCharacter();
    if(DEBUG_SMUGGLING>0) trace("SMUGGLING GUILD MEMBERS: Start picking "+NumMembers+" new members for the guild");
    string index = "";
    string sLocName = "";
    string sIslandName = "";

    while (chosen < NumMembers) {
        chridx = rand(MAX_CHARACTERS);
        ref chr = GetCharacter(chridx);

        if (GetAttribute(chr, "id") == "0" || GetAttribute(chr, "id") == "-1")    continue; // PB: Invalid character, no point checking further
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS Character index: " + chridx + ", name = " + GetMySimpleName(chr) + " (" + chr.id + ")");
      
        if (bAllies(chr))                                                        continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass player party check");
      
        if (CheckAttribute(chr,"Dialog.Filename.SmugglingGuild"))                continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass guildmember already check");

        if (CharacterIsDead(chr))                                                continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass still alive");

        sLocName = GetAttribute(chr,"location");
        if (sLocName == "-1" || sLocName == "" || sLocName == "none")            continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass location");
      
        sIslandName = FindIslandByLocation(sLocName);
        if (sIslandName == "")                                                    continue;
        if (sIslandName == sLocName)                                            continue; // This avoids captains at sea and fort commanders
        if (IsIslandDisabled(sIslandName))                                        continue;
        if (GetAttribute(GetIslandByID(sIslandName),"skipCR") == "1")            continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass island check");

        if (isSoldier(chr) != UNKNOWN_NATION)                                    continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass soldier check");

        if (CheckAttribute(chr,"questchar"))                                    continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass quest character check");

    //    if (CheckAttribute(chr,"quest.officertype"))                            continue; // PB: This is not safe anymore due to the Leveling system!
        if (GetAttribute(chr,"isOfficer") == true)                                continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass officer check");

        if (GetAttribute(chr,"chr_ai.type") == LAI_TYPE_MERCHANT)                continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass merchant check");

        if (GetAttribute(chr,"Dialog.Filename") == "governor.c")                continue;
        if (GetAttribute(chr,"Dialog.Filename.GroupDialog") == "governor.c")    continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass govenor check");

        if (GetAttribute(chr,"Dialog.Filename") == "Smuggler_OnShore_dialog.c")    continue;
        if (GetAttribute(chr,"Dialog.Filename") == "Agent_dialog.c")            continue;
        if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass smuggler check");

    //    if (GetAttribute(chr,"abordagemode") != "1")                            continue; // PB: This can only be disabled for officers, who aren't valid clients
    //    if(DEBUG_SMUGGLING>2) trace("SMUGGLING GUILD MEMBERS pass boardingmode check");

        if (chr.lastname == "") {
            if(DEBUG_SMUGGLING>0) trace("SMUGGLING GUILD MEMBERS RENAMED: "+GetMySimpleName(chr));
            SetRandomNameToCharacter(chr);
        }

        index = Category + chosen;
        pchar.quest.smuggling_guild.people.(Category).(index) = chr.id;
        pchar.quest.smuggling_guild.people.(Category).(index).name = GetMySimpleName(chr);
        pchar.quest.smuggling_guild.people.(Category).(index).location = GetPrettyLocationName(chr.location);
        pchar.quest.smuggling_guild.people.(Category).(index).island = GetIslandNameByLocationID(chr.location);
        if(DEBUG_SMUGGLING>0) trace("SMUGGLING GUILD MEMBERS PICKED: "+pchar.quest.smuggling_guild.people.(Category).(index).name+" at: "+pchar.quest.smuggling_guild.people.(Category).(index).location+" ("+chr.location+") on: "+pchar.quest.smuggling_guild.people.(Category).(index).island));
        chr.Dialog.Filename.SmugglingGuild = Dialog;
        chosen += 1;
    }
}

looking at it again I do see another problem.
put it here:
Low Priority - Dialog error when character is collector and opium buyer | PiratesAhoy!
 
Where does the script look for characters, and when?
It checks for characters quite literally everywhere. It does this once, the first time you talk to a Smuggler to get the List of Opium Buyers.

There are several exceptions in place as can be seen from the code that @Levis posted.
It used to be possible for inappropriate characters to be selected relatively frequently, but that was before I rewrote that code.
I did some extensive testing after that rewrite and while less-than-ideal characters may still be selected, the chance of that happening is much lower than it used to be.

My personal suggestion would be that, if that happens, those characters should be given a "skipOpium" attribute (if "questch" is not viable).
 
There is no problem if its selects less then ideal characters.
Altough I might need to add a check for character which could attack you once you see them, altough I think those are all labeled with questch already or are only generated once you get to the location.
 
There is no problem if its selects less then ideal characters.
There is a problem when the chosen character cannot possibly be reached.

Altough I might need to add a check for character which could attack you once you see them, altough I think those are all labeled with questch already or are only generated once you get to the location.
You mean the randomly generated bandits? Don't worry, if those could be chosen, we would have noticed by now. ;)
 
There is a problem when the chosen character cannot possibly be reached.
Don't you like a challenge?

Do you have any examples of character which are impossible to reach but are initialized at the start of the game and have a location set?
 
Don't you like a challenge?
Challenge, yes. Impossibility? Not so much. :rolleyes:

Do you have any examples of character which are impossible to reach but are initialized at the start of the game and have a location set?
The most obvious ones are those mentioned in the opening post, of course! ;)

I can't readily think of any others, but there are a LOT of potential candidates, so chances are that there might be some more examples.
Last time I looked into this though and rewrote it a bit, it seemed mostly OK as far as I could tell.

Easy way to test is by not generating 10 characters, but 500 or something, then check them being written to compile.log .
That's what I did at the time. :cheeky
 
Back
Top