• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=zerf;48454505]doing that is way more than just sending 32 bits to be safe[/QUOTE] Fair enough, haven't taken that into account the bandwidth usage.
Hi, I'm trying my hand at a HTML chatbox, but I'm running into two problems involving scrolling. First, I'm trying to get the thing to auto-scroll to the bottom Second, every time the HTML chatbox is updated, it auto scrolls to the top. For the scrolling, I'm using a DScrollPanel.
[QUOTE=Exploderguy;48449104]It's not that, it's that it's going to be removed soon. Just avoids fixing things that could have been prevented.[/QUOTE] Ehh not trying to say your lying but I haven't heard anything about that happening. It also doesn't say it on the wiki page like it always says when stuff is about to get removed. [url]http://wiki.garrysmod.com/page/Category:umsg[/url] I also think they have more important things to be worrying about like fixing multi-core rendering and the bad optimization of gmod in general. --------------------------------------------- Also I wanted to know why it was better through statistics. I ended up looking it up on google and found out that net messages send on the same frame and are not a queue like usmgs do. They also can send more data. Thing is that is all I wanted to know it does no good to tell someone to use something and not give them an explanation as to why. I could lie and tell you that monkey sort is way better than quick-sort and every other type of algorithm.
[QUOTE=bran92don;48454807]-snip-[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/umsg/Start]umsg.Start[/url] "This function is deprecated."
[B]SMALL NEWBIE QUESTION[/B] I'm no coder but in order to edit the sentences.txt file I need to know what len() is, specifically in this context. Any help is appreciated.
[QUOTE=danielb677;48455105][B]SMALL NEWBIE QUESTION[/B] I'm no coder but in order to edit the sentences.txt file I need to know what len() is, specifically in this context. Any help is appreciated.[/QUOTE] You shouldn't have the need to edit sentences.txt
[QUOTE=Robotboy655;48455123]You shouldn't have the need to edit sentences.txt[/QUOTE] That doesn't answer my question, or even address it. What makes you say that? I feel like changing the way the npcs speak. I'm doing a pretty good job of it too, i just don't know what influence len has. I don't NEED to know what len is, I'm just curious as knowing may allow me to do a better job.
[QUOTE=danielb677;48455132]That doesn't answer my question, or even address it. What makes you say that? I feel like changing the way the npcs speak. I'm doing a pretty good job of it too, i just don't know what influence len has. I don't NEED to know what len is, I'm just curious as knowing may allow me to do a better job.[/QUOTE] I am going to assume Len is the length of the spoken line. You shouldn't need to to edit the file because you can play or suppress sounds with Lua, you can't ship edited sentences.txt in workshop addons, and I don't know what sort of issues it can cause if it's different between server and client.
[QUOTE=Robotboy655;48455544]I am going to assume Len is the length of the spoken line. You shouldn't need to to edit the file because you can play or suppress sounds with Lua, you can't ship edited sentences.txt in workshop addons, and I don't know what sort of issues it can cause if it's different between server and client.[/QUOTE] Ah yea I assumed it was length, I was more curious as to what the unit is, so i can get an idea of what effect changing it is. Also, I have never had a problem between server and client when running with non matching sentence.txt files. But then again i just might not have noticed
Anyone know how to trace who was the last player to [URL="http://wiki.garrysmod.com/page/PhysObj/ApplyForceOffset"]"apply force"[/URL] to a certain physics entity?
Okay, this is complete shit. This says that the hook is shared: [URL="http://wiki.garrysmod.com/page/GM/PlayerButtonDown"]http://wiki.garrysmod.com/page/GM/PlayerButtonDown[/URL], however it doesn't get called whatsoever on clients. Is it just broken or I need to do some "secret" steps to make it work on clients? (I really hope it's not broken, I need this hook clientside)
[QUOTE=Wob wob wob!;48456582]Anyone know how to trace who was the last player to [URL="http://wiki.garrysmod.com/page/PhysObj/ApplyForceOffset"]"apply force"[/URL] to a certain physics entity?[/QUOTE] something like... [code]Entity:AddCallback("PhysicsCollide", function(self, data) local player = data.HitEntity if IsValid(player) and player:IsPlayer() then if data.TheirOldVelocity:Length() >= 3 then -- change this to the threshold you'd like to consider players who hit the entity -- do something with the player or the entity, or store it on the entity doing 'self.lastHit = player' end end end) [/code] ? Of course, this doesn't track them hitting it with props or bullets, only if they actually touch it by walking into it/on top of it.
Is there any workshop update notifier? I want steam to notify me if an addon in my favourites list is being updated.
I need help with resizing derma based on size that involves DHTML panels. The content of the DHTML panel is increased every so often, so it needs to resize itself accordingly so that it's parent, the DScrollPanel, can detect if it needs to scroll. DHTML does have a built in scrollbar but it is absolute shit when I'm trying to make a chatbox. The scrollbar resets itself every time the content is updated. I've tried experimenting a lot with it but I just can't get it to work the way I want it to. heres the entire code [code] function BurgerChatThink() if NextThink <= CurTime() then if not BurgerChat_ScrollPanel then print("Creating Scrollbar...") BurgerChat_ScrollPanel = vgui.Create("DScrollPanel") BurgerChat_ScrollPanel:SetPos(PosX,PosY + 25) BurgerChat_ScrollPanel:SetSize(Wide+25,Tall-50) --[[ elseif not BurgerChat_Panel then print("Creating Panel...") BurgerChat_Panel = vgui.Create("DPanel",BurgerChat_ScrollPanel) BurgerChat_Panel:SetPos(0,0) BurgerChat_Panel:SetSize(BurgerChat_ScrollPanel:GetWide(),BurgerChat_ScrollPanel:GetTall()) BurgerChat_Panel.Paint = function(self,w,h) draw.RoundedBox( 0, 0, 0, w, h, Color( 30, 30, 30, 30 ) ) end --]] elseif not BurgerChat_HTML then print("Creating HTML...") BurgerChat_HTML = vgui.Create("DHTML",BurgerChat_ScrollPanel) --BurgerChat_HTML:Dock(FILL) BurgerChat_HTML:SetPos(0,0) BurgerChat_HTML:SetSize(BurgerChat_ScrollPanel:GetWide(),BurgerChat_ScrollPanel:GetTall() - 25) BurgerChat_HTML:SetHTML(GetHTML()) BurgerChat_HTML:SetAllowLua(false) else print(#GlobalChatData) BurgerChat_HTML:SetHTML(GetHTML()) --BurgerChat_Panel:SetSize(BurgerChat_HTML:GetWide(),#GlobalChatData*20) --BurgerChat_HTML:SizeToChildren(false,true) BurgerChat_HTML:SizeToContents() --BurgerChat_Panel:SizeToChildren(false,true) --BurgerChat_Panel:SizeToContents() BurgerChat_HTML:SetScrollbars( false ) -- Does not work --BurgerChat_Panel:SizeToChildren(false,true) local sbar = BurgerChat_ScrollPanel:GetVBar() function sbar.btnUp:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar.btnGrip:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 200, 200, 200 ) ) end function sbar.btnDown:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 100, 100, 100 ) ) end function sbar:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 0 ) ) end --sbar:SetScroll(-100) end NextThink = CurTime() + 0.25 end end [/code] and the HTML code [code] local HTML = [[ <head> <style> body {word-wrap: break-word; font-size:50px; width:100%; height:100%; overflow: auto} </style> </head> <body>]] .. Text ..[[</body> ]][/code]
[QUOTE=mijyuoon;48458714]Okay, this is complete shit. This says that the hook is shared: [URL="http://wiki.garrysmod.com/page/GM/PlayerButtonDown"]http://wiki.garrysmod.com/page/GM/PlayerButtonDown[/URL], however it doesn't get called whatsoever on clients. Is it just broken or I need to do some "secret" steps to make it work on clients? (I really hope it's not broken, I need this hook clientside)[/QUOTE] My bad, [URL="http://wiki.garrysmod.com/page/Category:Predicted_Hooks"]they're predicted hooks[/URL], forgot to mark them as such when I marked all the hooks on the wiki.
[QUOTE=Z0mb1n3;48459024]something like... [code]Entity:AddCallback("PhysicsCollide", function(self, data) local player = data.HitEntity if IsValid(player) and player:IsPlayer() then if data.TheirOldVelocity:Length() >= 3 then -- change this to the threshold you'd like to consider players who hit the entity -- do something with the player or the entity, or store it on the entity doing 'self.lastHit = player' end end end) [/code] ? Of course, this doesn't track them hitting it with props or bullets, only if they actually touch it by walking into it/on top of it.[/QUOTE] Your solution works really well, but the thing is that what I'm making is for a soccer gamemode where [URL="http://wiki.garrysmod.com/page/PhysObj/ApplyForceOffset"]ApplyForceOffset[/URL] is essentially the kick and I want the last player responsible for kicking the ball to be the one who scores. The way it stands now, it will only give points to whoever happened to touch it the last time. And even return nil if someone manages kick the ball in the goal without physically touching it which happens a lot.
-snoob-
[QUOTE=Wob wob wob!;48460241]Your solution works really well, but the thing is that what I'm making is for a soccer gamemode where [URL="http://wiki.garrysmod.com/page/PhysObj/ApplyForceOffset"]ApplyForceOffset[/URL] is essentially the kick and I want the last player responsible for kicking the ball to be the one who scores. The way it stands now, it will only give points to whoever happened to touch it the last time. And even return nil if someone manages kick the ball in the goal without physically touching it which happens a lot.[/QUOTE] How does the player actually perform the kick? I understand it uses applyforce, but where? A SWEP, a proximity thing, etc.?
Trying to rotate props with the physgun results in the prop rotating very slowly but also moving towards the direction I'm trying to rotate it, no clue how to fix, I checked the PhysgunPickup hook and most hooks related to physgun or ents, any tips?
Why does resource.AddFile never seem to work for me? This is in server/autorun [code]resource.AddFile("materials/example.png")[/code] I join the server, it says it's downloading the file, I get in the server, and it's purple and black checkers, with the image nowhere to be found in my client's files. The file should be downloaded to garrysmod/download/materials/example.png, but it isn't. If I put the file there myself, it shows up in game properly, but if I don't, it's checkered, even though the client says it downloaded the file. I have my settings to allow all downloads from the server. I've restarted my client multiple times.
[QUOTE=man with hat;48462352]Why does resource.AddFile never seem to work for me? This is in server/autorun [code]resource.AddFile("materials/example.png")[/code] I join the server, it says it's downloading the file, I get in the server, and it's purple and black checkers, with the image nowhere to be found in my client's files. The file should be downloaded to garrysmod/download/materials/example.png, but it isn't. If I put the file there myself, it shows up in game properly, but if I don't, it's checkered, even though the client says it downloaded the file. I have my settings to allow all downloads from the server. I've restarted my client multiple times.[/QUOTE] does it work when you join other servers (ones that you don't manage)
[QUOTE=Splerge;48462846]does it work when you join other servers (ones that you don't manage)[/QUOTE] I'm able to download stuff off of other peoples' servers fine, if that's what you meant.
[QUOTE=man with hat;48463056]I'm able to download stuff off of other peoples' servers fine, if that's what you meant.[/QUOTE] Check your console after joining and search for "HTTP ERROR"
[QUOTE=man with hat;48462352]Why does resource.AddFile never seem to work for me? This is in server/autorun [code]resource.AddFile("materials/example.png")[/code] I join the server, it says it's downloading the file, I get in the server, and it's purple and black checkers, with the image nowhere to be found in my client's files. The file should be downloaded to garrysmod/download/materials/example.png, but it isn't. If I put the file there myself, it shows up in game properly, but if I don't, it's checkered, even though the client says it downloaded the file. I have my settings to allow all downloads from the server. I've restarted my client multiple times.[/QUOTE] Have you set up a FastDL?
[QUOTE=P4sca1;48463252]Check your console after joining and search for "HTTP ERROR"[/QUOTE] Nothing. [QUOTE=Author.;48463303]Have you set up a FastDL?[/QUOTE] Nope.
[QUOTE=man with hat;48463335]Nothing. Nope.[/QUOTE] This is the problem then ^^ You need to setup FastDL :D
[QUOTE=P4sca1;48463357]This is the problem then ^^ You need to setup FastDL :D[/QUOTE] I'm pretty sure that's not required, as long as you have sv_allowdownload 1
[QUOTE=ms333;48463424]I'm pretty sure that's not required, as long as you have sv_allowdownload 1[/QUOTE] Yeah, but I don't know wether he wants his stuff to be downloaded directly from the server. I heared it has a 20kbps download speed limitation.
[QUOTE=Z0mb1n3;48461848]How does the player actually perform the kick? I understand it uses applyforce, but where? A SWEP, a proximity thing, etc.?[/QUOTE] I based it off the [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=148358389&searchtext=smod+kick"]SMOD kick.[/URL] What it does is play an animation of a foot model kicking and applies force (after a small delay) to whatever is close enough and in the middle of the screen. I have it fire when Primary Attack is pressed.
Does anyone know how you'd go about disabling the earthquakes in sandbox/otherwise caused by props being slammed on the ground or shaken in smaller spaces?
Sorry, you need to Log In to post a reply to this thread.