• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
[QUOTE=Tomelyr;46144911]the easiest way imo would be writing an php script that connects with sourcequery to the server and give it out as json. some http.fetch and you got your information. the other way would be to fix an lua socket implementation. the only one that was updated while gmod 13, should be [URL="http://facepunch.com/showthread.php?t=1234005&p=38898327#post38898327"]gLuaSock2[/URL][/QUOTE] Yeah thats out of my knowledge range, oh well.
How do you get all nodes in a DTree? I tried doing DTree.Items.
[QUOTE=Author.;46148541]How do you get all nodes in a DTree? I tried doing DTree.Items.[/QUOTE] dtree.RootNode.ChildNodes
[vid]http://a.pomf.se/xwxuqm.mp4[/vid] Ragdolls aren't' being interpolated. Why?
I am making a custom gamemode. The prop spawn menu isn't opening when you hold down Q. I am not really sure what is necessary to have it open. I have seen there are hooks for:SpawnMenuEnabled, and SpawnMenuOpen, but am not really sure what I need to do with these. Can someone clarify?
[QUOTE=john55223;46149932]I am making a custom gamemode. The prop spawn menu isn't opening when you hold down Q. I am not really sure what is necessary to have it open. I have seen there are hooks for:SpawnMenuEnabled, and SpawnMenuOpen, but am not really sure what I need to do with these. Can someone clarify?[/QUOTE] You need Sandbox as a base to get the spawnmenu.
[QUOTE=Ott;46149939]You need Sandbox as a base to get the spawnmenu.[/QUOTE] [code] "mcr" { "base" "sandbox" "title" "2014 City Roleplay" "version" "1.1" "menusystem" "1" "author_name" "john55223" "author_email" "" "author_url" "" "icon" "" "info" "" "hide" "0" } [/code] Thanks Ott. I have added sandbox as a base, as you can see above, and there is still no spawn menu when i hold down q. Would I have to call the SpawnMenuOpen hook when the player holds down the q key?
[URL="http://wiki.garrysmod.com/page/Global/DeriveGamemode"]DeriveGamemode()[/URL]
[QUOTE=Ott;46149793][vid]http://a.pomf.se/xwxuqm.mp4[/vid] Ragdolls aren't' being interpolated. Why?[/QUOTE] I love Hall of Meat, best part about Skate
What the fuck? cl_player.lua [lua]4: ply:GetNWBool( "Poisoned", false )[/lua] [code][ERROR] gamemodes/containment/gamemode/cl_player.lua:4: attempt to call method 'GetNWBool' (a nil value) 1. Poisoned - gamemodes/containment/gamemode/cl_player.lua:4 2. CalculateBeat - gamemodes/containment/gamemode/hud/heartrate.lua:89 3. Think - gamemodes/containment/gamemode/hud/heartrate.lua:183 4. v - gamemodes/containment/gamemode/hud/heartrate.lua:246 5. unknown - lua/includes/modules/hook.lua:84[/code]
That's weird. ply is defined right?
line 1 local ply = FindMetaTable("Player") however, in clientside I have a suspicion I should be using LocalPlayer()???
[QUOTE=WalkingZombie;46150320]line 1 local ply = FindMetaTable("Player") however, in clientside I have a suspicion I should be using LocalPlayer()???[/QUOTE] if it's in a meta function, use self:, not ply.
What are you doing? FindMetaTable returns a metatable applied to all players, not an actual player object. Yes, you should be using LocalPlayer()
[QUOTE=Tomelyr;46150117][URL="http://wiki.garrysmod.com/page/Global/DeriveGamemode"]DeriveGamemode()[/URL][/QUOTE] Now that I have derived from sandbox, I get these wonderful errors from the sandbox gamemode whenever I join my server. [code] [ERROR] gamemodes/sandbox/gamemode/cl_hints.lua:18: attempt to call method 'AddNotify' (a nil value) 1. ThrowHint - gamemodes/sandbox/gamemode/cl_hints.lua:18 2. unknown - gamemodes/sandbox/gamemode/cl_hints.lua:32 Timer Failed! [HintSystem_Annoy1][@gamemodes/sandbox/gamemode/cl_hints.lua (line 32)] [ERROR] gamemodes/sandbox/gamemode/cl_hints.lua:18: attempt to call method 'AddNotify' (a nil value) 1. ThrowHint - gamemodes/sandbox/gamemode/cl_hints.lua:18 2. unknown - gamemodes/sandbox/gamemode/cl_hints.lua:32 Timer Failed! [HintSystem_OpeningMenu][@gamemodes/sandbox/gamemode/cl_hints.lua (line 32)] [/code] And I am still not getting this spawnmenu, however I believe this error is related to the spawn menu... somehow. I'm such a newb. Thanks for your time tomelyr and ott
Use [URL="http://wiki.garrysmod.com/page/notification/AddLegacy"]notification.AddLegacy[/URL] insteed, [URL="https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/gamemode/cl_notice.lua"]since AddNotify is just a wrapper for it[/URL] edit:// Also use DeriveGamemode on an shared and keep the sandbox in your txt.
[QUOTE=HumbleTH;46150389]if it's in a meta function, use self:, not ply.[/QUOTE] Wow... I can't even believe... it's been maybe 3 months since I've worked on the gamemode directly, and I've already forgotten that? :tinfoil: [editline]4th October 2014[/editline] Oh, so weak... now, when the player's health hits or drops below 0, they don't die... but if I use the KILL command, the game locks up and, if full screen, can not be ended unless I log out. I have no idea how this could possibly have been caused!
[QUOTE=Tomelyr;46150589]Use [URL="http://wiki.garrysmod.com/page/notification/AddLegacy"]notification.AddLegacy[/URL] insteed, [URL="https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/gamemode/cl_notice.lua"]since AddNotify is just a wrapper for it[/URL] edit:// Also use DeriveGamemode on an shared and keep the sandbox in your txt.[/QUOTE] I don't understand what I would be using notification.addlegacy for.... I am not doing anything to the sandbox gamemode, and am not quite sure why the error is showing up.
Change Gamemode:AddNotify to notification.AddLegacy, since they both got the same args.
[QUOTE=Tomelyr;46151831]Change Gamemode:AddNotify to notification.AddLegacy, since they both got the same args.[/QUOTE] Thanks, now the sandbox notifs popup, however, there is still no spawn menu :(
[t]https://dl.dropboxusercontent.com/u/17839069/C_177.png[/t] Can someone explain to me exactly why the distance buffer warps the textures like this? I mean, I know it's just the engine but I'm curious what is causing this exactly. [I]No Mipmaps, No Depth Buffer, No LOD[/I] and [I]NoNice[/I] texture parameters have no effect. I am also scaling down the texture size from default 0.25 to 0.05, might be the reason why it's so warpy. I'm trying to combat this.
[QUOTE=EthanTheGreat;46153261][t]https://dl.dropboxusercontent.com/u/17839069/C_177.png[/t] Can someone explain to me exactly why the distance buffer warps the textures like this? I mean, I know it's just the engine but I'm curious what is causing this exactly. [I]No Mipmaps, No Depth Buffer, No LOD[/I] and [I]NoNice[/I] texture parameters have no effect. I am also scaling down the texture size from default 0.25 to 0.05, might be the reason why it's so warpy. I'm trying to combat this.[/QUOTE] This is mipmap/filtering issue. The engine is trying to draw every pixel of the texture into more than one pixel.
[QUOTE=vexx21322;46153507]This is mipmap/filtering issue. The engine is trying to draw every pixel of the texture into more than one pixel.[/QUOTE] Makes sense. Hmmm... It seems to retain [B]ALL[/B] of it's detail even when rendered at 0.05 instead of the default 0.25 [QUOTE=Valve, on their own wiki ;2] For each frame and face, the VTF file contains both the basic original source-image data (pixel map) and a series of mipmaps used for rendering the texture over varying distances. Because each successive mipmap is exactly 1/2 the dimension (height and width) of the previous one, the source-image dimensions must be powers of 2. Although the source-image may be rectangular, square mipmaps are stored more efficiently in the VTF. [B]Source: [url]https://developer.valvesoftware.com/wiki/VTF[/url][/B] [/QUOTE] Which means that within each VTF file, there's storage of lower resolution textures for the LOD (loss of detail). When you're up close to the texture (at 0.05), it's rendered at it's full detail. As you make your way further from the plane, shouldn't it be doing something like this: [t]https://dl.dropboxusercontent.com/u/17839069/C_178.png[/t] If it does that properly, why should it be the case that it's struggling to render more then one pixel(On the texture) to screen pixels when the scale is down to 0.05? What I'm trying to understand is why 0.25 (run at full detail) vs. 0.05 (run at full detail) has two different outcomes if each process is done the same way. Here is the texture at full detail: [t]https://dl.dropboxusercontent.com/u/17839069/C_179.png[/t] [B]EDIT:[/B] I compiled a map to give an example: [t]https://dl.dropboxusercontent.com/u/17839069/C_180.png[/t] One on the left is 0.05, one on the right is 0.25. Looking away from it adds detail: [t]https://dl.dropboxusercontent.com/u/17839069/C_182.png[/t] Vs looking directly at it: [t]https://dl.dropboxusercontent.com/u/17839069/C_181.png[/t] Smallest MipMap Size has no effect on the buffer: [t]https://dl.dropboxusercontent.com/u/17839069/C_183.png[/t]
[QUOTE=WalkingZombie;46150642]Wow... I can't even believe... it's been maybe 3 months since I've worked on the gamemode directly, and I've already forgotten that? :tinfoil: [editline]4th October 2014[/editline] Oh, so weak... now, when the player's health hits or drops below 0, they don't die... but if I use the KILL command, the game locks up and, if full screen, can not be ended unless I log out. I have no idea how this could possibly have been caused![/QUOTE] Use DamageInfo( ) and pass the product ( after setting up the damage ) to Entity:TakeDamageInfo( _dmginfo ) It'll handle Kill on <= 0 health. If you just SetHealth, it won't kill for you.
Quick question. I'm making a hud using DrawTexturedRectUV. I finally got it working, in a way. The way I've got it is that is cuts the image depending on the health. The image cuts, however it cuts from the bottom to the top. How can I get it to cut from top to bottom? I've tried a bunch of things but nothing has worked correctly, only got the bottom to top one to work flawlessly... [lua] local HP = LocalPlayer():Health() / 100 surface.SetTexture(surface.GetTextureID("Outcast_Gamemode/HUD/Heart")) surface.SetDrawColor( 255, 255, 255, 255 ); surface.DrawTexturedRectUV( 0, ScrH()-64, 64, 64 * HP, 0, 0, 1, HP) [/lua]
[url=http://wiki.garrysmod.com/page/surface/DrawTexturedRectUV]Your UV coords are messed up[/url] [quote]Draws a textured rectangle with a repeated or partial texture. U and V refer to texture coordinates. 0,0 is the bottom left corner of the texture, 1,0 is the bottom right, 1,1 is the top right and 0,1 is the top left.[/quote] So it probably should be: [code].., 64 * HP, 0, 1, 1, 1 - HP )[/code] This assumes that HP is a float between 0 and 1 ( and clamped ).
[QUOTE=Kogitsune;46156174][url=http://wiki.garrysmod.com/page/surface/DrawTexturedRectUV]Your UV coords are messed up[/url] So it probably should be: [code].., 64 * HP, 0, 1, 1, 1 - HP )[/code] This assumes that HP is a float between 0 and 1 ( and clamped ).[/QUOTE] Well, that turned my texture upside down but it didn't change the way it's being cut.
Ah, I misread. If you want it to clip down rather than up, you'd probably need to change the start uv rather than the end. [code], 0, 1 - HP, 1, 0 )[/code] Give that a whirl
Is it possible to load a local html file? [editline]a[/editline] into dhtml that is [editline]a[/editline] Yes, appears asset:// loads the root through GAME.
Nothing too code wise but wanted to try something new... Where do you get weapon models to turn into sweps? I'd like to try from scratch without having to do the modeling?
Sorry, you need to Log In to post a reply to this thread.