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

Low Priority Various problems in error.log

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
Here's an "error.log" file from a random point in my game. I'd probably just been in a store which is why the last batch of lines refer to "interface\store.c". The problems in "characters\characters.c" and "Loc_ai\LAi_boarding.c" are beyond my limited programming skills to diagnose, but the one in "interface\store.c" is easily identified:
Code:
nCurPrice = (makeint ((GetStoreGoodsPrice(refStore, GetGoodsIndexForI(nCurScrollNum), PRICE_TYPE_SELL, GetMainCharacter(), 0) + GetStoreGoodsPrice(refStore,GetGoodsIndexForI(nCurScrollNum),PRICE_TYPE_SELL,GetMainCharacter(),GetCargoGoods(refCharacter,GetGoodsIndexForI(nCurScrollNum))))/2;
Count the left and right brackets. Either I can't count or whoever wrote that line can't count, because I reckon there are two right brackets missing...
 

Attachments

  • error.log
    5.7 KB · Views: 233
Thanks for catching! Indeed that store one looks to be easily fixed. :woot

Code:
RUNTIME ERROR - file: characters\characters.c; line: 133
Cant create class: NPCharacter
I've been seeing that one relatively often. Sometimes it is combined with a "too many characters" line in compile.log .

Code:
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 90
invalid index 3 [size:3]
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 90
function 'CreateFlagEnvironment' stack error
I think I saw that before too, but when I tried to replicate it for testing, I couldn't.
It really isn't supposed to be happening though. :modding

Code:
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1640
Using reference variable without initializing
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1640
uninitialized function argument
That one looks peculiar.
There are both chr and refEnCharacter used in this section of code:
Code:
  if ("BOARDING_" + GetCharacterShipCabin(boarding_enemy) == locID && boarding_enemy_crew > 0) {
     LAi_SetLoginTime(refEnCharacter, 0.0, 24.0);

     ChangeCharacterAddressGroup(refEnCharacter, locID, "rld", enLocType + locnum);
     locnum++;
     // PB: Don't reuse locators until needed -->
     if(IsTown || IsFort){
       if (locnum >  GetBoardingLimit(locIndex)/2) locnum = startlocnum;
     }else{
       if (locnum >= GetBoardingLimit(locIndex)/2) locnum = startlocnum;
     }
     // PB: Don't reuse locators until needed <--

     LAi_group_MoveCharacter(refEnCharacter, LAI_GROUP_BRDENEMY);
     LAi_SetWarriorTypeNoGroup(refEnCharacter);
     LAi_SetFightMode(chr, false);             //JRH long guns didn't fire
     SendMessage(&chr, "lsl", MSG_CHARACTER_EX_MSG, "SetFightMode", 0); //JRH long guns didn't fire
     LAi_SetFightMode(refEnCharacter, true);
     SendMessage(&refEnCharacter, "lsl", MSG_CHARACTER_EX_MSG, "SetFightMode", 1);

     if (boarding_enemy_hp < 80)
       xhp = 80;
     else
       xhp = 2*boarding_enemy_hp;

     LAi_SetHP(refEnCharacter, xhp, xhp);

     refEnCharacter.donotshowXP = true; // so enemy XP boosts do not show.
     boarding_enemy_crew = boarding_enemy_crew - 1;
     numBoardingActors = numBoardingActors + 1;
     i++;
   }
If I see correctly, chr is a boarding sailor and refEnCharacter is a "twin" of the enemy captain I think, as defined outside the boarding function here:
Code:
  if (!IsFort && !IsTown)
     refEnCharacter = CreateTwinCharacter(boarding_enemy);
   else
     refEnCharacter = boarding_enemy;
Maybe @Jack Rackham has some thoughts on this one?
 
There are both chr and refEnCharacter used in this section of code:
Indeed. In the version I have it's only chr:

LAi_group_MoveCharacter(chr, LAI_GROUP_PLAYER);
LAi_SetFightMode(chr, false); //JRH long guns didn't fire
SendMessage(&chr, "lsl", MSG_CHARACTER_EX_MSG, "SetFightMode", 0); //JRH long guns didn't fire
LAi_SetFightMode(chr, true); // KK
SendMessage(&chr, "lsl", MSG_CHARACTER_EX_MSG, "SetFightMode", 1); // KK
xhp = makeint(boarding_player_hp);
LAi_SetHP(chr, xhp, xhp);
chr.donotshowXP = true; // so friend XP boosts do not show.
// SDLogIt("Selected crewman: " + chr.name);
boarding_player_crew = boarding_player_crew - 1;
numBoardingActors = numBoardingActors + 1; // add one boarding actor

So I guess it shouild be either or.
 
Looks like there were TWO sections of code looking like that.
The first one uses all chr and the second one probably should use all refEnCharacter .
Thanks for confirming! :cheers
 
So which ones still need to be fixed?
 
Nothing was yet done about these ones:
Code:
RUNTIME ERROR - file: characters\characters.c; line: 133
Cant create class: NPCharacter
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 90
invalid index 3 [size:3]
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 90
function 'CreateFlagEnvironment' stack error
RUNTIME ERROR - file: quests\quests_side.c; line: 6843
invalid index -1 [size:2250]
RUNTIME ERROR - file: quests\quests_side.c; line: 6843
function 'SideQuestComplete' stack error
RUNTIME ERROR - file: dialogs\Random_sailors_sit_tavern_dialog.c; line: 457
missed attribute: ani
RUNTIME ERROR - file: dialogs\Random_sailors_sit_tavern_dialog.c; line: 457
no rAP data
 
I think the flags one is quite rare and I don't understand why that would happen.
If you do want to look into that, perhaps you would also be interested in adding support for some more pirate and personal flags?
That's a thing I've been thinking of getting done, but of course it is a bit of a low priority.

Code:
RUNTIME ERROR - file: characters\characters.c; line: 133
Cant create class: NPCharacter
That one I have been seeing quite regularly and I don't quite like it.
Sometimes it may be accompanied with "too many characters in the location" in compile.log .
But sometimes I've even seen it right upon starting a new game.
 
Some extra ones that happen sometimes on a new Free Play game (Barbossa and Davy Jones get it a lot):
Code:
RUNTIME ERROR - file: weather\WhrUtils.c; line: 15
missed attribute: Dist
RUNTIME ERROR - file: weather\WhrUtils.c; line: 15
no rAP data
RUNTIME ERROR - file: weather\WhrUtils.c; line: 15
missed attribute: Size
RUNTIME ERROR - file: weather\WhrUtils.c; line: 15
no rAP data
 
Here's another "error.log" file with various errors which didn't seem to affect my game.

At least two of them are probably for the attention of @Levis and may in fact already have been fixed.
Code:
RUNTIME ERROR - file: smuggling.c; line: 731
missed attribute: id0
RUNTIME ERROR - file: smuggling.c; line: 731
no rAP data

Code:
RUNTIME ERROR - file: quests\quests_common.c; line: 513
missed attribute: island
RUNTIME ERROR - file: quests\quests_common.c; line: 513
no rAP data
The first is presumably to do with smuggling. The second appears to be something about fetch quests. The reason those don't affect my game is probably that I never smuggle and never do fetch quests. :D
 

Attachments

  • error.log
    4.3 KB · Views: 229
I got some new error log if someone is interested :eek:

RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
RUNTIME ERROR - file: seadogs.c; line: 724
Save - ARef to non existing attributes branch
 
You REALLY have to try and post in the appropriate threads. I'm wasting quite some time moving your posts where they belong.
As I said before, the more time I have to waste for no good reason, the less time I can spend actually doing important things.

I got some new error log if someone is interested :eek:
Those are stock game errors.
We never did manage to fix them and as far as I'm aware, they do no harm.
 
  • Like
Reactions: A.H
Some extra ones that happen sometimes on a new Free Play game (Barbossa and Davy Jones get it a lot):
Code:
RUNTIME ERROR - file: weather\WhrUtils.c; line: 15
missed attribute: Dist
RUNTIME ERROR - file: weather\WhrUtils.c; line: 15
no rAP data
RUNTIME ERROR - file: weather\WhrUtils.c; line: 15
missed attribute: Size
RUNTIME ERROR - file: weather\WhrUtils.c; line: 15
no rAP data

I think the problem lies in:
PROGRAM\Weather\init\WhrSetAzmAng.c

There are a few cases where Glow is define true but no Dist and Size are defined. They are only defined in the init when the Glow is true but this isn't always the case at the start I guess.
I think we need to add a Dist and Size there...
It seems to have something to do with the moonstates.

This seems to fix it.

I do found a new one, seems to be with the random contraband function.
Code:
RUNTIME ERROR - file: smuggling.c; line: 1743
incorrect argument index
RUNTIME ERROR - file: smuggling.c; line: 1743
Bad function argument
 

Attachments

  • WhrSetAzmAng.c
    28 KB · Views: 237
Think I know why that error is already.
This is the code
Code:
int getRandomContrabandGood(ref CurIsland)
{
    aref islRef; makearef(islRef,CurIsland.Trade.Contraband);
    DumpAttributes(islRef);
    int n = GetAttributesNum(islRef)
    if(n < 1) return -1;
    int goodidx = rand(n);
    return sti(GetAttributeValue(GetAttributeN(islRef,goodidx)));
}
Say there are 2 attributes then n will be 2
but GetAttributeN will start at 0 so if rand(2) return 2 which it could do it will error. So it has to be n-1.

Fixed in included document.
 

Attachments

  • smuggling.c
    61.4 KB · Views: 209
I was getting occasional errors with the random contraband function too, but couldn't reproduce them when I looked into it.
It is not a commonly used function yet though; I think its only use is to give an Agent player some stuff at the beginning.
Which reminds me.... Do we have a smuggler player type? That one might be able to make good use of it too.

Did you get any idea when that weather error could be triggered?
I only ever noticed it at game start with the Black Pearl and/or Flying Dutchman.
 
The weather error was triggered when you start at night and the moon is out.

The function is only used for agent indeed.
I will take care of a smuggling player type but want to finish a few other things first :). Then I will probably edit Jean Latife to be the one ...
 
Here's another "error.log" file with various errors which didn't seem to affect my game.

At least two of them are probably for the attention of @Levis and may in fact already have been fixed.
Code:
RUNTIME ERROR - file: smuggling.c; line: 731
missed attribute: id0
RUNTIME ERROR - file: smuggling.c; line: 731
no rAP data

Code:
RUNTIME ERROR - file: quests\quests_common.c; line: 513
missed attribute: island
RUNTIME ERROR - file: quests\quests_common.c; line: 513
no rAP data
The first is presumably to do with smuggling. The second appears to be something about fetch quests. The reason those don't affect my game is probably that I never smuggle and never do fetch quests. :D

These are both fixed already in previous updates.

So it's still these errors I guess:
Code:
RUNTIME ERROR - file: characters\characters.c; line: 133
Cant create class: NPCharacter
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 90
invalid index 3 [size:3]
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 90
function 'CreateFlagEnvironment' stack error
RUNTIME ERROR - file: quests\quests_side.c; line: 6843
invalid index -1 [size:2250]
RUNTIME ERROR - file: quests\quests_side.c; line: 6843
function 'SideQuestComplete' stack error
RUNTIME ERROR - file: dialogs\Random_sailors_sit_tavern_dialog.c; line: 457
missed attribute: ani
RUNTIME ERROR - file: dialogs\Random_sailors_sit_tavern_dialog.c; line: 457
no rAP data

The AIShip errors seem to be caused by the way flags are chosen but I need to know when it happened to be able to fix it.
The quests_side file is probably changed to much already now so I don't know which line this is anymore for sure....
The Random_sailors error could easily be fixed by adding a check attribute, but it's taking the crew.ani there and that seems to be missing,
Crew seems to refer to this:
Code:
ref crew = characterFromID("Treas_Crewmember_" + MAX_CREWMEMBERS);

So I have no idea where this is comming from. anyone can tell me what this is doing?

Edit: Btw I will include the fixes into my zipfile later.
 
Night starts, eh? That certainly explains why it happened mainly for Barbossa as I deliberately set him up for night time.

Was Jean Lafitte historically a smuggler? How would that work worth his American loyalties?
You could also make a brand new character who is a smuggler.
 
Back
Top