Funny to see this one brought up; I've since gone back and completely removed the old cvar system for this as - while it sounded really neat in theory - in practice it was just a colossal pain.
The biggest downside to it was remembering to have to switch one of the cvars back to 0 for when you want to change games again but not have the mod included. Nothing like a bit of field-testing to bring out the glitches.
This is something that it seems not too many people are aware of, but you can actually do this:
Code: Select all
Cmd_AddCommand ("game", Com_ChangeGame_f);
Cmd_AddCommand ("gamedir", Com_ChangeGame_f);
Everything works and no matter which one of them the player expects to be able to use things just work (and there are valid arguments for "game" as (1) it's what Quake II uses so there's precedent in the official evolution of the Quake engine, and (2) it's what Fitz uses so there's precedent in what the SP mapping community prefer). As a bonus you get to be on both sides of a potential religious war!
Also, the following makes sense:
Code: Select all
for (i = 1; i < Cmd_Argc (); i++) COM_AddGameDirectory (va ("%s/%s", basedir, Cmd_Argv (i)));
One other thing I currently do is pre-scan the args for rogue/hipnotic/etc, then load them before anything else, then when loading the rest of the games skip over rogue/hipnotic. That ensures that they're consistent with id Quake in the search paths, although there may be reasons to load them in player-specified order that haven't occurred to me. Otherwise everything is taken in in the order that the player specifies.
-game on the command-line is tricksier and I haven't implemented much around that beyond the basic id Quake functionality.
Yes, while parsing the games specified by the "game" or "gamedir" command, snoop for hipnotic/rogue/etc and set the qbooleans appropriately, then junk the sbar pics and reload them.
The other last thing is that as Quoth requires the hipnotic HUD it makes sense to just set "hipnotic = true" if you detect that Quoth is being loaded. Ultimately this has the same effect as the former required advice to use "-hipnotic -game quoth".