Cracked it!
The problem is with officers. The mutiny code checks all your passengers; any whose reputation is better than "Swindler" may join in the fight on your side. If there aren't enough loyalists from there, some loyal crew are spawned as fantoms. Any officer whose reputation is "Swindler" or lower may join in as a mutineer, in which case he is killed and replaced by a clone fantom; again, if there are not enough mutineers, some crew are spawned as fantoms.
It is that replacement of the rotten officer with a clone that is causing the trouble, which is why my savegame has no problem - none of my officers are evil enough. If I use cheatmode to turn one of them into "Horror of the High Seas", the bug strikes.
This is the line which creates the clone fantom:
Code:
chr = LAi_CreateFantomCharacterEx(true, 0, true, true, 0.25, model, ani, chLocType, chLocLoc + pos);
As far as I can tell from looking at old files, 'LAi_CreateFantomCharacterEx' used to take "ani" as an argument. It was changed to not take "ani" round about the time we switched from Beta 4 to Beta 4.1, early in 2016. Almost all 'LAi_CreateFantomCharacterEx' calls were changed to remove the "ani" argument, but for some reason this one was missed. I don't know why it doesn't trigger a game-breaking error; syntax errors usually do. Instead, 'LAi_CreateFantomCharacterEx' gets confused and uses the "ani" argument for the model, which is why this shows up in "system.log":
Code:
resource\models\characters\man.gm: can't open geometry file
Character model 'characters\man' not loaded
"man" is an animation, not a character model.
The solution: get rid of "ani" in that line. The result:
By the way, the reason I have a visible sword is that I copied "RESOURCE\MODELS\Ammo\OtherItemsJRH\bladeA4.gm" into "RESOURCE\MODELS\Ammo".
Attached is "PROGRAM\Loc_ai\LAi_mutiny.c" with the offending line corrected.
@Jack Rackham: location "mutiny_deck" is indeed a "Woodes Rogers" quest location, but it's
also a standard location defined in "PROGRAM\Locations\init\boarding.c":
Code:
// ID
Locations[n].id = "MUTINY_Deck";
Locations[n].id.label = "Boarding deck";
n = n + 1;
This one has no attributes because function 'MutinyDeck_Start()' in "LAi_mutiny.c" copies it from whichever quarterdeck is appropriate to your ship. I don't know whether having two locations with the same ID will cause trouble. Certainly if you ever use your own version again after the start of the storyline, and if there's been a mutiny, it won't look the same and may not work properly. You may want to rename your quest version to avoid any conflict.