Code:
case "back_to_Tia_Dalma":
pchar.quest.back_to_Tia_Dalma_failed.over = "yes";
ChangeCharacterAddress(characterFromID("Pirates_1"), "None", "");
ChangeCharacterAddress(characterFromID("Pirates_2"), "None", "");
ChangeCharacterAddress(characterFromID("Pirates_3"), "None", "");
Better would be:
Code:
Characters[GetCharacterIndex("Pirates_1")].location = 0;
Characters[GetCharacterIndex("Pirates_2")].location = 0;
Characters[GetCharacterIndex("Pirates_3")].location = 0;
Using 'ChangeCharacterAddress' makes them vanish right away - you kill all three, then the bodies disappear in front of your eyes. The other method leaves them where they are until you leave the area, then they're gone when you return.
This was a real debate for me...
What idea i have right now would be: make characters immortal when already in a quest location, like when player arrives to cannibal island shore etc. and make them mortal again when back to sea after the quest location. I will think about it some more and try to find a solution, it will be some more work to write "if character x dies" but nothing is undoable.
I will have to replay COTB and see how it handles quest officers. Or you could suggest the best approach as you already are playing it again
It doesn't check for Joshamee Gibbs (or Anamaria) being killed at all. But they don't have 'LAi_NoRebirthEnable' set, so if they're killed, they're no longer available as officers until the quest puts them back in the game. "Hornblower" does the same with a lot of characters, including Sharpe's riflemen. Pretend they weren't really killed, only wounded, and have healed when they reappear.
For "Ardent", I wrote contingencies for what happens if Lucia de la Vega is killed. She plays a key part in the "Convoy Strike" quest; if she's dead, the quest can still proceed but there are differences. Much later on, you've been arrested and Lucia helps you escape; if she's unavailable due to being dead or due to something you did earlier, someone else helps you instead.
About Anamaria... she does not appear in DMC film, instead of her there usually is a random crew member or the guy with a parrot (forgot his name), but she is a cool character, and she is brought up a lot more in the COTB quest that we have compared to the original movie, and i quite like that!
That's partly because the story depicts Jack's life before the film started; and partly because it's clear in the film that they have previous history, so the game shows some of it.
The point is, if Anamaria is not shown in DMC then you could leave her as a regular officer and create some other character who only appears for quest scenes. Or, if you want Anamaria, you could do something like this:
Code:
if(IsOfficer(CharacterFromID("Annamaria")) || IsCompanion(CharacterFromID("Annamaria")) || IsPassenger(CharacterFromID("Annamaria"))) PChar.quest.scene_player = "Annamaria";
else PChar.quest.scene_player = "Other_Guy";
Then, instead of doing things specifically with Anamaria, do them with 'CharacterFromID(PChar.quest.scene_player)'. If Anamaria is with you somewhere (an active officer, an inactive officer or commanding a companion ship), she'll appear in the scene, otherwise Other_Guy will do the job instead. (Replace "Other_Guy" and "scene_player" with whatever you prefer.)
This also protects your quest from a player who puts Anamaria in command of a companion ship and then leaves it berthed somewhere. For good measure, you could have a second backup character to stand in for Joshamee Gibbs if he's unavailable.
I think some of my quests could get weird if you have additional officers, what is the best way to remove any other officers that player might have and disallow to assign them back during the quest scenes ?
You'd need to explain why the other officers aren't there. (Remember how, in "Tales of a Sea Hawk", Danielle tells you that you don't want to take everyone with you when you're sneaking into Silehard's bedroom?) Use:
Code:
StorePassengers(PChar.id);
... to remove all officers and passengers. Later:
Code:
RestorePassengers(PChar.id);
... will put them all back.