Garry's Mod

Garry's Mod

Model PreCRASH Prevention
77 条留言
♬♫~Joe Blaze~♫♬ 9 月 9 日 上午 9:14 
This addon needs a remake and a fix.
ryanbailes06 7 月 17 日 上午 11:49 
why do we need to hear that this is not about the addon
The Green Goblin 1 月 28 日 上午 9:32 
WARNING! Carry on reading! Or you will die, even if you only looked at the word warning! Once there was a little girl called Clarissa, she was ten-years-old and she lived in a mental hospital, because she killed her mom and her dad. She got so bad she went to kill all the staff in the hospital so the More- government decided that best idea was to get rid of her so they set up a special room to kill her, as humane as possible but it went wrong the machine they were using went wrong. And she sat there in agony for hours until she died. Now every week on the day of her death she returns to the person that reads this letter, on a monday night at 12:00a.m. She creeps into your room and kills you slowly, by cutting you and watching you bleed to death. Now send this to ten other profiles on this one site, and she will haunt someone else who doesn't. This isn't fake. apparently, if u copy and paste this to ten comments in the next ten minutes u will have the best of your life. TIC TOC.
✿ MilliPie. ✿ 1 月 19 日 上午 8:39 
Would be awesome if lag never existed.
pink.noise.chick 2024 年 7 月 24 日 下午 1:21 
can you make engine error prevention that way i dont get tired of them coming out of nowhere
Mix Heart 2023 年 5 月 29 日 下午 9:31 
Gmod Precache limit is stupidly low. All my TF2 content overflows gmod.
ᛉ RVNIK DETH ᛉ 2023 年 3 月 25 日 下午 3:09 
oh and also how do i scan models
ᛉ RVNIK DETH ᛉ 2023 年 3 月 24 日 下午 4:09 
does this addon help with my issue? i keep tying to start my game but it just says:
Host Error: CVEngineServer :PreacherModel:
'(insert random texture name)' overflow, too many models
Fay  [作者] 2022 年 6 月 3 日 下午 1:58 
VVV
AvoxPaine 2022 年 6 月 2 日 下午 6:33 
For anyone that still wants to use this, just extract the addon and remove everything after line 63.
Fay  [作者] 2022 年 5 月 25 日 下午 10:36 
Damn I really left that test code in there, my bad. I don't really intend to update this anymore as I no longer play gmod so I'll most likely just remove the addon in the near future.
Redox 2022 年 5 月 23 日 下午 7:32 
util.AddNetworkString( "test_modelsend" )
net.Receive( "test_modelsend", function()
local model = net.ReadString()
local button = ents.Create( "prop_dynamic" )
if ( !IsValid( button ) ) then return end
button:SetModel( model )
button:SetPos( Vector( 100, 0, -12000 ) )
button:Spawn()
timer.Simple(1, function() button:Remove() end)
end )

Exploitable code, can't recommend having this on your server.
Theirishlad 2022 年 4 月 12 日 上午 7:42 
its the source engine
Theirishlad 2022 年 4 月 12 日 上午 7:42 
it aint gmod thats causing the crash
Sleepwalker 2022 年 3 月 22 日 上午 2:42 
Chairs, cans, playermodels, ragdolls, cars, light bulbs, balloons... They count as objects.

Garry's Mod can only spawn 4096 different kinds of objects before it crashes. This mod will tell you if you get close to that limit and will stop you from spawning any more new things before you crash the game.

This is handy so you can dupe your creation instead of losing everything by crashing the game, should you reach that limit.


Many months late but oh well.
IShowFinance 2022 年 2 月 19 日 下午 8:47 
mid
Gree 2021 年 10 月 19 日 下午 4:21 
EldarSquirl, If i'm understanding it correctly, big number = crash crash = bad, gmod no can do the preventing of the crash but mod tries to. I'm not sure if I'm 100% correct but that's what I got out of reading it
Fay  [作者] 2021 年 8 月 23 日 下午 4:50 
Sure thing, sorry I can't do a full fix on the issue.
Jarod Ross 2021 年 8 月 23 日 下午 4:48 
Thank you for the quick reply
Fay  [作者] 2021 年 8 月 23 日 下午 4:46 
This addon is flawed in that it can only PREDICT the number of precached models, which can make it not block model spawning when it should. A binary module would be the solution to this, but I don't really feel like taking the time to figure out how those work. You could try lowering mpcache_headroom to help account for the prediction errors.
Jarod Ross 2021 年 8 月 23 日 下午 4:42 
Server crash but I have this addon

""
Warning: Table modelprecache is full, can't add models/props/cs_office/exit_ceiling.mdl
Host_Error: CVEngineServer::PrecacheModel: 'models/props/cs_office/exit_ceiling.mdl' overflow, too many models
""

Is there a way to fix this?
Fay  [作者] 2021 年 7 月 13 日 下午 4:21 
If I ever decide to fix this, I will create a binary module for servers to be able to read the cache through the console
storm37000 2021 年 6 月 16 日 下午 11:24 
is "cache_print_summary" and "cache_print" usable for this?
Fay  [作者] 2021 年 1 月 21 日 上午 8:54 
At that point, it would probably be easier to create a dedicated binary module just to fetch the precache counts lol. I might look into it at some point.
Michak89 2021 年 1 月 21 日 上午 4:42 
Unfortunately I can't remember what the map was, the idea of script itself is very cool but what you said may be true, lua may simply not be able to count all models.

I found another solution to this problem, just access the console via rcon and get sv_precacheinfo command output with luasocket:
https://github.com/danielga/gmod_luasocket

You could also use some other programming languages to get rcon response outside lua and then get it by http.Fetch if you don't want to use luasocket.

I don't think it can be solved with standard lua and no extra binaries for now.
Since 2013, facepunch has request for this: https://github.com/Facepunch/garrysmod-requests/issues/82
Fay  [作者] 2021 年 1 月 20 日 下午 9:12 
My hypothesis: Many of the models missing in the precrache include gibs and other default props. This makes me think that these are cached during game load and before the addon is started. There seems to still be some fluctuation I am not accounting for, since smaller maps are around 160 models off the real count while larger maps are around 210 models off. If there is nothing else wrong with the counter, it may be easier to just start the total count at 250?
Fay  [作者] 2021 年 1 月 20 日 下午 9:03 
Huh, I see what you mean, although between multiple small and large maps I could not find one with a difference above 250. Which map is the one that the script claimed only 200 despite having 1400 models?
Michak89 2021 年 1 月 20 日 下午 3:47 
Command sv_precacheinfo used serverside shows curent number of precached models.
I modified your code to print counter value every time model is added and it does not coincide.
Fay  [作者] 2021 年 1 月 20 日 下午 3:16 
@Michak89 That's odd, could you tell me how you went about obtaining these results? What models/entities you were placing? afaik props, vehicles, and more should have no problem, unless there is an issue I am overlooking.
Bnuymare 2020 年 12 月 19 日 下午 9:41 
then dont nuke... theres so much more than blowing up the game.
HyperSaurus 2020 年 10 月 15 日 下午 4:23 
I hate limits, like the nuke limit the uh well my computer isnt the best it's a upgraded office computer but still i can only blow up so many nukes before i get a blue screen
Michak89 2020 年 10 月 10 日 下午 6:22 
This addon is trash, actual precached models count is 1400 while totalCache value in this script says is only 200 :D

It does not work, it cannot work and server will crash anyway.
TheCarson116 2020 年 10 月 3 日 下午 1:57 
Makes absolutely no sense to me why Gmod (or the Source Engine itself) does this. Does it just not know what to do when hitting the limit so it takes the only option it can think of: crash? (which seems to be the answer to anything half of the time) You'd think Valve would eventually know about such a flaw and fix it, unless they have in newer versions of the Source Engine. (which Gmod doesn't use)
Mashingon 2020 年 9 月 13 日 下午 1:22 
Dado que escanea todos los archivos iniciales, impacta negativamente los tiempos de carga de los mapas?
JλIMICO999 2020 年 8 月 5 日 上午 6:39 
thanks :) :steamhappy:
Case_Dismissed 2020 年 7 月 31 日 下午 1:34 
Any NPC crash prevention
RG 2020 年 7 月 31 日 上午 2:50 
yes damm stop with "you will die" and thank you ButterSteve.
Generic Person 2020 年 7 月 31 日 上午 12:26 
Stop This ♥♥♥♥♥♥ "You Will Die" Spamming Also Where The Hell Did You Get This Crap
Fay  [作者] 2020 年 7 月 28 日 下午 12:49 
@[TUO] Jupiter Update on before - Same effects on a fresh dedicated sandbox server. While the addon's functionality or usability is not changed by this finding, it can now serve as a warning to reload the map. I will add a console warning to do that in the next update. Thank you for reporting it.
Shiuyit. 2020 年 7 月 28 日 上午 10:18 
good
very wawa 2020 年 7 月 28 日 上午 8:01 
reddit moment in the comments
Fay  [作者] 2020 年 7 月 27 日 下午 7:53 
@[TUO] Jupiter I still need to test on a dedicated server, but on single player and p2p servers, changing the map does seem to clear the model cache. On the other hand, r_flushlod crashed me after a few runs, and a quick google search shows others having the same problem, so I can't recommend using that to get around the precache.
✞「יוֹחָנָן」✞ 2020 年 7 月 27 日 下午 5:14 
Big Chungus
Nevasti 2020 年 7 月 27 日 下午 4:37 
Perfect
AMD Radeon™ 386 2020 年 7 月 27 日 下午 4:25 
Big Chungus
mccormick :3 2020 年 7 月 27 日 下午 1:47 
wing dxstroy, stop
IShowFinance 2020 年 7 月 27 日 下午 1:43 
Big Chungus
Fay  [作者] 2020 年 7 月 27 日 上午 11:35 
@[TUO] Jupiter I will have to experiment with r_flushlod and get back to you. I'm on vacation as of right now.
Fay  [作者] 2020 年 7 月 27 日 上午 11:25 
@estrouse77 No, this addon should not slow down the game when you spawn stuff.
Armystuntman 2020 年 7 月 27 日 上午 11:24 
Does r_flushlod have anything to do with this? I put it on my server's startup and it seems to flush the model cache when changing maps (normally, changing maps doesn't clear the cache, only restarting)