• 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 Hire officer from barkeeper not functioning

Yes also I just faced issue of recruiting from bartender.. the past 6 tries I kept hiring canoneer.. but Bartholomow Deaman keeps popping up and automatically hired but invisible in my Passenger list..

One of the save file is before hiring, and the other save file is after hiring the canoneer bartholomew.
 

Attachments

  • FreePlay.rar
    1.7 MB · Views: 101
  • compile.log
    1.7 KB · Views: 83
  • error.log
    143 bytes · Views: 93
Yes the issue I believe is only with the character name Bartholomew Deaman..
What I did.. I spoke to Bartholomew, then I told him I don't need his services.. then I stayed overnight @ tavern and when I came down I hired another canoneer with the availability of the option "I'm an officer, how can I help you.."

This canoneer has a different name, so command for Bartholomew has a broken code maybe.
 
Sounds like you managed to trigger the same problem you had before. Unfortunately that problem is batshit insane crazy.
While the code is correct and behaves itself, in your case the act of applying a random name to a character makes an old character reappear.
There is absolutely no sensible reason why it should do that as there are no lines of code with that function. But that is what happens anyway.

I tried to fix it last time, but simply couldn't because the code was not at all behaving itself like it should.

A REPEAT OF MY EARLIER REQUEST: Other players, PLEASE test hiring officers from the taverns in both ways as much as possible,
including asking for specific officers but subsequently not hiring them.
If this problem is to be fixed, we really do need to know if it can be replicated by other people too.
 
Also encountered another mongrel.. Hugh Ramson the name, Master@arms..
Perhaps there is just a character name linkage to the problem; or maybe it's a broken code for random characters.. that's the hard part to figure out.
 
I don't know what is going on. On that savegame of yours, the code isn't doing what it is told.
At the moment I am forced to blame "computer black magic". :shrug
 
Yes.. my mother always warned me not to go to morocco :p

on the technical side.. would it possible that my anti virus is eating up hazardous files in the game folder?
at first thought I assumed I had malware or something, but my Nod32 antivirus scanned several times and not a single trace of threat ..
 
on the technical side.. would it possible that my anti virus is eating up hazardous files in the game folder?
at first thought I assumed I had malware or something, but my Nod32 antivirus scanned several times and not a single trace of threat ..
The game would refuse to start if necessary files are missing.
 
And I don't think I'm missing any video codecs otherwise I'd crash which I haven't experienced a single crash since I started playing this new update.. so in the end this technical matter is a real mystery
 
Well I can't replicate the error you have but I do seem to have a problem with this.
After I declined an officer he stays in this tavern. Even after I exit and enter it again. I dunno maybe you added a trigger to make him or her dissapair after X amount of days. but at least 3 days have past and he is still there. This wouldn't be such a problem except when I'm looking for the right officer it could very well happen I have to test 10 or 12 officers and then it gets a bit crowded there :p.
 
When I tested on a clean new game, the officers would disappear the next time you're in that Tavern.
That is how it is intended to work.

This wasn't the case on the savegame posted here and I had begun putting in some code to actively remove then again.
Then when I couldn't replicate that behaviour on a new game, I removed that code again.

They kept reappearing anyway because something seemed wrong with that Save.
 
This was on a clean save too where I tested it.
 
I'll call it "Confirmed" then again. Suppose I'll have to check it on a new game once more. :facepalm
 
I was playing free play with Jean latiffe
 
Split the topic to keep this seperate
 
I was playing free play with Jean latiffe
Confirmed now by me in the same situation too.
These officers stick around while they're not intended to.
Looks like I really DO need to put some code in place to make them disappear.
 
UGH! That DeleteCharacter function seems to be almost useless.
While it does immediately delete a character from the location, it maintains everything about that character.
It doesn't even delete its location attribute, so even if you DeleteCharacter on these unhired officers, they just reappear the next time you enter that tavern.

To make this function a lot more effective, I would suggest replacing this in PROGRAM\Characters\characters.c:
Code:
bool DeleteCharacter(ref character)
{
   DeleteClass(character);
   return true;
}
With this:
Code:
bool DeleteCharacter(ref character)
{
   // PB: Completely erase attributes -->
   int index = character.index;
   string id = character.id;
   DeleteClass(character);
   DeleteAttribute(character, "");
   character.index = index;
   character.id = id;
   character.location = "none";
   character.location.locator = "";
   character.location.group = "";
   // PB: Completely erase attributes <--
   return true;
}
That deletes ALL the character's attributes, then makes sure to maintain the index, ID and location attributes to prevent further issues in the future.
I think this should ensure that deleted characters no longer "linger around" in any fashion.
But this is also quite a large change to a function that is used in a variety of circumstances, so I do not know if this is entirely safe.
@Levis, any thoughts on that one?
 
Then in PROGRAM\Locations\locations_loader.c add this last line:
Code:
bool UnloadLocation(aref loc)
{
   if(CheckAttribute(loc,"id")) traceif("UnloadLocation(aref loc) " + loc.id);

   DialogExit();

   ref mainCharacter = GetMainCharacter();
   if(SendMessage(&mainCharacter, "ls", MSG_CHARACTER_EX_MSG, "IsFightMode") != 0)
     mainCharacter.lastFightMode = "1";
   else
     mainCharacter.lastFightMode = "0";
   SideStepControl(0, false); // NK ranged sidestep 05-07-21

// KK -->
   ClearAllLogStrings();
   if (CheckAttribute(loc, "type")) {
     if (loc.type == "own_deck" || loc.type == "ship") {
       DeletePortLandscape();
     }
   }
// <-- KK

   Event(EVENT_LOCATION_UNLOAD,"");
   DeleteAttribute(loc,"openboxes");                   // NK 05-04-14
   DeleteAttribute(loc,"trapboxes");                   // NK 05-04-14
   DeleteAttribute(loc,"jammed");                     // PB: Lockpicks
   DeleteAttribute(mainCharacter, "Flags.waitdelay");           // PB: Just to make sure this is gone
   DeleteAttribute(mainCharacter, "directsail1.QuestCheckMapEnter");   // PB: This too
   LogoffCharactersFromLocation(loc);                   // PB: Permanently erase certain characters
Plus a new function for PROGRAM\Characters\characters_login.c:
Code:
// PB -->
void LogoffCharactersFromLocation(ref loc)
{
   int i;
   ref chr;
   string locID = loc.id;
   for (i = 0; i < MAX_CHARACTERS; i++)
   {
     chr = &Characters[i];
     if (!CheckAttribute(chr, "location"))   continue;
     if (chr.location != locID)         continue;
     if (HasSubStr(chr.id, "Enc_Officer_") && !bAllies(chr)) DeleteCharacter(chr);
   }
}
// PB <--
I think this might just be the cleanest solution for this one.
Any officer that isn't hired, but still in the location when you leave, will be permanently deleted, never to return.
 
Btw to make the character dissapair why not use the
Code:
ChangeCharacterAddressGroup
command and use "" "" as locators.
 
Because I want the character to be GONE and not linger around in any way.
I've used location none often enough before, but that doesn't actively prevent that character to reappear later on.
 
Back
Top