Forum

Loading Precaches with FRIK_FILE

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Loading Precaches with FRIK_FILE

Postby Error » Sat Jun 28, 2008 7:16 pm

I've tried this with my code and code that GiffE gave me in #qc... and it just doesn't work.

I have these in a file that is loaded:
progs/player.mdl
progs/soldier.mdl

but can't make them precache. DP still says that I didn't precache player.mdl and tells me to fix my code.

if I get the time, I'll get on my lappy and paste the code.
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Error » Sat Jun 28, 2008 7:17 pm

I'm basically trying to make it possible for people to add new content just through my npc scripting language.
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Error » Sat Jun 28, 2008 7:23 pm

here is the code GiffE gave me, and can't figure out why it doesn't work:
Code: Select all
void() precache_script =
{
   local float f;
   local string ln;
   f = fopen("precache.txt", FILE_READ);
   if (f != -1)
   {
      ln = fgets(f);
      while(ln != string_null)
      {
         if(strstrofs(ln, ".wav",0) != -1)
            precache_sound(ln);
         else
            precache_model(ln);
         ln = fgets(f);
      }
   }
};


this is being called right from where I had normally done precaches
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Error » Sun Jun 29, 2008 6:23 am

looks like I got it, nm
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby FrikaC » Sun Jun 29, 2008 6:26 am

Glad we could help.
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby GiffE » Mon Jun 30, 2008 2:03 am

It certainly does work :) Have used it quite a bit in the last few days.
It needs to have other file formats added to detect which to precache_model and which to precache_sound
GiffE
 
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT


Return to QuakeC Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest