The following license is placed inside the source code of the plugin.
Late Model Precacher: a L4D/L4D2 SourceMod Plugin Copyright (C) 2022 Alfred "Psyk0tik" Llagas
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Catches unprecached models and tries to precache them to prevent crashes.
This plugin addresses the rare occurrence of a well-known UTIL_SetModel
crash that has existed for as long as both L4D games have been around. The crash can occur even on completely vanilla servers, but can occur more frequently on modded servers that run plugins utilizing models.
If a model cannot be precached, this plugin will block UTIL_SetModel
and the entity will (probably) just be invisible or be a giant ERROR sign.
Disclaimer: This plugin only helps prevent crashes related to unprecached models (UTIL_SetModel
crashes). If this plugin is detecting a lot of unprecached models on your server on a regular basis, there may be severe underlying issues with your server that need to be addressed.
Do not use this plugin as a "global precacher" for models. When a model is late-precached, players will experience a stutter (more obvious on low-end computers), so it's best to make sure that plugins utilizing models properly precache them inside OnMapStart()
.
Example:
L 04/11/2022 - 13:15:48: SourceMod error session started
L 04/11/2022 - 13:15:48: Info (map "l4d_hospital03_sewers") (file "C:\l4d1ds\left4dead\addons\sourcemod\logs\errors_20220411.log")
L 04/11/2022 - 13:15:48: [l4d_late_model_precacher.smx] UTIL_SetModel: Model models/props_unique/spawn_apartment/coffeeammo.mdl is not precached. Precaching late.
epz/epzminion - For the idea and solution.
SourceMod Team - For continually updating/improving SourceMod
.
SourceMod 1.10
or higherDHooks 2.2.0-detours15
or higher- Knowledge of installing SourceMod plugins.
- I do not provide support for listen/local servers but the plugin should still work properly on them.
- I will not help you with installing or troubleshooting problems on your part.
- If you get errors from SourceMod itself, that is your problem, not mine.
- MAKE SURE YOU MEET ALL THE REQUIREMENTS AND FOLLOW THE INSTALLATION GUIDE PROPERLY.
- Precaches any model that is not precached prior to being used.
- Blocks the game from setting an entity's model if the model failed to be precached.
- Delete files from old versions of the plugin.
- Place
l4d_late_model_precacher.txt
in theaddons/sourcemod/gamedata
folder. - Place
l4d_late_model_precacher.smx
in theaddons/sourcemod/plugins
folder. - Place
l4d_late_model_precacher.sp
in theaddons/sourcemod/scripting
folder.
- Delete
l4d_late_model_precacher.sp
from theaddons/sourcemod/scripting
folder. - Delete
l4d_late_model_precacher.smx
from theaddons/sourcemod/plugins
folder. - Delete
l4d_late_model_precacher.txt
from theaddons/sourcemod/gamedata
folder. - Follow the Installation guide above. (Only for upgrading to newer versions.)
- Move
l4d_late_model_precacher.smx
to theplugins/disabled
folder. - Unload
Late Model Precacher
by typingsm plugins unload l4d_late_model_precacher
in the server console.
If you would like to share your own revisions of this plugin, please rename the files so that there is no confusion for users.
Enjoy all my hard work and have fun with it!