• Next Update v4 - March 2016 Update is out!
    1,930 replies, posted
[QUOTE=man with hat;50104822]I know this has been talked about previously, but whatever happened to the idea of having a hook for lua errors? The functionality for detecting errors (and also clientside errors) is already in the game.[/QUOTE] you can do this in a sort of hackily way [lua] local _R = debug.getregistry() OLD_ERROR = OLD_ERROR or _R[1] _R[1] = function(...) pcall(hook.Call, gmod.GetGamemode(), "LuaError", ...) return OLD_ERROR(...) end [/lua]
Anyone else having crashes when you're loading new icons? Like when it starts loading the new icons it's good but after a few seconds my gmod starts crashing and it either bugs out my gmod if it stops or it completely crashes it.
Will there ever be a resource.AddWorkshop that will download content to the server? Currently you can do resource.AddWorkshop for clients, but if the server doesn't have the models that it contains then they often don't work properly. And yes, you can do host workshop collection in command line but this isn't very modular...
[QUOTE=Conna;50106545]Will there ever be a resource.AddWorkshop that will download content to the server? Currently you can do resource.AddWorkshop for clients, but if the server doesn't have the models that it contains then they often don't work properly. And yes, you can do host workshop collection in command line but this isn't very modular...[/QUOTE] No, because addons have to be downloaded and mounted before Lua is started. You do have game.MountGMA though.
[QUOTE=Robotboy655;50106759]No, because addons have to be downloaded and mounted before Lua is started. You do have game.MountGMA though.[/QUOTE] [url]http://wiki.garrysmod.com/page/game/MountGMA[/url] [QUOTE]This function may not exist [B]serverside [/B]in the future.[/QUOTE]
[QUOTE=Bo98;50105184]Lua 5.3 does. LuaJIT (outside FFI) still uses doubles AFAIK so it's 56-bit for integer-like values though I haven't tested it out in GMod.[/QUOTE] Yeah I just confirmed this. I guess storing AccountID wouldn't be as simple as I'd hoped; you'd need to extract the data from a SteamID32 which would complicate things to the point of probably not being worth it.
[QUOTE=zerf;50106883]Yeah I just confirmed this. I guess storing AccountID wouldn't be as simple as I'd hoped; you'd need to extract the data from a SteamID32 which would complicate things to the point of probably not being worth it. (Unless you were already using [URL="https://gist.github.com/zerfgog/a5dfd114b067ea5e84c7#file-steamid_gmod-lua"]a SteamID class[/URL] in which case you could just use sid.accountid ;))[/QUOTE] not that complicated actually [QUOTE=Neat-Nit;50104388][lua]local sid = string.Split(steamid, ":") return sid[3] * 2 + sid[2][/lua][/QUOTE] Edit: and you can add the first bit (STEAM_[u][b]0[/b][/u]:0:9244176) as a 33rd bit like this: [lua]local sid = string.Split(steamid, ":") local firstbit = string.Split(sid[1], "_")[2] return firstbit * 4294967296 + sid[3] * 2 + sid[2][/lua] But uhh, I still didn't test any of this, so I could be wrong.
[QUOTE=Neat-Nit;50106928]not that complicated actually[/QUOTE] Yeah, but undeniably more complicated than a simple arithmetic operation.
[QUOTE=zerf;50106959]Yeah, but undeniably more complicated than a simple arithmetic operation.[/QUOTE] And yet still undeniably [i]less[/i] complicated than: [lua]util.CRC( "gm_" .. steamid .. "_gm" )[/lua] If they add this function to Glua as ply:AccountID() and cache it similar to how UniqueID is cached, I think that would put us on the right track.
[QUOTE=Neat-Nit;50107003]And yet still undeniably [i]less[/i] complicated than: [lua]util.CRC( "gm_" .. steamid .. "_gm" )[/lua] If they add this function to Glua as ply:AccountID() and cache it similar to how UniqueID is cached, I think that would put us on the right track.[/QUOTE] util.CRC relies on the CRC functionality garry added to gmod. If it wasn't there, the accountid would be undeniably [I]less[/I] complicated than the crc. AccountID probably won't need caching. UniqueID wasn't always cached, it was changed to caching because people began using it the same way they used SteamID's and it kept on regenerating the same crc over and over, wasting precious cycles. The caching was kind of a bad decision though because if UniqueID was deprecated and changed to an alternative back then - the collision problem wouldn't exist nowadays.
[QUOTE=MeepDarknessM;50106081]you can do this in a sort of hackily way [lua] local _R = debug.getregistry() OLD_ERROR = OLD_ERROR or _R[1] _R[1] = function(...) pcall(hook.Call, gmod.GetGamemode(), "LuaError", ...) return OLD_ERROR(...) end [/lua][/QUOTE] Does that work with C++ lua errors too? I wish we wouldn't have to do it this hackily. It's strange to me that most of the work to add a hook for something like this is already done yet it still hasn't been added. Am I missing something? Just seems like a waste of a very useful hook.
[QUOTE=Leystryku;50107143]util.CRC relies on the CRC functionality garry added to gmod. If it wasn't there, the accountid would be undeniably [I]less[/I] complicated than the crc. AccountID probably won't need caching. UniqueID wasn't always cached, it was changed to caching because people began using it the same way they used SteamID's and it kept on regenerating the same crc over and over, wasting precious cycles. The caching was kind of a bad decision though because if UniqueID was deprecated and changed to an alternative back then - the collision problem wouldn't exist nowadays.[/QUOTE] That didn't happen then for the same reason it doesn't happen now. When the decision was made to cache the UniqueID, I believe DarkRP already used it in the database. If we go back and start talking about "if only", we should go back right to the start and say that Gary should have known better than to create a function called "UniqueID" that CRCs the SteamID. It's not unique, it's much slower than it needs to be and concatenating the two strings before CRCing makes no sense. Literally everything about UniqueID is bollocks, save for the fact that it generates a 32 bit number, which back then was hailed as super space and search efficient, especially for databases. Having UniqueID generate a reversible number from the SteamID, like zerf's thing, would have been a million times better. UniqueID is a product of Garry's incompetence, and the incompetence of the community to properly call him out on it as we do now.
[QUOTE=man with hat;50107258]Does that work with C++ lua errors too? I wish we wouldn't have to do it this hackily. It's strange to me that most of the work to add a hook for something like this is already done yet it still hasn't been added. Am I missing something? Just seems like a waste of a very useful hook.[/QUOTE] It works with c++ lua errors, and it only occurs on the state it was in. it's used internally in lua_atpanic you can actually modify the error it spits out in console and serverside by changing the arguments you pass to the original function
[QUOTE=ms333;50105890]Anyone else having crashes caused by the weld tool (according to Willox)? I have like a daily crash with more or less the same crash log. Here's a collection of crash logs + logs of welding if anyone would be so kind to take a look:[/QUOTE] Some entities will spaz out and crash if they are welded. npc_grenade_frag for example. RobotBoy's lightsabers also might be a candidate but not sure.
[QUOTE=thegrb93;50107915]Some entities will spaz out and crash if they are welded. npc_grenade_frag for example. RobotBoy's lightsabers also might be a candidate but not sure.[/QUOTE] nope, i weld them to the handlebars of scars motorbikes and ride around decapitating people, its never caused a crash for me it could maybe be somebody attacking your server, have you pissed off any minges recently?
[QUOTE=legendofrobbo;50108861]nope, i weld them to the handlebars of scars motorbikes and ride around decapitating people, its never caused a crash for me it could maybe be somebody attacking your server, have you pissed off any minges recently?[/QUOTE] No, there's just been many instances where I've looked at the logs where the server has crashed and someone was welding lightsabers to a jeep.
[QUOTE=thegrb93;50109673]No, there's just been many instances where I've looked at the logs where the server has crashed and someone was welding lightsabers to a jeep.[/QUOTE] Might be related to the OS the server runs on?
Whenever i get "GetLuaTable !=" something something, i get bugged from server and i can't join because it thinks im in it and says "STEAM validation rejected". :/
-snip- im a big dumby, found a thread on the animation thing
Does anyone else experience random colliding physics lying around?
[QUOTE=Darrell;50113794]Does anyone else experience random colliding physics lying around?[/QUOTE] Do we have to go over this again? Remove the physics objects if you SetParent.
[QUOTE=Robotboy655;50113849]Do we have to go over this again? Remove the physics objects if you SetParent.[/QUOTE] I have no parented objects. I have nothing more than automatic spawned entities without child entities. I also have this issue with auto spawned prop_physics which I froze at a location with SetMoveType(MOVETYPE_NONE). The prop freezes. The physics object doesn't and starts fucking around. If I remove the physics object, the prop doesn't block anymore.
[QUOTE=Darrell;50113972]I have no parented objects. I have nothing more than automatic spawned entities without child entities. I also have this issue with auto spawned prop_physics which I froze at a location with SetMoveType(MOVETYPE_NONE). The prop freezes. The physics object doesn't and starts fucking around. If I remove the physics object, the prop doesn't block anymore.[/QUOTE] That's not really a good way of freezing props, this is: [url]http://wiki.garrysmod.com/page/PhysObj/EnableMotion[/url]
Then I know where my random physics objects came from. How come that an entity has two physic objects?
[QUOTE=Darrell;50114247]Then I know where my random physics objects came from. How come that an entity has two physic objects?[/QUOTE]If it's a ragdoll or something more complex. [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/GetPhysicsObjectCount]Entity:GetPhysicsObjectCount[/url]
Oh, this is a thing now? :dance: [img]https://i.gyazo.com/a071c6c472a92f0ff2e661c94fc04552.png[/img] [B]Edit:[/B] Why are you rating me late? The prerelease branch wasn't there before, and AFAIK no one's mentioned it...
Sweet, now we just need a mailing list or something of the sort to know when a release candidate is released and when it's scheduled to be live
[url]http://steamcommunity.com/games/garrysmod/announcements/detail/888708186352713337[/url]
I SAW THE POPUP! YES! Good work!
Did something change to how entities are loaded? I loaded up a project I was working on before updates and files aren't loading how they did before. structure: [code] entities/entities/myentity/cl_init.lua entities/entities/myentity/shared.lua entities/entities/myentity/init.lua [/code] Before [I]cl_init[/I] and [I]init[/I] would be ran on the server and client automatically and now [I]shared[/I] and [I]init[/I] are ran automatically. Usually shared would by the two other files. What's weird is that one time I launched garrysmod and I was offline or something (my steamid was STEAM_0:0:0, happens sometimes) and it worked then but never before or after when my steamid was my steamid. Any ideas?
Sorry, you need to Log In to post a reply to this thread.