Different quests are started in different ways; some are triggered by entering a location, some by talking to a character.
Depending on the start trigger, the start would have to be handled differently. Can be done though, of course.
I did something vaguely similar for the storyline-dependent availability of the Isla de Muerta functionality.
That is done with this line in PROGRAM\Storyline\[Storyline].c:
Code:
AddStorylineVar(n, "JACK_SPARROW", "1");
That is used in this part of PROGRAM\Characters\characters_init.c:
Code:
// PB: Isla de Muerte -->
if(sti(GetStorylineVar(FindCurrentStoryline(), "ISLA_DE_MUERTE")) > -1)
{
ch.quest.Muerte = "";
ch.quest.Muerte_start.win_condition.l1 = "location";
ch.quest.Muerte_start.win_condition.l1.character = ch.id;
ch.quest.Muerte_start.win_condition.l1.location = "Tortuga_tavern";
ch.quest.Muerte_start.win_condition = "Muerte_start";
}
// PB: Isla de Muerte <--
The game tries to read any dialog file from the storyline folder first and if it doesn't find it there, reads it from PROGRAM\DIALOGS instead.
We can make use of that by always putting the sidequest versions in PROGRAM\DIALOGS unless the text needs changing.
Then the availability of the quest could be handled with an AddStorylineVar as above for location-activated sidequests.
Dialog-activated ones could have a similar if-statement in the applicable dialog files.
Characters and locations being initialized usually will not do much harm. If they aren't called for by the game's quest code, it will be as if they aren't even there.
So then the following would have to be done:
1. Moving all sidequest code from PROGRAM\Storyline\JackAubrey to the main PROGRAM folder
(doesn't matter which of the four storylines we move it from, but I know Jack Aubrey is nice and clean)
2. Remove all identical files from the other storylines, taking special care to remove it properly from the Standard storyline as well
3. Check how each quest is started and add if-statements as above around them as required
4. Do the same with the remaining sidequests from the Standard storyline
That would indeed offer improved flexibility without having too much doubled up code.
How much are you able to do though? I think I'm just about the only other active coder and I can't really afford to do it myself.
Real life is picking back up (thankfully!), so I'll be having much less time and enthusiasm to spend on PotC over the next several months.
I'm always willing to help out where I can though.