Raised This Month: $59 Target: $400
 14% 

AMXX Precacher Redux


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Technical/Development        Approver:   Zenith77 (34)
Cyrez
Junior Member
Join Date: Sep 2005
Location: Redwood City, CA USA
Old 02-09-2008 , 15:51   AMXX Precacher Redux
Reply With Quote #1

AMXX Precacher Redux
Version 2.0.2
By Cyrez

Based on AMX Precache by Sanji
Special thanks to BAILOPAN for his CSDM source code that provided much of the inspiration I needed.
Requires: Engine

The original plugin allows you to precache just about anything. The code, although functional, was outdated and had some redundancy. This completely revamped version has less code, standards-compliant logging, automatic creation of the proper directories and files, and no more hardcoded paths.

When you first load the plugin and load any map, it will create a "precache" directory in "configs" followed by the creation of the default precaching file loaded with every map which can be found at "precache/default.pre". Next, it will create a "precache/maps" directory. Every time a new map is loaded from here on out, a "precache/maps/<map>.pre" file is created automatically. That's right, no more manual installation! It's all automated!

Update 2.0.1: Fixed precache_class, some code cleanup.
Update 2.0.2: Removed load_file since it never worked in the first place.

Quote:
Originally Posted by Sanji View Post
Commands to use in the files:
Code:
precache_model <modelfile>	(example: models/islave.mdl)
precache_sound <soundfile>	(example: ambience/alien_beacon.wav)
precache_generic <file>		(example: mp3/yeah.mp3)
precache_class <classname>	(example: monster_alien_slave)
Special Note: You can comment out any precache command in the files by prefixing it with //
Attached Files
File Type: sma Get Plugin or Get Source (precache.sma - 6484 views - 2.1 KB)

Last edited by Cyrez; 02-12-2008 at 10:14. Reason: Update 2.0.2
Cyrez is offline
Send a message via ICQ to Cyrez Send a message via AIM to Cyrez Send a message via MSN to Cyrez Send a message via Yahoo to Cyrez
chris
Senior Member
Join Date: Mar 2007
Location: America
Old 02-09-2008 , 15:59   Re: AMXX Precacher Redux
Reply With Quote #2

Cool! Trying it now!
__________________
chris is offline
Send a message via AIM to chris
Cyrez
Junior Member
Join Date: Sep 2005
Location: Redwood City, CA USA
Old 02-12-2008 , 07:36   AMXX Precacher Redux 2.0.1
Reply With Quote #3

precache_class wasn't working and has been fixed, and some more redundant code was removed.

Here's a nice shot of my plugin and Ent Mod working together:
Attached Thumbnails
Click image for larger version

Name:	de_dust20000.jpg
Views:	2825
Size:	27.4 KB
ID:	23613  
Cyrez is offline
Send a message via ICQ to Cyrez Send a message via AIM to Cyrez Send a message via MSN to Cyrez Send a message via Yahoo to Cyrez
Cyrez
Junior Member
Join Date: Sep 2005
Location: Redwood City, CA USA
Old 02-12-2008 , 10:13   AMXX Precacher Redux 2.0.2
Reply With Quote #4

load_file apparently never worked and I was unable to find a quick solution so the code for it was removed.
Cyrez is offline
Send a message via ICQ to Cyrez Send a message via AIM to Cyrez Send a message via MSN to Cyrez Send a message via Yahoo to Cyrez
harker
Junior Member
Join Date: Jul 2009
Old 07-29-2009 , 11:05   Re: AMXX Precacher Redux
Reply With Quote #5

It still working? I have to delete all res files of the maps?


I installed the plugin and enableed engine but "precache" directory doesn't appear.

Last edited by harker; 07-29-2009 at 11:34.
harker is offline
Cyrez
Junior Member
Join Date: Sep 2005
Location: Redwood City, CA USA
Old 07-29-2009 , 13:13   Re: AMXX Precacher Redux
Reply With Quote #6

Quote:
Originally Posted by harker View Post
It still working? I have to delete all res files of the maps?


I installed the plugin and enableed engine but "precache" directory doesn't appear.
Just to be sure, I did a clean install and all that stuff... It still works fine for me so you must have done something incorrectly...

The very first time you run it if you did everything correctly, you should see something like this:
L 07/29/2009 - 09:06:00: -------- Mapchange to <map> --------
L 07/29/2009 - 09:06:01: [precache.amxx] Creating directory addons/amxmodx/configs/precache
L 07/29/2009 - 09:06:01: [precache.amxx] Creating file addons/amxmodx/configs/precache/default.pre
L 07/29/2009 - 09:06:01: [precache.amxx] Creating directory addons/amxmodx/configs/precache/maps
L 07/29/2009 - 09:06:01: [precache.amxx] Creating file addons/amxmodx/configs/precache/maps/<map>.pre


Please, if you can, walk me through the steps you took.

EDIT: Oh, and BTW, .res files are still a good thing. What this plugin is for is if some plugin doesn't bother to precache a resource before trying to use it. That is, um, very bad. If you try to spawn something in a map that was never precached, well, you'll see what happens.

Last edited by Cyrez; 07-29-2009 at 13:22.
Cyrez is offline
Send a message via ICQ to Cyrez Send a message via AIM to Cyrez Send a message via MSN to Cyrez Send a message via Yahoo to Cyrez
vermillioN25
Member
Join Date: Apr 2009
Location: Brazil
Old 07-29-2009 , 15:38   Re: AMXX Precacher Redux
Reply With Quote #7

Nice. Now, where do I add the precache_sound ?
__________________
vermillioN25 is offline
R4to0.exe
Member
Join Date: Sep 2008
Location: Sao Paulo,Brazil
Old 07-29-2009 , 16:15   Re: AMXX Precacher Redux
Reply With Quote #8

what is this?

Code:
Invalid file type...skipping download of models/player/[M.O.D]/[M.O.D].bmp
R4to0.exe is offline
Send a message via MSN to R4to0.exe Send a message via Skype™ to R4to0.exe
harker
Junior Member
Join Date: Jul 2009
Old 07-29-2009 , 19:45   Re: AMXX Precacher Redux
Reply With Quote #9

I want to use it in DOD
*I put precache.amxx in /addons/amxmodx/plugins/
*add precache.amxx in plugins.ini
*enable engine in modules.ini
and thats all
i have to do something else?

the plugin is running but nothing happend
i have hlguard 1.9
harker is offline
Cyrez
Junior Member
Join Date: Sep 2005
Location: Redwood City, CA USA
Old 07-29-2009 , 20:30   Re: AMXX Precacher Redux
Reply With Quote #10

Quote:
Originally Posted by R4to0.exe View Post
what is this?

Code:
Invalid file type...skipping download of models/player/[M.O.D]/[M.O.D].bmp
Try using precache_generic for that one.

Quote:
Originally Posted by vermillioN25 View Post
Nice. Now, where do I add the precache_sound ?
You add it in one of the .pre files that's created depending on when you wanna load it, then follow with the path (which is relative to the mod directory) and the file. For example:
precache_sound hornet/ag_buzz1.wav
You could add that in default.pre or one of the map-specific ones.

Quote:
Originally Posted by harker View Post
I want to use it in DOD
*I put precache.amxx in /addons/amxmodx/plugins/
*add precache.amxx in plugins.ini
*enable engine in modules.ini
and thats all
i have to do something else?

the plugin is running but nothing happend
i have hlguard 1.9
Try disabling HLGuard and see if anything changes. If that doesn't work, make sure AMXX itself is properly installed.
Cyrez is offline
Send a message via ICQ to Cyrez Send a message via AIM to Cyrez Send a message via MSN to Cyrez Send a message via Yahoo to Cyrez
Reply


Thread Tools
Display Modes

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


All times are GMT -4. The time now is 15:48.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode