PDA

View Full Version : precaching files


Rav3n!
07-05-2007, 09:55
simple one really, how do you precache files on map load so that the files don't have to be called on the fly.

and also who can you make it so that the plugin calls a folder with some text files that have the laist of files to be called.

to put in context i am working on an admin model plugin, and it would be nice to have text files with admin models of choice

so for example you would have like in mani's admin models module were there was set files for each admin or public model, with text files containing the files to precache.

thanks to any answers much appreciated

Wiebbe
07-05-2007, 11:22
This is how its done in the RPGx mod:

precache_laser=PrecacheModel("materials/sprites/laserbeam.vmt");

Hell Phoenix
07-05-2007, 13:03
Just a note that precacheing a file doesnt add it to the download table. Currently you have to do that through either the download table extension or the hacks extension until its added to SM.

Rav3n!
07-05-2007, 16:47
Just a note that precacheing a file doesnt add it to the download table. Currently you have to do that through either the download table extension or the hacks extension until its added to SM.

yeh i understand that sm has no current d/load extension and was going to use download table.

cheers Wiebbe but would it be possible to say how you have used it, i not understand the
precache_lasersection, can it be changed to precache_material, and precache_model, or is there a bit of documentation for it, i am off to the wiki to look but just incase i not find anything, thanks


EDIT:

don't worry i found it it was a simple
PrecacheModel("modeldirectory")

sumguy14
07-05-2007, 19:02
Yeah precache_laser is just a variable name to store the precached file index. You can change that to whatever you want.

Rav3n!
07-06-2007, 07:09
Yeah precache_laser is just a variable name to store the precached file index. You can change that to whatever you want.

yeh exactly what i thought :D thanks :up: