Okay, you want a progress bar in Quake? Open up defs.qc and comment out this line:
string(string s) precache_model = #20; string(string s) precache_model; string(string s) load_model = #20; string SIGNAL_CVAR = "gamecfg"; // Change this if your mod uses this cvar float TOTAL_MODELS = 26; // Change this based on how many models get // precached in worldspawn float startsequence; float dottracker; float modelsloaded; Now, open up world.qc, and add this to the start:
void(string s) forceprint =
{
local float defon;
if(cvar(SIGNAL_CVAR))
{
defon = cvar("developer");
if(!defon)
{
cvar_set("developer", "1");
dprint(s);
cvar_set("developer", "0");
}
}
};
string(string s) precache_model =
{
local float tempdot;
if(startsequence)
{
modelsloaded = modelsloaded + 1;
tempdot = floor(modelsloaded * 43 / TOTAL_MODELS);
if(tempdot > dottracker)
{
while(dottracker != tempdot)
{
forceprint("ª");
dottracker = dottracker + 1;
}
}
}
return(load_model(s));
};
Now, in the worldspawn function, before the line:
precache_model ("progs/player.mdl");
startsequence = TRUE;
modelsloaded = 0;
dottracker = 0;
forceprint("\nLoading Models...\n0% ...... 25% ..... 50% ..... 75% .... 100%\n");
forceprint("\n\n");
startsequence = FALSE;
cvar_set(SIGNAL_CVAR, "0");
One last thing must be done... You have to open up quake.rc, autoexec.cfg, or default.cfg, and set whatever your SIGNAL_CVAR value is to 1. Be aware that the progress bar will not appear in demos, and if a demo is played, the progress bar will not show up. If you want to test this out without rebuilding your quake.rc or whatever, do this: quake -game modname +gamecfg 1 +map start |