• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=Zelpa;49256772][URL="https://steamcommunity.com/sharedfiles/filedetails/?id=280384240"]Luckily for you I updated these models and turned them into playermodels as well.[/URL] and don't talk shit about the crappy preview images, i may be able to compile models but i sure as hell can't pose them.[/QUOTE] How did you fix their broken LODs?
[QUOTE=code_gs;49257015]How did you fix their broken LODs?[/QUOTE] if by fix you mean removing them entirely, then yeah, you can say i fixed them.
I have a question. Why is it that SetAngles on a physics object seems to work on every object that is not a player? With that I mean this: I have created an object that is square and I can stand on top of. Then I change the angle of the object. I spawn any random prop and it slides off. But the player still runs on top of the object and is not affected at all as if the angle never changed. What do I have to change to get it to work with player as well?
[QUOTE=Shenesis;49257597]Using the CheckPassword hook, is there a way to hide the "password failed." message? It gets annoying when I try to debug and there's like 10 players trying to join but unable to due to reserved slots. Like, this kind of stuff: [IMG]http://i.imgur.com/RsuRaDP.png[/IMG][/QUOTE] This might be useful [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/gamemode/init.lua[/url]
[lua] function achMenu() if (Menu == nil) then Menu = vgui.Create("DFrame") Menu:SetSize(500,500) Menu:SetPos(ScrW()/2 - 250, ScrH()/2 - 250) Menu:SetTitle("") Menu:SetDraggable(false) Menu:ShowCloseButton(false) Menu:SetDeleteOnClose(false) Menu.Paint = function() surface.CreateFont("HeaderFont",{font="Default",size=20,weight=5000}) surface.SetDrawColor(60,60,60,255) surface.DrawRect(0,0,Menu:GetWide(),Menu:GetTall()) surface.SetDrawColor(40,40,40,255) surface.DrawRect(0,25,Menu:GetWide(),1) surface.SetTextColor(255,255,255,255) surface.SetFont("HeaderFont") surface.SetTextPos(24,0) surface.DrawText("Achievements") local achList = vgui.Create("DScrollPanel",Menu) achList:SetSize(Menu:GetWide(),Menu:GetTall()) achList:SetPos(0,26) local achyList = vgui.Create("DListLayout",achList) achyList:SetSize(achList:GetWide(),achList:GetTall()) achyList:SetPos(0,0) [/lua] This is the first part of my menu. I can't seem to get the scrollbar to work properly. The menu starts at the pos 0,26. The title is above it, however the scroll bar doesn't take its spot properly. Does anyone see what I did wrong?
[QUOTE=Skere_;49258385][lua] function achMenu() if (Menu == nil) then Menu = vgui.Create("DFrame") Menu:SetSize(500,500) Menu:SetPos(ScrW()/2 - 250, ScrH()/2 - 250) Menu:SetTitle("") Menu:SetDraggable(false) Menu:ShowCloseButton(false) Menu:SetDeleteOnClose(false) Menu.Paint = function() surface.CreateFont("HeaderFont",{font="Default",size=20,weight=5000}) surface.SetDrawColor(60,60,60,255) surface.DrawRect(0,0,Menu:GetWide(),Menu:GetTall()) surface.SetDrawColor(40,40,40,255) surface.DrawRect(0,25,Menu:GetWide(),1) surface.SetTextColor(255,255,255,255) surface.SetFont("HeaderFont") surface.SetTextPos(24,0) surface.DrawText("Achievements") local achList = vgui.Create("DScrollPanel",Menu) achList:SetSize(Menu:GetWide(),Menu:GetTall()) achList:SetPos(0,26) local achyList = vgui.Create("DListLayout",achList) achyList:SetSize(achList:GetWide(),achList:GetTall()) achyList:SetPos(0,0) [/lua] This is the first part of my menu. I can't seem to get the scrollbar to work properly. The menu starts at the pos 0,26. The title is above it, however the scroll bar doesn't take its spot properly. Does anyone see what I did wrong?[/QUOTE] Youre creating the scrollbar on the paint. Create it outside the paint [editline]6th December 2015[/editline] Also create the font outside of the paint as well
:snip:
-snip-
I am a little unsure about how I would be able to save and retrieve a list of int's from a sqlite database. To help explain: I am making a system where each player can have multiple characters on the server. When they join they will be able to create one character, however, if they are VIP's, they are able to create 3+ characters. Rather than creating dozens of columns (one for each character id) I would assume that I can simply store a list of int's in sqlite, which you can't necessarily. So the solution I would jump to (with my background in Java) would be to turn the int's into a string separated by commas, save that, then when you retrieve the data, you would simply split the list at the commas, and you would have all the characters associated with that player. However, from my very limited research, it seems that there isn't a function to automatically split a string in lua (splitting at every comma in the string and putting the values in a table). I would very much appreciate if there was a better way of doing this, or if anyone can provide me with a way to split strings at a certain character.
Anyone know how I can create scopes with rendertargets? Like the ones CSPSpy used in CW 2.0.
How can I stop that clicking noise from my SWEP? It's a melee weapon and it won't emit any sounds I try to emit, it just does it's own thing and plays the clicking sound as if it's out of ammo when ammo is set to none and clips to -1...
[QUOTE=john55223;49259500]I am a little unsure about how I would be able to save and retrieve a list of int's from a sqlite database. To help explain: I am making a system where each player can have multiple characters on the server. When they join they will be able to create one character, however, if they are VIP's, they are able to create 3+ characters. Rather than creating dozens of columns (one for each character id) I would assume that I can simply store a list of int's in sqlite, which you can't necessarily. So the solution I would jump to (with my background in Java) would be to turn the int's into a string separated by commas, save that, then when you retrieve the data, you would simply split the list at the commas, and you would have all the characters associated with that player. However, from my very limited research, it seems that there isn't a function to automatically split a string in lua (splitting at every comma in the string and putting the values in a table). I would very much appreciate if there was a better way of doing this, or if anyone can provide me with a way to split strings at a certain character.[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/string/Split]string.Split[/url] Literally the only result when you type "split" in the wiki search bar.
[QUOTE=AwfulRanger;49261939][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/string/Split]string.Split[/url] Literally the only result when you type "split" in the wiki search bar.[/QUOTE] ... I .... I have no words.... Thank you. I spent ~30 mins googling, but didn't think to check the gmod wiki.
How could I make a little system that prints a message out every 300 seconds, that also cycles through the messages in order? (It moves to the next message after it says one) This is what I have at the moment, but it doesn't work as I expected. It just spams all the messages every 300 seconds. [lua] MessageTable = {"Message1", "Message2", "Message3", "Message4", "Message5"} timer.Create("MessageTimer", 300, 0, function() table.foreach(Table, function(key, value) RunConsoleCommand("ulx", "asay", (tostring(value))) end ) end)[/lua] Any help is appreciated
Hey guys I wanted to know if anyone knew of a quick and easy way to fully replace a lot of gmods default sounds. I know I can simply go into the gamemodes functions and disable certain sounds and just layer mine over it but that would be extremely time consuming. I was reading into using sound scripts to do this. I am assuming it simply replaces whatever sound is in there, but I need to know what are all the sound names for things like; Hurt noises, all footsteps, voices, and pretty much everything. One other thing I could do is make it where I have a addon that replaces all default sounds by just changing the sound name to the sound ingame and dropping it in the garrys mod folder. The problem with this is this would change sounds for ALL of the clients gmod, and i want to only do this for one gamemode.
Having an issue with custom fonts. I stick my font directly into "garrysmod\resource\fonts\fontname.ttf" and it works in game as it should. But if I stick the font into my workshop addon I can't seem to get it to work and it uses the default font. I even extracted my workshop addon just to make sure it was in the correct place which it was. Do fonts not work in workshop addons? EDIT: Ill take Robots "late" rating as they don't work via workshop. This will be a pain in the ass then because instructing the average 12 year old server owner how to use FastDL is next to impossible.
I'm having issues with the [url=https://wiki.garrysmod.com/page/Category:DAdjustableModelPanel]DAdjustableModelPanel[/url]. When it is on my frame, the model is invisible until I perform mouse interaction with it. Is there a way to fix this? [lua]local model = frame:Add( "DAdjustableModelPanel" ) model:Dock( TOP ) model:SetTall( 256 ) model:SetCamPos( Vector( 150, 150, 50 ) ) model:SetLookAng( Angle( 0, 0, 0 ) ) model:SetLookAt( Vector( 0, 0, 0 ) ) model:SetModel( trace.Entity:GetModel() )[/lua]
How would I draw a serverside model in front of a player when he has a certain weapon out? (Preferably this code would be inside the weapon hooks)
I've been going through trying to edit SWEPS for my server (via filezilla, my host's own text editor, etc), and none of the changes I'm making seem to be going through to the game even after restarts. I completely removed the folder and files associated with a weapon and it still shows up in the T buy menu and everything. Am I missing a cache location for linux servers or something?
[QUOTE=Leyserr;49265872]How could I make a little system that prints a message out every 300 seconds, that also cycles through the messages in order? (It moves to the next message after it says one) This is what I have at the moment, but it doesn't work as I expected. It just spams all the messages every 300 seconds. [lua] MessageTable = {"Message1", "Message2", "Message3", "Message4", "Message5"} timer.Create("MessageTimer", 300, 0, function() table.foreach(Table, function(key, value) RunConsoleCommand("ulx", "asay", (tostring(value))) end ) end)[/lua] Any help is appreciated[/QUOTE] [CODE] local MessageTable = {"Message1", "Message2", "Message3", "Message4", "Message5"} local val = 1 timer.Create("MessageTimer", 300, 0, function() RunConsoleCommand("ulx", "asay", MessageTable[val]) if val + 1 > #MessageTable then val = 1 -- Reset the value if it's too big (bigger than the amount of keys in your table) else val = val + 1 -- Otherwise, add 1 and keep going end end) [/CODE] Untested but should work
Good afternoon! Um, I want to ask: [I]How can I set a player's individual PVS mode?[/I] For example: Players who I don't want to receive network transitions if they're too far away (LUA, not VisLeafs) [url]http://wiki.garrysmod.com/page/Global/AddOriginToPVS[/url] This link explains it very well, however... There's no use for the [B]PLY[/B] variable they declare. [lua] /*-- Ply variable is not used in the example! --*/ local function mySetupVis( ply ) AddOriginToPVS( RTCamera:GetPos() ) end hook.Add( "SetupPlayerVisibility", "AddRTCamera", mySetupVis ) [/lua]
[code] /*-- This will add all your players in your team in the PVS --*/ local function mySetupVis( ply ) for k,v in pairs(team.GetPlayers(ply:Team())) do AddOriginToPVS(v:GetPos()) end end hook.Add( "SetupPlayerVisibility", "AddRTCamera", mySetupVis )[/code] That's an example
[QUOTE=gonzalolog;49270434][code] /*-- This will add all your players in your team in the PVS --*/ local function mySetupVis( ply ) for k,v in pairs(team.GetPlayers(ply:Team())) do AddOriginToPVS(v:GetPos()) end end hook.Add( "SetupPlayerVisibility", "AddRTCamera", mySetupVis )[/code] That's an example[/QUOTE] Wow! That's amazing how dumb that was xD... But, I found the thing I was looking for: [url]http://wiki.garrysmod.com/page/Entity/SetPreventTransmit[/url]
So I'm messing around with entities for first time and I'm a bit lost in collisions. Cutting it short, with this [code]ENT = {} ENT.Type = "anim" ENT.Base = "base_entity" ENT.ClassName = "sent_testcoll" if CLIENT then function ENT:Draw() self:SetModel("models/props_junk/cardboard_box001a.mdl") self:SetMaterial('models/shiny') self:DrawModel() end else function ENT:Initialize() self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_NONE) --self:SetSolid(SOLID_NONE) self:SetSolid(SOLID_BBOX) self:StartMotionController() local phys = self:GetPhysicsObject() print(phys) -- returns [NULL PhysObject] if(phys:IsValid()) then phys:SetMass(100) phys:Wake() end self:PhysWake() self:SetTrigger(true) self:SetUseType(SIMPLE_USE) end function ENT:Use(u,cal) print(u) print(cal) self:Remove() end end scripted_ents.Register(ENT, ENT.ClassName, true) [/code] I want it to not collide with users (so when it's in the floor players can walk over it without noticing anything), but I want :Use to work too. After messing around for a bit with SetSolid, I've noticed that SOLID_NONE (and SOLID_VPHYSICS) achieves the lack of collision, but makes it impossible to use the entity. SOLID_BBOX lets me use it, but makes it impossible to walk over it, even jumping on top of it. I suspect it has something to do with PhysicsInit (and maybe SetMoveType), but I've no clue. Any hints?
Try using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetCollisionGroup]Entity:SetCollisionGroup[/url] with COLLISION_GROUP_WEAPON and see if the entity :Use reacts. [editline]8th December 2015[/editline] Of course you should revert SetMoveType to MOVETYPE_VPHYSICS and solid to SOLID_VPHYSICS
[QUOTE=Jvs;49272048]Try using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetCollisionGroup]Entity:SetCollisionGroup[/url] with COLLISION_GROUP_WEAPON and see if the entity :Use reacts. [editline]8th December 2015[/editline] Of course you should revert SetMoveType to MOVETYPE_VPHYSICS and solid to SOLID_VPHYSICS[/QUOTE] Hm, if I set solid to SOLID_VPHYSICS it keeps disabling all collisions, but BBOX works like a charm along with collision_group_weapon.
Spectator mode doesn't seem to work. People shake heavily on the ground in spectate mode, instead of being able to fly. [lua] local function VDPlayerJoined(ply) ply:Spectate(OBS_MODE_ROAMING) end hook.Add("PlayerInitialSpawn","VDPlayerJoined",VDPlayerJoined) [/lua] I've already tried changing the movetype
How could I use surface.DrawPoly to achieve a goal similar to this? [t]http://puu.sh/lPPLp.png[/t] I'd use RoundedBox, but it uses a texture to do its edge rounding, which doesn't obey my stencils. I'm not fully aware of how to use trig to accomplish this. Ideally, I would just draw a rectangle, and then draw the left/right halves of a circle on the corresponding side, but I don't know how to make half of a circle. EDIT: wow i am bad, I just accidentally made it work.
[QUOTE=Z0mb1n3;49283300]How could I use surface.DrawPoly to achieve a goal similar to this? [t]http://puu.sh/lPPLp.png[/t] I'd use RoundedBox, but it uses a texture to do its edge rounding, which doesn't obey my stencils. I'm not fully aware of how to use trig to accomplish this. Ideally, I would just draw a rectangle, and then draw the left/right halves of a circle on the corresponding side, but I don't know how to make half of a circle. EDIT: wow i am bad, I just accidentally made it work.[/QUOTE] Unless the shape you need is dynamic/procedural, use a texture. The Lua -> drawing interface is very slow compared to internal drawing commands (such as drawing a texture). If you must use DrawPoly, you want it to be with the simplest of shapes.
[QUOTE=vexx21322;49283834]Unless the shape you need is dynamic/procedural, use a texture. The Lua -> drawing interface is very slow compared to internal drawing commands (such as drawing a texture). If you must use DrawPoly, you want it to be with the simplest of shapes.[/QUOTE] it's only drawing half circles. As well, stencils don't mix with textures, because it will still draw over it even if the pixel is transparent, so I would rather have a poly.
Sorry, you need to Log In to post a reply to this thread.