What's the file name/location for missing textures? (Black & Purple)
I know I can just point to a non-existing file if I want a missing texture but I figured it'd be nicer to use the actual one
[QUOTE=JasonMan34;49706305]What's the file name/location for missing textures? (Black & Purple)
I know I can just point to a non-existing file if I want a missing texture but I figured it'd be nicer to use the actual one[/QUOTE]
debug/debugempty.vtf
[QUOTE=Deepnox;49705969]Then call hook.Remove("HUDPaint", "xxx") whenever I want to remove the HUD to use the other one?![/QUOTE]
If your HUDs aren't too expensive, you could just have a parent element for each HUD and in the HUDPaint hook just check which one should be drawn and set it visible/invisible based on that.
[QUOTE=Swagman1337;49706226]I'm trying to make a custom slider without using DNumSlider so I can make it look nice[/QUOTE]
You can repaint all the elements in DNumSlider already FYI.
I remember there being some way to prevent the yellow speaker from showing over talking players' heads. Anyone have the answer?
[QUOTE=Deepnox;49705969]I've got quick question;
My gamemode has two mode (Build/Match)
I would like to make one HUD for the Build and another one for the Match mode.
Do I have to use:
[CODE]hook.Add ("HUDPaint", "xxx", function () end)[/CODE]
Then call hook.Remove("HUDPaint", "xxx") whenever I want to remove the HUD to use the other one?!
Or should I make functions that uses vgui.Create("DFrame") and then use the Paint function to draw anything then call the functions of each HUD whenever I want to use the called one? (So it basically draw the created DFrame)
Thanks[/QUOTE]
As far as I know, HUDPaint redraws everything every time the hook is executed, so you can just use an if/else block. Anything you put inside will only be drawn if the condition is true.
[CODE]
hook.Add ("HUDPaint", "drawhud", function ()
if (mode == 1) then
-- Build Hud
else
-- Match Hud
end
end)
[/CODE]
I've got backgrounds and text being drawn using cam.Start3D2D in multiple mediums (PostDrawTranslucentRenderables, PostDrawOpaqueRenderables, etc). Here's an example of 2 black backgrounds being rendered with some text on each (out of view on the left):
[IMG]https://i.gyazo.com/be0406dfac5c42418885dd00d3dcbfdf.png[/IMG]
The problem I'm facing is that translucent objects and other drawing contexts are bleeding through each other when one is in the background.
Left rendered stuff is bleeding into the right area (which is closer than the left):
[IMG]https://i.gyazo.com/27a2e69be94062804edc3db05bc77492.png[/IMG]
Translucent gate is bleeding through the right rendered background:
[IMG]https://i.gyazo.com/7c39661284ab4905ebba28cd6af9735f.png[/IMG]
I haven't messed much with the render library or any of that, but how would I get it to stop rendering the contexts in the depth behind each of them?
I played around with things like render.DepthRange but I really have no idea what I'm doing :)
[QUOTE=Revenge282;49706152]Are you sure your arguments are correct? What happens if you manually call player.GetByID(1):SetBodygroup(0,1) when you are in the server?[/QUOTE]
Turns out that (0,1) wasn't a valid bodygroup. It was actually (1,1). Thanks mate!
[QUOTE=MaxShadow;49709781]As far as I know, HUDPaint redraws everything every time the hook is executed, so you can just use an if/else block. Anything you put inside will only be drawn if the condition is true.
[CODE]
hook.Add ("HUDPaint", "drawhud", function ()
if (mode == 1) then
-- Build Hud
else
-- Match Hud
end
end)
[/CODE][/QUOTE]
That's exactly what I should have think of earlier!
Thanks buddy
I need to spawn a test NPC as a fake player in DarkRP single play to test a SWEP I'm working on. How do I go about this?
-snip- used the net library instead lol
[QUOTE=NiandraLades;49712731]I have an entity, which when it's spawned, has a serverside variable attached to it
I'm using self:SetNWString("whatever", self.variable") when in the entity's init function, as I need it clientside to draw the value
This works perfectly fine if I spawn the entity while I'm on the server, but if it's spawned and then I join, printing self:GetNWString works fine serverside but comes up as blank (not nil, just nothing at all) in console and nothing is drawn
I thought using the Get/Set stuff would automatically sync stuff constantly - why is this occurring? Ideally I should use the Net Library since it's a static value, but I wasn't sure how to refer to the entity inside net.Receive as ENT/self was nil[/QUOTE]
Have you try messing with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ENTITY/UpdateTransmitState]ENTITY/UpdateTransmitState[/url]?
[QUOTE=FreddiRox!;49712527]I need to spawn a test NPC as a fake player in DarkRP single play to test a SWEP I'm working on. How do I go about this?[/QUOTE]
You could instead run multiple instances of gmod by using the -insecure and -multirun flags. Then make a lan listen server on one and have the other connect to it.
How do I stop/pause a sequence on a entity?
[QUOTE=YourStalker;49712801]You could instead run multiple instances of gmod by using the -insecure and -multirun flags. Then make a lan listen server on one and have the other connect to it.[/QUOTE]
Even better, use the 'bot' command that's already in GMod and ready to use from the console.
[QUOTE=Swagman1337;49712891]Even better, use the 'bot' command that's already in GMod and ready to use from the console.[/QUOTE]
No way to test a weapon and animations of it if you use bots.
And bots also have all the same SteamID so you can't test anything SteamID based.
[QUOTE=GGG KILLER;49712981]No way to test a weapon and animations of it if you use bots.
And bots also have all the same SteamID so you can't test anything SteamID based.[/QUOTE]
[url]https://wiki.garrysmod.com/page/game/GetWorld[/url] / [url]https://wiki.garrysmod.com/page/Player/GetEyeTrace[/url] and [url]https://wiki.garrysmod.com/page/Entity/TakeDamage[/url]
[QUOTE=Swagman1337;49712891]Even better, use the 'bot' command that's already in GMod and ready to use from the console.[/QUOTE]
Bots have no clientside, which is pretty shitty.
[QUOTE=keeperman;49713535][url]https://wiki.garrysmod.com/page/game/GetWorld[/url] / [url]https://wiki.garrysmod.com/page/Player/GetEyeTrace[/url] and [url]https://wiki.garrysmod.com/page/Entity/TakeDamage[/url][/QUOTE]
Congratulations, still no animations or solutions to them having all the same SteamID?
You just took 1 word of what I said and ignored the rest :goodjob:
I know I can test the functionality of the base (aka shooting and doing damage), but you can't test if the viewmodel/worldmodel looks alright nor the animations if you don't use -insecure & -multirun or ask someone to join your server and test it for you.
[QUOTE=GGG KILLER;49713633]Congratulations, still no animations or solutions to them having all the same SteamID?
You just took 1 word of what I said and ignored the rest :goodjob:
I know I can test the functionality of the base (aka shooting and doing damage), but you can't test if the viewmodel/worldmodel looks alright nor the animations if you don't use -insecure & -multirun or ask someone to join your server and test it for you.[/QUOTE]
Camera?
[QUOTE=keeperman;49713653]Camera?[/QUOTE]
Really? Viewmodel? The one that is in your screen? and the animations of it too?
:goodjob:
My DarkRP server seems to be randomly freezing, no errors, no logs. Just freezes? Any ideas
[url]http://puu.sh/n3BDZ/c1c2af2fea.png[/url]
Trying to make a utime chat command that can enable and disable the utime display in the top right of the screen.
[code]
local chatcommands = {};
hook.Add("PlayerSay", "Commands Base", function(ply, text, teamc, alive)
local chat_string = string.Explode(" ", text);
for k, v in pairs( chatcommands ) do
if( chat_string[1] == k ) then
table.remove(chat_string, 1);
v(ply, chat_string);
return "";
end
end
end )
function RegisterChatCommand(strCommand, Func)
if( !strCommand || !Func ) then return; end
for k, v in pairs( chatcommands ) do
if( strCommand == k ) then
return;
end
end
chatcommands[ tostring( strCommand ) ] = Func;
end
RegisterChatCommand("!utime", function(ply)
if (CLIENT) then
local utimeValue = GetConVar("utime_enable"):GetInt()
if utimeValue == 1 then
RunConsoleCommand("utime_enable", "0")
else
RunConsoleCommand("utime_enable", "1")
end
end
end )
[/code]
It'll take the chat command with no errors, but it won't disable/enable the display. Any help?
[QUOTE=Windwhistle;49718165]
It'll take the chat command with no errors, but it won't disable/enable the display. Any help?[/QUOTE]
Your issue is that you are trying to use RunConsoleCommand("utime_enable", "0") on the server - this needs to be run on the client in order for it to take effect on the client. An alternative would be to use ply:ConCommand("utime_enable 0"), this will do what you want from the serverside and you won't need to write any clientside code (hopefully)
[QUOTE=Windwhistle;49718165]Trying to make a utime chat command that can enable and disable the utime display in the top right of the screen.
[code]
local chatcommands = {};
hook.Add("PlayerSay", "Commands Base", function(ply, text, teamc, alive)
local chat_string = string.Explode(" ", text);
for k, v in pairs( chatcommands ) do
if( chat_string[1] == k ) then
table.remove(chat_string, 1);
v(ply, chat_string);
return "";
end
end
end )
function RegisterChatCommand(strCommand, Func)
if( !strCommand || !Func ) then return; end
for k, v in pairs( chatcommands ) do
if( strCommand == k ) then
return;
end
end
chatcommands[ tostring( strCommand ) ] = Func;
end
RegisterChatCommand("!utime", function(ply)
if (CLIENT) then
local utimeValue = GetConVar("utime_enable"):GetInt()
if utimeValue == 1 then
RunConsoleCommand("utime_enable", "0")
else
RunConsoleCommand("utime_enable", "1")
end
end
end )
[/code]
It'll take the chat command with no errors, but it won't disable/enable the display. Any help?[/QUOTE]
[code]
function UTimeChatCommand( ply, text, public )
text = text:lower()
if (string.sub(text, 1, 6) == "!utime") or (string.sub(text, 1, 4) == "/utime") then
local plyTime = GetConVar( "utime_enable" )
local plyTimeVal = plyTime:GetInt()
if ( plyTimeVal == 1 ) then
ply:ConCommand( "utime_enable 0" )
ply:ChatPrint( "You deactivated UTime!" )
elseif ( plyTimeVal == 0 ) then
ply:ConCommand( "utime_enable 1" )
ply:ChatPrint( "You activated UTime!" )
end
return(false)
end
end
hook.Add( "PlayerSay", "UTimeChatCommand", UTimeChatCommand );
[/code]
Try this.
Anyone know how I can "queue up" a url image and/or audio link? I need some way to verify both have been loaded to the clients before they play. Is it possible?
[QUOTE=Windwhistle;49718165]Trying to make a utime chat command that can enable and disable the utime display in the top right of the screen.
[code]
-code-
[/code]
It'll take the chat command with no errors, but it won't disable/enable the display. Any help?[/QUOTE]
To add reasoning to the above suggestions, PlayerSay is a serverside only hook, but you have clientside code in your !utime callback function. Try remove the client check and, as mentioned above, swap RunConsoleCommand with ply:ConCommand.
Pretty sure this is impossible, but is there some kind of way to resize a font without calling [URL="https://wiki.garrysmod.com/page/surface/CreateFont"]surface.CreateFont[/URL] a bunch of times? I know you'd sort of be able to resize fonts by doing some fancy 3d2d stuff to get the font closer to the screen, but would it be possible to do it without that?
[QUOTE=MPan1;49719150]Pretty sure this is impossible, but is there some kind of way to resize a font without calling [URL="https://wiki.garrysmod.com/page/surface/CreateFont"]surface.CreateFont[/URL] a bunch of times? I know you'd sort of be able to resize fonts by doing some fancy 3d2d stuff to get the font closer to the screen, but would it be possible to do it without that?[/QUOTE]
[url]https://facepunch.com/showthread.php?t=1261835&p=40311116&viewfull=1#post40311116[/url]
[QUOTE=Giraffen93;49719190]helpful link[/QUOTE]
dear god it exists
[sp]But it's still kinda messing with 3d2d stuff but damn that's pretty useful[/sp]
Sorry, you need to Log In to post a reply to this thread.