Forum

precaching models

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

precaching models

Postby Handshakes » Sun May 30, 2010 7:01 pm

Hi all!

So I've made a new weapon and weapon model and I can get it into the game like nobody's business. However, whenever I pull up the weapon in-game DP (via the console) tells me that I haven't precache'd the weapon and I should fix my code.

The thing is, I thought I precache'd the hell out of my weapon. In world.qc I added precache_model ("progs/v_mg.mdl");, and yet everytime I play Darkplaces says that I need to precache "progs/v_mg.mdl".

What am I missing? :D
Handshakes
 
Posts: 11
Joined: Sun May 30, 2010 6:53 pm
Location: Detroit, MI

Postby Lardarse » Sun May 30, 2010 10:32 pm

Sounds like one of a few things:

1: Are you putting the command to precache the code in a function that actually gets called? There's a function in world.qc called worldspawn, which has a list of precaches that will happen when the map loads. Rather confusingly, there's also a function called main that has another list of precaches, that never gets called at alll it exists only for use with a tool that Id software used to build the .pak files.

2: Are you compiling your code after changing it? (Kinda feel guilty asking this, but you never know...)

3: Could be something more obscure, that I can't think of right now...
Roaming status: Testing and documentation
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby Handshakes » Mon May 31, 2010 12:05 am

Lardarse wrote:Sounds like one of a few things:

1: Are you putting the command to precache the code in a function that actually gets called? There's a function in world.qc called worldspawn, which has a list of precaches that will happen when the map loads.


Ah hah! Thanks for the help!

I was using an old save for testing purposes and that seemed to be what was throwing a wrench into the works. When I start a new game and the game loads maps the normal way then everything is just fine.
Handshakes
 
Posts: 11
Joined: Sun May 30, 2010 6:53 pm
Location: Detroit, MI

Postby Lardarse » Mon May 31, 2010 2:41 pm

Saved games can get screwy if the progs.dat changes. You may end up with things using the wrong model.
Roaming status: Testing and documentation
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest