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

Sendmessage to AI

Sulan

Codelubber
Storm Modder
Ahoy,

I have tracked the 'Engine Crashes when going to sea'-bug down to a SendMessage call in Ship_SetTaskMove in AIShip.c.

running

SendMessage(&AISea, "lllaff", AI_MESSAGE_SHIP_SET_TASK, AITASK_MOVE, iTaskPriority, &Characters[iCharacterIndex], x, z);

with this data

<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->iTaskPriority 1
iCharacterIndex 1126 (Ship Name: Asia, Ship Type: Caravel3_50)
x 10000
z 10000

or

iTaskPriority 1
iCharacterIndex 1123 (Ship Name: London, Ship Type: Shnyava1)
x 10000
z 10000

or (with some more information)

iCharacterIndex 1113
Character Name Evan
Character ID CrIslaMuelle3
Character Location none
Character Location From_Sea Muelle_port
Character Rank 9
Ship Name HMS Censor
Ship Type CorvFrig1
Ship Hull 5745
Ship Sail 100
Ship Pos x -68.5488
Ship Pos z -541.29
x 10000
z 10000

causes crash<!--colorc--></span><!--/colorc-->

but with this data

<!--coloro:#008000--><span style="color:#008000"><!--/coloro-->iTaskPriority 1
iCharacterIndex 1125 (Ship Name: Lyra, Ship Type: Galeon3_50)
x 10000
z 10000

or

iTaskPriority 1
iCharacterIndex 1128 (Ship Name: HMS Mosquito, Ship Type: Warship2)
x 10000
z 10000

or

iTaskPriority 1
iCharacterIndex 1127 (Ship Name: HMS Ceres, Ship Type: Xebec1)
x 10000
z 10000

works fine!<!--colorc--></span><!--/colorc-->

So it seems to have something to do with the ship - but I could be wrong. It could also be the reference &Characters[iCharacterIndex] causing the problem. I have looked around in the files, but the SeaAI, which is targeted by the SendMessage seems to be handled by the Engine, so it is a black box? How to resolve such issue? I have had my fist look into the sources of this game a few days ago, so I am somewhat stuck now. Support by a more experienced POTC coder would be appreciated in order to solve these annoying crashes.

Thanks a lot,
Sulan
 
Update: The bug also occurs for the other Ship Tasks (Attack, Defend etc.) although much less frequently. I think, this can only be fixed by someone knowing what has changed from Build 14 A6 to 14 A7. In Alpha 6 no problems, in Alpha 7 frequent crashes. Since many files were changed in Alpha 7, it is very hard to find out what causes this problem - could be the direct sail mod, but could also be something else.

I can provide save games (with >50% probability of crashing when exiting to sea) if needed.
 
The DirectSail mod was one of the things that, as far as I know, WASN'T changed since Alpha 6. In any case: There's a lot of changes in Alpha 7, but I don't even HAVE Alpha 7, so there's nothing I can do. Not the coming two months anyway. I'll get back to compiling if I can again in two months, so you'd just have to be patient for that. In any case: Pirate_KK might be able to do something.
 
Do these crashes occur if you go to sea i First person view? Guiliotto(?) once discovered that in 3rd person view you get less crashes. But that was some time ago, and may be not related to THESE CTDs.
 
No, they appear in 3rd person view. It doesn't matter if going to Open Sea from Worldmap or from the Port. As long as there are ships in the vicinity there is a high probabiliy of crashes. I have two save games, where it's more than 50% crash, when directly going to Sea.
 
Back
Top