.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 1 SDK
Half-Life 1 SDK For developments focused around Half-Life (and its mods) Half-Life

Reply
 
Thread Tools
Precaching
Old
  (#1)
dead bwoy
Member
 
dead bwoy's Avatar
 
Status: Offline
Posts: 512
Join Date: Feb 2004
Location: STL MO USA
Default Precaching - 10-06-2004

Is it at all possible to disallow a file from being precached?
czero precaches every custom model listed in the BotProfile.db
I'm hoping to remove BotProfile.db from the precaching and precache different player models for each map. I've tried messing around with the \reslists\Condition Zero\precache.lst and exclude.lst, de_dust_cz.lst, Condition Zero precache list.lst, preloads.lst, etc. Altering these files seems to make no difference in precaching.
I need to precache different models for different maps.
ie: Desert camo models for de_dust and arctic camo for fy_iceworld.
Any ideas? When exactly does precaching occur between map changes? Can a hook alter the precaching in the way I want?
Thanks for any help/ideas!
  
Reply With Quote
Re: Precaching
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Precaching - 10-06-2004

Yes, a metamod plugin could do what you want. You would have to hook on pfnPrecacheModel() and check if it is precaching a player model, in which case make it precache the one you want. But then, don't forget to also prevent the player to try to use the model that has not been precached.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Precaching
Old
  (#3)
dead bwoy
Member
 
dead bwoy's Avatar
 
Status: Offline
Posts: 512
Join Date: Feb 2004
Location: STL MO USA
Default Re: Precaching - 10-06-2004

Would I need to add code only to this section?
Code:
int pfnPrecacheModel(char* s)
{
   return (*g_engfuncs.pfnPrecacheModel)(s);
}
How would I tie the precaching to specific maps?
Something like this from Splorygon's code from the cfg loading dll he made for me?
Code:
   char server_cmd[256];
   sprintf (server_cmd, "exec %s.cfg\n", STRING (gpGlobals->mapname));
   SERVER_COMMAND (server_cmd);
Or should I use Botman's Stripper2 source?
Code:
void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ) {
   int index;
   nullname[0] = 0;
   // precache all the needed items...
   for (index = 0; index < num_precache_items; index++)
   {
	  switch(precache_item_type[index])
	  {
		 case 0:  // model
			if (dllapi_log->value)
			   LOG_MESSAGE(PLID, "PRECACHING MODEL %s", precache_item_name[index]);
			PRECACHE_MODEL(precache_item_name[index]);
			break;
		 case 1:  // sound
			if (dllapi_log->value)
			   LOG_MESSAGE(PLID, "PRECACHING SOUND %s", precache_item_name[index]);
			PRECACHE_SOUND(precache_item_name[index]);
			break;
		 case 2:  // sprite
			if (dllapi_log->value)
			   LOG_MESSAGE(PLID, "PRECACHING SPRITE %s", precache_item_name[index]);
			PRECACHE_MODEL(precache_item_name[index]);
			break;
	  }
   }
If I put this in server activate, will this only work for the first map or every mapchange? Say I put all my desert camo models in czero\models\player\desert\*.* Can I precache every model in that folder? Maybe if I used a similar file structure to the PAF Hostitron (which changes hosti models on mapchange, wish it was open source...).
I know I'm a wankin' n00bified code editor (not a code stealer), but any help would be greatly appreciated!
  
Reply With Quote
Re: Precaching
Old
  (#4)
dead bwoy
Member
 
dead bwoy's Avatar
 
Status: Offline
Posts: 512
Join Date: Feb 2004
Location: STL MO USA
Default Re: Precaching - 30-06-2004

***bump***
  
Reply With Quote
Re: Precaching
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Precaching - 30-06-2004

ServerActivate() is called after each map change and even at server start. It is called each time the server is about to accept connections again.

Use STRING (gpGlobals->mapname) to get the name of the map

then precache the models you want...



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com