• 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 Levelling: Strange Occupations

Talisman

Smuggler
Storm Modder
:ahoy

I have just been to Bridgetown and noticed that the Store keeper had a strange occupation, so I checked as many of the other people as I could think of and found these strange ones:

For:
Storekeeper - John Filbert
Prison Commander - R Blacklock
Prison Soldiers - checked Port Royale prison too & same applies to some of soldiers there
Apothacary - Mather-Wren
Street Walker - Susan Lazar ( gives rumors/directions etc)
Street Walker - Audrey Proude ( gives rumors/directions etc) - for some reason male streetwalkers seem to be OK
Shipyard owner - D Fairweather
Tavern Keeper - S Hanpool
Tavern Girl - Nadine Jansen
Priest - Gilbert Ballester
Priest - Father Jerald ( think he is OK)

See Images
:cheers
 

Attachments

  • Potc JS BTown Storekeeper-Filbert.jpg
    Potc JS BTown Storekeeper-Filbert.jpg
    257 KB · Views: 151
  • PotC JS BTown PrisonCom-Blacklock.jpg
    PotC JS BTown PrisonCom-Blacklock.jpg
    264.9 KB · Views: 173
  • PotC JS BTown Prison-Soldier.jpg
    PotC JS BTown Prison-Soldier.jpg
    260.8 KB · Views: 170
  • PotC JS BTown Prison-Soldier2.jpg
    PotC JS BTown Prison-Soldier2.jpg
    262 KB · Views: 161
  • PotC JS BTown Apothacary-Mather-Wren.jpg
    PotC JS BTown Apothacary-Mather-Wren.jpg
    266 KB · Views: 151
  • PotC JS BTown Street_walker-Susan_Lazar.jpg
    PotC JS BTown Street_walker-Susan_Lazar.jpg
    265.5 KB · Views: 147
  • PotC JS BTown ShipyardOwner-Fairweather.jpg
    PotC JS BTown ShipyardOwner-Fairweather.jpg
    255.6 KB · Views: 177
  • PotC JS BTown Tavernkeeper-Hanpool.jpg
    PotC JS BTown Tavernkeeper-Hanpool.jpg
    265 KB · Views: 156
  • PotC JS BTown Street_walker-Audrey_Proude.jpg
    PotC JS BTown Street_walker-Audrey_Proude.jpg
    261.7 KB · Views: 145
  • PotC JS BTown Priest-Gilbert_Ballester.jpg
    PotC JS BTown Priest-Gilbert_Ballester.jpg
    263.4 KB · Views: 163
Last 2 images

:drunk
 

Attachments

  • PotC JS BTown Priest-Father_Jerald.jpg
    PotC JS BTown Priest-Father_Jerald.jpg
    262.3 KB · Views: 150
  • PotC JS BTown TavernGirl-Jansen.jpg
    PotC JS BTown TavernGirl-Jansen.jpg
    265 KB · Views: 153
Two more - just for fun :D

The priests in Port Royale - Farther Bernard & Father Gareth :rofl


:drunk
 

Attachments

  • PotC JS PRoyale Priest_Father Bernard.jpg
    PotC JS PRoyale Priest_Father Bernard.jpg
    264.3 KB · Views: 178
  • PotC JS PRoyale Priest_Father Gareth.jpg
    PotC JS PRoyale Priest_Father Gareth.jpg
    262.8 KB · Views: 156
I suspect this will apply to pretty much any and all random characters that can "randomly pick from all available officer types".
 
Looks like there was a DOUBLE issue going on here.
It starts out in this function:
Code:
String GetRandomNPCType()
{
   string retVal = "";
   int numtypes = GetAttributesNum(OfficerTypes);
   int picked;
   int attempts = 0;
   string type;
   while(retVal == "")
   {
     picked = rand(numtypes-1);
     type = GetAttributeName(GetAttributeN(OfficerTypes,picked));
     if(CheckAttribute(OfficerTypes,type+".CanRand"))
     {
       retVal = type;
     }
     if(attempts>10) retVal = OFFIC_TYPE_RANDCHAR;
     else attempts ++;
   }
   return type;
}
That last line needs to return "retVal" and not "type" as otherwise it is effectively always returning a random character type out of ALL options.
In other words: That ".CanRand" check is completely bypassed. :facepalm

Additionally, the following character types were ALL set as being available for "random NPCs":
- OFFIC_TYPE_RANDCHAR (fighter")
- OFFIC_TYPE_CIVILIAN ("civilian")

- OFFIC_TYPE_SHOPKEEPER ("shop merchant")
- OFFIC_TYPE_CAPPIRATE ("pirate captain")
- OFFIC_TYPE_CAPPRIVATEER ("privateer captain")
- OFFIC_TYPE_BOATSWAIN ("boatswain")
- OFFIC_TYPE_DOCTOR ("doctor")
- OFFIC_TYPE_ABORDAGE ("deck fighter")

So I have now changed the assignments so that only the ones in bold will be used by the random citizens in town.
The default used to be "fighter" if no other type can be found, so I changed that to "civilian".
Effectively that should mean that almost all such random characters will be just ordinary citizens, with the occasional "fighter" and "doctor" thrown in for variety.

Therefore this should be "Fixed" with the attached file; extract to your PROGRAM folder.
Note that it can only affect characters who didn't already have their officer type assigned.
So this will work on a new game; on a savegame it will affect only new characters and characters in locations you haven't visited yet.
 

Attachments

  • officers.zip
    4.3 KB · Views: 130
oops ....
It should also be changed in:
Code:
string GetRandomOfficerType()
{
    string retVal = "";
    int numtypes = GetAttributesNum(OfficerTypes);
    int picked;
    int attempts = 0;
    string type;
    while(retVal == "")
    {
        picked = rand(numtypes-1);
        type = GetAttributeName(GetAttributeN(OfficerTypes,picked));
        if(CheckAttribute(OfficerTypes,type+".usableoffictype"))
        {
            retVal = type;
        }
        if(attempts>10) retVal = OFFIC_TYPE_ABORDAGE;
        else attempts ++;
    }
    return type;
}

I guess
 
It seems some storekeepers in PROGRAM\Characters\init\storeowners.c
have the staytype set to them.
This should be changed to:
Code:
LAi_SetMerchantType(ch);
 
@Pieter Boelen can you check this? Replaced the stuff here but it might have unforseen consequenses altough I can't think of any
 

Attachments

  • StoreOwners.c
    31.5 KB · Views: 152
It should also be changed in:
Code:
string GetRandomOfficerType()
{
string retVal = "";
int numtypes = GetAttributesNum(OfficerTypes);
int picked;
int attempts = 0;
string type;
while(retVal == "")
{
picked = rand(numtypes-1);
type = GetAttributeName(GetAttributeN(OfficerTypes,picked));
if(CheckAttribute(OfficerTypes,type+".usableoffictype"))
{
retVal = type;
}
if(attempts>10) retVal = OFFIC_TYPE_ABORDAGE;
else attempts ++;
}
return type;
}
I guess
Good call! Missed that one. :doff

@Pieter Boelen can you check this? Replaced the stuff here but it might have unforseen consequenses altough I can't think of any
Should be OK, no?
 
A sailor, eh? Suuuure!
upload_2016-1-24_0-59-58.png

And your next-door neighbour is a pirate then?

Oh wait, she actually IS???
upload_2016-1-24_1-0-38.png


I think I'll be disabling those "officer types" for random characters now.... :wp
 
I don't see the problem .... but fine ...
 
I don't see the problem .... but fine ...
You only notice when you press [O] while facing them, which I suppose not many people will be doing.
But it might as well make sense, no?

Does this mean now ALL "Enc_Walkers" will be either a Citizen, Fighter or Doctor now too? :(
 
You only notice when you press [O] while facing them, which I suppose not many people will be doing.
But it might as well make sense, no?

Does this mean now ALL "Enc_Walkers" will be either a Citizen, Fighter or Doctor now too? :(
Yes, I could just add a check also, If someone if female to pick other types then when they are not.
So Females for example are:
Citizen or Doctor
And Males are:
Fighter, Citizen, Sailor or Pirate
 
I think you should probably restore the "choose from usable officer type" line when the "Enc_Walkers" offer themselves as officer.
If they all say, "People say I'm a good Citizen/Sailor/Pirate", that would seem rather weird.

Eventually the character models (and gender), officer types and dialog options offered should all make logical sense together.
But that is for later, I imagine. For now, I'd be happy if Beta 4 would behave itself in any sort of sensible way at all! :shock
 
I think you should probably restore the "choose from usable officer type" line when the "Enc_Walkers" offer themselves as officer.
If they all say, "People say I'm a good Citizen/Sailor/Pirate", that would seem rather weird.

Eventually the character models (and gender), officer types and dialog options offered should all make logical sense together.
But that is for later, I imagine. For now, I'd be happy if Beta 4 would behave itself in any sort of sensible way at all! :shock
I think I'll keep it because having them being a pirate or something like that allows them to have some other contributing perks as normal, you can keep them in that positions. Only if you change them to a other role will they get the new contributing perks etc. This makes them a bit more unique and different from the ones found in taverns.

I prefer to keep it this way so I can see the feedback off it etc after the public release. Then I will decide what to do with it, ok?
 
I decided to completely get rid of the "random NPC type" function, because really if there is no valid officer type, then "civilian" is probably the ONLY one that makes sense.

However, variety remains maintained because I linked officer types to character models now as much as possible.
See here for details: Fix in Progress - Random Hireable Officers have Strange Types | PiratesAhoy!
Hopefully that works out better, even if also this isn't quite perfect.
 
Back
Top