• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
[QUOTE=rebel1324;46696962]I searched whole sandbox, there was no .Control[/QUOTE] [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/includes/modules/menubar.lua[/url]
[QUOTE=Author.;46697222]How do you use the drag n drop library in Garry's Mod? Has someone done a tutorial on it, or are there any examples anywhere?[/QUOTE] I'll write one up on the wiki in a few minutes, will update this post when I do so. [editline]12th December 2014[/editline] [url]http://wiki.garrysmod.com/page/dndtutorial[/url]
[QUOTE=arcaneex;46697518]I'll write one up on the wiki in a few minutes, will update this post when I do so. [editline]12th December 2014[/editline] [url]http://wiki.garrysmod.com/page/dndtutorial[/url][/QUOTE] Stop with the shitty names please, ok? [url]http://wiki.garrysmod.com/page/Drag_and_Drop_for_VGUI[/url]
Didn't know it was title, just url my bad
Would there be possible to create some sort of gaussian blur?
[QUOTE=Author.;46699713]Would there be possible to create some sort of gaussian blur?[/QUOTE] Material("pp/blur") Try this.
[lua] function ENTITY:InSight() return LocalPlayer():IsLineOfSightClear(self) end [/lua] For some reason this doesn't play nice with doors. Is there any better way to do sight checks without doing traces every frame? [t]http://i.gyazo.com/66e563d3d71a3fc043c245c99f37aead.png[/t]
[QUOTE=StonedPenguin;46703054][lua] function ENTITY:InSight() return LocalPlayer():IsLineOfSightClear(self) end [/lua] For some reason this doesn't play nice with doors. Is there any better way to do sight checks without doing traces every frame? [t]http://i.gyazo.com/66e563d3d71a3fc043c245c99f37aead.png[/t][/QUOTE] I'm pretty sure traces are light enough to do every frame. Any other reason you don't want to use them?
[QUOTE=Sereni;46703261]I'm pretty sure traces are light enough to do every frame. Any other reason you don't want to use them?[/QUOTE] Multiply that by 50+ players/entities in an area per frame and it adds up.
There isn't really a way to do it without traces if you want accurate results, though. Entities don't block LOS when determining visibility ( except areaportals ). This is how the engine handles checking visibility: [code]bool CBaseCombatCharacter::FVisible( CBaseEntity *pEntity, int traceMask, CBaseEntity **ppBlocker ) { VPROF( "CBaseCombatCharacter::FVisible" ); if ( traceMask != MASK_BLOCKLOS || !ShouldUseVisibilityCache() || pEntity == this #if defined(HL2_DLL) || Classify() == CLASS_BULLSEYE || pEntity->Classify() == CLASS_BULLSEYE #endif ) { return BaseClass::FVisible( pEntity, traceMask, ppBlocker ); } VisibilityCacheEntry_t cacheEntry; if ( this < pEntity ) { cacheEntry.pEntity1 = this; cacheEntry.pEntity2 = pEntity; } else { cacheEntry.pEntity1 = pEntity; cacheEntry.pEntity2 = this; } int iCache = g_VisibilityCache.Find( cacheEntry ); if ( iCache != g_VisibilityCache.InvalidIndex() ) { if ( gpGlobals->curtime - g_VisibilityCache[iCache].time < VIS_CACHE_ENTRY_LIFE ) { bool bCachedResult = !g_VisibilityCache[iCache].pBlocker.IsValid(); if ( bCachedResult ) { if ( ppBlocker ) { *ppBlocker = g_VisibilityCache[iCache].pBlocker; if ( !*ppBlocker ) { *ppBlocker = GetWorldEntity(); } } } else { if ( ppBlocker ) { *ppBlocker = NULL; } } return bCachedResult; } } else { if ( g_VisibilityCache.Count() != g_VisibilityCache.InvalidIndex() ) { iCache = g_VisibilityCache.Insert( cacheEntry ); } else { return BaseClass::FVisible( pEntity, traceMask, ppBlocker ); } } CBaseEntity *pBlocker = NULL; if ( ppBlocker == NULL ) { ppBlocker = &pBlocker; } bool bResult = BaseClass::FVisible( pEntity, traceMask, ppBlocker ); if ( !bResult ) { g_VisibilityCache[iCache].pBlocker = *ppBlocker; } else { g_VisibilityCache[iCache].pBlocker = NULL; } g_VisibilityCache[iCache].time = gpGlobals->curtime; return bResult; }[/code] The only real option we have to is to do a trace and experiment with the mask to see what fits your usage case the best.
If I want to create a stamina system (sprint system) what hook should I use?
Is there a way to get all the constraints connected to the world? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/constraint/GetTable]constraint.GetTable[/url] doesn't return anything for the world.
[QUOTE=Klaes4Zaugen;46704357]If I want to create a stamina system (sprint system) what hook should I use?[/QUOTE] You'd use SetupMove for everything.
[QUOTE=highvoltage;46704722]Is there a way to get all the constraints connected to the world? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/constraint/GetTable]constraint.GetTable[/url] doesn't return anything for the world.[/QUOTE] All constraints are entities, scan for them.
Now when I press the F3 menu pops up, but then i added this and everything stopped working [code]// // F3 Menu function // local function OpenF3Menu( _p ) local _panel = vgui.Create( "DFrame" ); _panel:SetSize( 400, 200 ); _panel:Center( ); _panel:SetTitle( "test frame1" ); _panel:MakePopup( ); --[[ local button1 = vgui.Create( "DButton" ); button1:SetParent( _panel ); button1:SetText( "Go Heavy" ); button1:SetPos( 25, 50 ); button1:SetSize( 150, 40 ); button1.DoClick = function( ) ply:StripWeapons() ply:Give("cw_bf4_m249") ply:Give("cw_deagle") ply:Give("weapon_oic_knife") ply:Armor(100) end; local button2 = vgui.Create( "DButton" ); button2:SetParent( _panel ); button2:SetText( "Go Assault" ); button2:SetPos( 225, 50 ); button2:SetSize( 150, 40 ); button2.DoClick = function( ) ply:StripWeapons() ply:Give("cw_g3a3") ply:Give("cw_deagle") ply:Give("weapon_oic_knife") ply:Armor(100) end; local button3 = vgui.Create( "DButton" ); button3:SetParent( _panel ); button3:SetText( "Get equipment" ); button3:SetPos( 25, 100 ); button3:SetSize( 150, 40 ); button3.DoClick = function( ) local menu1 = vgui.Create( "DMenu", button3 ); menu1:AddOption( "test0" ); menu1:AddOption( "test1" ); menu1:AddOption( "test2" ); menu1:AddOption( "test3" ); menu1:AddOption( "test4" ); menu1:AddSpacer( ); local submenu1 = menu1:AddSubMenu( "attachments" ); submenu1:AddOption( "test5" ); submenu1:AddOption( "test6" ); menu1:Open( ); end;]] end[/code] When I do this everything is broken, no one respawns anymore, no script error tho. Is anything broken besides the fact that most of the code is commented out?
Does 'changelevel' console command reload the gamemode after map has changed? Thanks.
[QUOTE=!!!WARLOCK!!!;46705062]Does 'changelevel' console command reload the gamemode after map has changed? Thanks.[/QUOTE] yes
what is causing this error: [CODE] [ERROR] lua/includes/modules/net.lua:172: net.ReadType: Couldn't read type 24 1. error - [C]:-1 2. ReadType - lua/includes/modules/net.lua:172 3. ReadType - lua/includes/modules/net.lua:112 4. ReadType - lua/includes/modules/net.lua:116 5. ReadType - lua/includes/modules/net.lua:116 6. ReadTable - lua/includes/modules/net.lua:116 [/CODE] And how ti fix it?
Don't write unsupported variable types like functions.
How to get size of docked panel panel:Dock(FILL) panel:GetSize() -- returns some static numbers I cannot remember something like 68 and 24 regardless of size of docked panel, help
[QUOTE=arcaneex;46706189]How to get size of docked panel panel:Dock(FILL) panel:GetSize() -- returns some static numbers I cannot remember something like 68 and 24 regardless of size of docked panel, help[/QUOTE] Make sure to have a delay before you call GetSize(). Why do you even need GetSize with docking?
Call InvalidateLayout before GetSize I guess
This is probably pathetically obvious, but what's the easiest way to retrieve data from a server onto a webpage? (e.g. use TTT hooks to send and display what round a server is at on your website)
[QUOTE=zeaga;46706357]This is probably pathetically obvious, but what's the easiest way to retrieve data from a server onto a webpage? (e.g. use TTT hooks to send and display what round a server is at on your website)[/QUOTE] Depending on the type of data, your ability to code and what restrictions you have on binary files you can install to your server. Sockets with a 3rd party module. MySQL with a 3rd party module. The http Lua library.
I'm making an inventory addon which shows weapon info on hover, stuff like damage, spread, recoil etc One problem is that I cannot possibly adapt to all weapon packs out there, soe use weapon.Primary.Cone others weapon.Primary.Spread others weapon.Spread and so on. It's either I try my best to check for all possible variations and worst case scenario I display 0 or NaN instead of real value which will confuse users or I will let the server owner specify the values. First option will confuse users, second option well what are the chances of a 12 year old server owner know the spread of every weapon in a weapon pack (m9k or whatever) Rate [IMG]http://www.facepunch.com/fp/ratings/tick.png[/img] for first option, [IMG]http://www.facepunch.com/fp/ratings/cross.png[/IMG] for second or just post whatever you think.
Does anyone know how to set up FPP so that physgunned props are ghosted until you let go of them?
[QUOTE=arcaneex;46706790]I'm making an inventory addon which shows weapon info on hover, stuff like damage, spread, recoil etc One problem is that I cannot possibly adapt to all weapon packs out there, soe use weapon.Primary.Cone others weapon.Primary.Spread others weapon.Spread and so on. It's either I try my best to check for all possible variations and worst case scenario I display 0 or NaN instead of real value which will confuse users or I will let the server owner specify the values. First option will confuse users, second option well what are the chances of a 12 year old server owner know the spread of every weapon in a weapon pack (m9k or whatever) Rate [IMG]http://www.facepunch.com/fp/ratings/tick.png[/img] for first option, [IMG]http://www.facepunch.com/fp/ratings/cross.png[/IMG] for second or just post whatever you think.[/QUOTE] [code]txt = x.Primary.Spread or x.Primary.Cone or x.Spread or "?"[/code] Just test the most common and then give a default label.
That is what I was planning to do if I went with option 1 but still, I cannot cater for every possible weapon out there and ? might confuse players.
So, I typed "-dxlevel 9" into the launch options for the game (Since I was experincing invisble playermodels, specifically after entering Scars) , but when I entered the game after this, the game went into the most downscaled resolution and crashed naturally, I went back to the properties, and got rid of that textline, and everything went back to normal, exept for the fact that I have to hold down the "`" key to get to the dev console, and while playing, pressing it simply crashes the game. do any of you guys know how to get rid of this problem Its making Gmod unplayable
[QUOTE=Lord of Boxes;46708403]So, I typed "-dxlevel 9" into the launch options for the game (Since I was experincing invisble playermodels, specifically after entering Scars) , but when I entered the game after this, the game went into the most downscaled resolution and crashed naturally, I went back to the properties, and got rid of that textline, and everything went back to normal, exept for the fact that I have to hold down the "`" key to get to the dev console, and while playing, pressing it simply crashes the game. do any of you guys know how to get rid of this problem Its making Gmod unplayable[/QUOTE] Try starting the game with -console i guess. [editline]hi[/editline] Also, please don't post issues like this here, post it in "Help & Support".
Sorry, you need to Log In to post a reply to this thread.