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