• Problems That Don't Need Their Own Thread v5
    4,111 replies, posted
Your Think hook is applying a high upward velocity
Had table for each player that contains more than 40 variables(most of integers, some booleans and two strings). I looked for PVS problem and just use SetNW2 variables. They work very fine and no problems with them. But... How NW variables work(same as send player movement, actions?)? Why better to use net library and how net send data(queue, packets,algorithm)? What I should use if need network one variable? And if more than 30?
Anyone know where the default gmod fonts are located? I like one of them, however I want to do some slight modifications to it.
[QUOTE=fourny;51905521]Anyone know where the default gmod fonts are located? I like one of them, however I want to do some slight modifications to it.[/QUOTE] Not sure where they are located, but there's a page on the wiki: [url]http://wiki.garrysmod.com/page/Default_Fonts[/url]
[QUOTE=fourny;51905521]Anyone know where the default gmod fonts are located? I like one of them, however I want to do some slight modifications to it.[/QUOTE] /resource/fonts iirc
[QUOTE=Promptitude;51905560]Not sure where they are located, but there's a page on the wiki: [url]http://wiki.garrysmod.com/page/Default_Fonts[/url][/QUOTE] Yeah I saw that. I'm just wondering where they are being created, because I wanted to rip the font code and modify it. [QUOTE=txike;51905564]/resource/fonts[/QUOTE] Thanks, I'll check when I'll get home. Didn't want to make a new post. I'm explaining this terribly I guess. Disregard my posts, I've found what I'm looking for.
Search the wiki for "surface.CreateFont", although I highly believe most of these fonts were created in the engine. Just create your own fonts?
Hi everyone, it seems like the hook event Think and Tick are not passed as argument to hook.Call [CODE] local oldHookCall = hook.Call function hook.Call( name, ...) if name == "Think" then print("Think!") end return oldHookCall( name, ...) end -- Doesn't print anything... [/CODE] Any idea on how to catch a think without using the hook table ? Thanks :)
Huh?? Why not hook.Add("Think", "some identifier", function() print("Think!") end)?
[QUOTE=NeatNit;51906110]Huh?? Why not hook.Add("Think", "some identifier", function() print("Think!") end)?[/QUOTE] As I said, I don't want to use the hook table, hook.Add is the equivalent of [CODE] hook.GetTable()["Think"]["some identifier"] = function() print("Think") end [/CODE]
[QUOTE=Deepsy02;51906139]As I said, I don't want to use the hook table, hook.Add is the equivalent of [CODE] hook.GetTable()["Think"]["some identifier"] = function() print("Think") end [/CODE][/QUOTE] You never said that, also `Think` and `Tick` are called from the engine, so they aren't called by hook.Call. Going off what the wiki says about [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/gamemode/Call]gamemode.Call[/url], you may be able to use that.
[QUOTE=bigdogmat;51906159]snip[/QUOTE] [CODE] local oldGMCall = gamemode.Call function gamemode.Call( name, ...) if name == "Think" then print("Think!") end return oldGMCall( name, ...) end [/CODE] It doesn't print anything EDIT: 'without using the hook table' may be not clear enough but I said it...
[QUOTE=Deepsy02;51906197][CODE] local oldGMCall = gamemode.Call function gamemode.Call( name, ...) if name == "Think" then print("Think!") end return oldGMCall( name, ...) end [/CODE] It doesn't print anything[/QUOTE] Then you're shit out of luck. May I ask why you're trying to do this, and not using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/hook/Add]hook.Add[/url] like any other person?
I'm trying to make a kind of hook priority system, kinda like uLib ([url]https://github.com/Nayruden/Ulysses/blob/master/ulib/lua/ulib/shared/hook.lua[/url]) I can't find a way to handle Think/Tick based hooks
Could run before autorun and override hook.Add
[QUOTE=TFA;51906850]Could run before autorun and override hook.Add[/QUOTE] You'd have to load after hook.lua to override it effectively.
[QUOTE=bigdogmat;51906159]`Think` and `Tick` are called from the engine, so they aren't called by hook.Call.[/QUOTE] This isn't accurate. They [i]do[/i] use hook.Call, but they only grab the function once after it's loaded and just cache it. Because of this, using something like this won't work: [lua]local oldcall = hook.Call function hook.Call(...) print("text") oldcall(...) end[/lua] But actually editing the hook.lua file WILL work. Deepsy02, I sort of see what you mean. I do sometimes want to have a "pre-hook" or a "post-hook", but unfortunately that doesn't really exist (never looked at ulib). However, if you could specify an example of why you need this, maybe we can help you reach your desired goal using the existing tools that are available.
[QUOTE=Deepsy02;51906062]Hi everyone, it seems like the hook event Think and Tick are not passed as argument to hook.Call [CODE] ... [/CODE] Any idea on how to catch a think without using the hook table ? Thanks :)[/QUOTE] You have to find the hook in the registry and replace the value there. I haven't used this code in a while but I gave this to someone in the past and it worked for them to detour the cached value: [code] function FindHookCall(tbl, _g, _hook_Call, _checked) _g = _g or _G _hook_Call = _hook_Call or _g.hook.Call _checked = _checked or {} _checked[tbl] = true local _next = {} for k, v in pairs(tbl) do if v == _hook_Call then return tbl, k, v elseif type(v) == "table" and v ~= _g and not _checked[v] then table.insert(_next, v) end end for _, n in ipairs(_next) do local t, k, v = FindHookCall(n, _g, _hook_Call, _checked) if t then return t, k, v end end return nil, nil, nil end local table, key, value = FindHookCall(debug.getregistry()) PrintTable({ table=tostring(table), key=key, value=value }) print(value == hook.Call) local function detour(name, ...) print(name) return value(name, ...) end table[key] = detour [/code]
[code] local window = vgui.Create( "DFrame" , nil , "Frame" ) [/code] I am making a parent DFrame, but for some reason when I start a singleplayer game the menu doesn't open, it gives these errors in console instead. [code] Warning: vgui.Create failed to create the VGUI component (DFrame) [ERROR] addons/chooseafaction/lua/autorun/client/cl_chooseafaction.lua:5: attempt to index local 'window' (a nil value) 1. unknown - addons/chooseafaction/lua/autorun/client/cl_chooseafaction.lua:5 [/code] Even though I defined it on Line 4. If I save the file again, the error seems to go away and the menu appears. Quite strange error... Note: I make no change when I resave the file.
Make it in a hook. Creating it in the file is too early.
How can I get a table of all registered ammo types?
[QUOTE=Moat;51911414]you shouldn't have to[/QUOTE] but I want to, I want to both use values stored by ammodata and change values stored by it as well.
[QUOTE=arow1234;51911467]but I want to, I want to both use values stored by ammodata and change values stored by it as well.[/QUOTE] game.BuildAmmoTypes will return the table.
[QUOTE=code_gs;51911482]game.BuildAmmoTypes will return the table.[/QUOTE] I tried PrintTable( game.BuildAmmoTypes() ) but nothing is printed, if I do print( game.BuildAmmoTypes() ) it shows a table exists, does the table it returns only contain user defined ammotypes? -EDIT- forgot to () my functions...
According to "lua/includes/extensions/game.lua", game.BuildAmmoTypes only prints used defined ammotypes, what about default ones? Would those be hardcoded?
--snip--
I want to make materials reflect .. but whatever I do it won't work. Somehow made a skybox material tho: [media]https://youtu.be/Of60UN-Yu98[/media] [code] -- Doesn't work -- mat:SetTexture("$REFLECTBLENDFACTOR","0.4") mat:SetTexture("$reflectamount","3.0") mat:SetTexture("$envmap","env_cubemap") mat:SetTexture("$reflectamount","0.2") mat:SetTexture("$reflectentities", "1") mat:SetTexture("$refracttexture","_rt_WaterRefraction") mat:SetTexture("$reflecttint","[1 1 1]") mat:SetTexture("$bumpmap","dev/water_dudv") mat:SetTexture("$normalmap","dev/water_normal")[/code] Any idea how to achieve a reflect effect on the fly?
Why do you use SetTexture instead of SetFloat/SetInteger/etc? Either way, what kind of reflection do you hope to achieve? Because you probably can't have perfect reflections that easily, Source isn't that fancy (at least not in gmod's version of Source)
I want create radar, but I don't know, how to blur edges. I created topic, but no one doesn't reply my question. [url]https://facepunch.com/showthread.php?t=1554522[/url] I'd like create like this: [IMG]https://pp.userapi.com/c622526/v622526985/40efe/MJfwXqg2-xU.jpg[/IMG]
[QUOTE=NeatNit;51912503]Why do you use SetTexture instead of SetFloat/SetInteger/etc? Either way, what kind of reflection do you hope to achieve? Because you probably can't have perfect reflections that easily, Source isn't that fancy (at least not in gmod's version of Source)[/QUOTE] Didn't know I could use SetFloat/SetInteger, but I'm trying to get some sort of "rain" effect. Darken the material and hopefully achieve some sort of reflection.
Sorry, you need to Log In to post a reply to this thread.