1. Dismiss Notice
  2. GOG.com logo

    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!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Medium Priority 3D Sailing Mode: Flag-related Error Log

Discussion in 'Build Testing List' started by Levis, Dec 4, 2015.

  1. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,615
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    If this error occurs, then the ENTIRE function is aborted in the middle of it trying to load flags.
    No wonder the flags can get a bit messed up at times.

    But while I managed to replicate this insanity EVERY time straight upon loading an old savegame by @Jason,
    I haven't yet been able to replicate it on demand in other situations.

    I found myself a bunch of pirate ships at sea, then made a Save at Sea and loaded that.
    This time, everything behaved perfectly fine.

    I now know what ISN'T the problem (it has nothing to do with array sizes), but the actual issue remains elusive.

    What I did do is to slightly modify the GetPirateFlag function to ensure EVERY character gets the required attributes set.
    Not sure if that will help, but it can't hurt. :shrug
     
  2. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,615
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
  3. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,615
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I have an ATTEMPTED FIX for this! Extract attached to PROGRAM\SEA_AI .

    Basically, just added a crazy amount of 'makeint' function calls here, "just in case":
    Code:
        if (!IsEntity(&PirateFlag[makeint(ntexture)])) { // PB: Add 'makeint' everywhere to avoid error logs
           sid = "" + ntexture;
           CreateEntity(&PirateFlag[makeint(ntexture)], "PFg" + sid);
           LayerAddObject(sCurrentSeaExecute, &PirateFlag[makeint(ntexture)], iPriority);
           LayerAddObject(sCurrentSeaRealize, &PirateFlag[makeint(ntexture)], iPriority);
           LayerAddObject("sea_reflection",  &PirateFlag[makeint(ntexture)], 3);
           iPriority++;
    
           if (hasPennant) {
             CreateEntity(&PiratePennant[makeint(ntexture)], "PPn" + sid);
             LayerAddObject(sCurrentSeaExecute, &PiratePennant[makeint(ntexture)], iPriority);
             LayerAddObject(sCurrentSeaRealize, &PiratePennant[makeint(ntexture)], iPriority);
             LayerAddObject("sea_reflection",  &PiratePennant[makeint(ntexture)], 3);
             iPriority++;
           }
         }
    
    Seems to have helped. I also tried a single call at the beginning with ntexture = makeint(ntexture), but that didn't work.

    It could be that this is ONLY needed on the IsEntity line, but since I do not understand this one bit, I'd rather be safe than sorry, so I added it EVERYWHERE!

    As far as I can tell, I have observed correlation between this file and the lack of those annoying error.log entries.
    So I'll add that to the next modpack and we'll see what happens....
     

    Attached Files:

    • AIShip.c
      File size:
      220.7 KB
      Views:
      24
  4. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,615
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
  5. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,615
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Last edited: Jul 29, 2016

Share This Page