• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=bigdogmat;49743220]I'm not sure if you can return anything for a gameevent, but try listening for the event "player_changename" and hook into it and return. [/QUOTE] Sadly doesn't work. However I've made a workaround with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/ChatText]GM/ChatText[/url] just suppressing the message.
[QUOTE=Unib5;49745759]How would I go by networking weapons which have been created "run-time"? The client doesn't know which weapons to create until the server tells it to weapons.Register them, but this only provides a partial solution. The weapons to register simply aren't networked fast enough to the client (InitPostEntity), so any players holding these weapons when the client connects will have issues on the newly connected client until these players swap away and back to the weapon.[/QUOTE] Never tried before, but you could prevent transmitting of players to said client until weapons initialize with [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/Entity/SetPreventTransmit"]Entity:SetPreventTransmit[/URL]. After everything has been networked and setup, you can start transmitting other players again
[QUOTE=Teddi Orange;49745808]Sadly doesn't work. However I've made a workaround with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/ChatText]GM/ChatText[/url] just suppressing the message.[/QUOTE] Would it be better if the default behaviour was in a hook in the base gamemode?
[QUOTE=Willox;49745812]Would it be better if the default behaviour was in a hook in the base gamemode?[/QUOTE] It would be better aye, however I'd argue it's better to not even have such a feature at all as it can easily be added if the need should arise.
[QUOTE=Willox;49745812]Would it be better if the default behaviour was in a hook in the base gamemode?[/QUOTE] I think it's fine as it is, would be nice to get the different types of chat filters on the wiki, though.
[QUOTE=roastchicken;49741209]strings are not tables what you're trying to do is check the similarity between an apple and a crate of fruits; it's not gonna work tell us what you're trying to accomplish and we'll tell you how you should/can be doing it[/QUOTE] I have a table of texts so I don't have to type string.find( bla, bla ) for every single one
I need to set a variable self.LastWep or self.Owner.LastWep ... and I want it to be set when the player picks up my SWEP, so I'm not planning to use an autorun script. How can I do this? I also want to make it so my SWEP doesn't get picked up when the Player has full ammo (variable). I know I can make a SENT instead that gives me the SWEP, but I have yet to find a way to make it so the Player can walk through a SENT and still trigger it. [editline]15th February 2016[/editline] Yes I have searched wildly for how to do these things but... if it's easy to find the answers then I'm not very good at searching :boxhide:
[QUOTE=Willox;49745776] Could you echo $RLIMIT_CORE and $RLIMIT_FSIZE? Apparently apport is supposed to stick to the normal core dump behaviour, so I think you might have these values set to 0.[/QUOTE] Echo'ing those turns up nothing (undefined). I've tried to comment out 'problem_types' as detailed [URL="https://wiki.ubuntu.com/Apport#Ubuntu_12.04_and_later"]here[/URL]. I don't know if that changes anything though, will have to wait for a crash I guess?
[QUOTE=ms333;49746188]Echo'ing those turns up nothing (undefined). I've tried to comment out 'problem_types' as detailed [URL="https://wiki.ubuntu.com/Apport#Ubuntu_12.04_and_later"]here[/URL]. I don't know if that changes anything though, will have to wait for a crash I guess?[/QUOTE] kill -SIGQUIT <process id>
[QUOTE=Willox;49746215]kill -SIGQUIT <process id>[/QUOTE] An entry to debug.log was added but still no dump file (or any file) was created. I'm on ubuntu 14.04 if that changes anything...
[QUOTE=ms333;49746314]An entry to debug.log was added but still no dump file (or any file) was created. I'm on ubuntu 14.04 if that changes anything...[/QUOTE] Edit /proc/sys/kernel/core_pattern to contain just the word "core" (save the old value!) and see if the core dump appears when it crashes. If not, something on your system is definitely configured to not dump.
Is it possible to use vgui's under the GM:HUDPaint ? I was looking to create a DPanel and put some DLabels inside to be able to use SetWrap on them (during the first phase of my gamemode) The only matter is that this HUD would be removed whenever the second phases start, but writing it out of the hook (not to get FPS drops) makes it stick to the HUD and does not remove itself when my (If ... then ) is not true.
[QUOTE=Deepnox;49746404]Is it possible to use vgui's under the GM:HUDPaint ? I was looking to create a DPanel and put some DLabels inside to be able to use SetWrap on them (during the first phase of my gamemode) The only matter is that this HUD would be removed whenever the second phases start, but writing it out of the hook (not to get FPS drops) makes it stick to the HUD and does not remove itself when my (If ... then ) is not true.[/QUOTE] [code] -- -- Latest version -- pnl:SetPaintedManually( true ) hook.Add( "Your Render Hook", "", function() pnl:SetPaintedManually( false ) pnl:PaintManual() pnl:SetPaintedManually( true ) end ) -- -- Dev branch -- pnl:SetPaintedManually( true ) hook.Add( "Your Render Hook", "", function() pnl:PaintManual() end ) [/code] Both examples will work in the dev branch. You can probably do what you want with just the panels instead of using HUDPaint though with panel:SetParent( GetHUDPanel() ).
[QUOTE=Willox;49746331]Edit /proc/sys/kernel/core_pattern to contain just the word "core" (save the old value!) and see if the core dump appears when it crashes. If not, something on your system is definitely configured to not dump.[/QUOTE] Should I restart the apport service? Because upon doing so, the core_pattern is defaulted to the old value no matter what I type in there. Setting it to just "core" causes an error on apport service restart. [code] stop: Job failed while stopping apport start/running [/code] - edit - [B]Ok[/B] it seems to produce a core file now when killing the process like you said. I edited the core_pattern file's content to "core" and then just left the apport service started. The console output is this: [t]https://i.gyazo.com/6409bcba0e95e6f528838435872bf3a1.png[/t]
[QUOTE=keeperman;49746042]I have a table of texts so I don't have to type string.find( bla, bla ) for every single one[/QUOTE] use a for loop for key, string in ipairs( myTable ) do --check if the strings match or whatever --do stuff end note: ipairs() only works if your keys are numbers going from 1 onward, sequentially. if you're using table.insert and table.remove then you'll be fine, otherwise use pairs()
I'm looking into finding algorithms to parse contents from strings (stuff like XML, HTML, JSON, etc.). What should I get started with?
[QUOTE=MaximLaHaxim;49749057]I'm looking into finding algorithms to parse contents from strings (stuff like XML, HTML, JSON, etc.). What should I get started with?[/QUOTE] Before you start implementing them in Lua, know it's been done already. GLua itself has built in JSON encoding and decoding. Additionally, an XML and HTML parser will probably be the same parser (as they both stem from SGML). Also, what information are you looking for from these structures? You probably won't be able to find a DOM-like API for HTML, but if you're just looking for the contents of a certain tag, there's probably an option.
Is there an easy way to add a DLabel and another component (like a DNumberWang) to the same line in the toolmenu without using AddControl?
How can I run a clientside check for an error playermodel? do i just run util.IsValidModel(player:GetModel()) clientside? this is in case a player is missing content. when the new update is released I was gonna do something like [lua]for k,v in pairs(player.GetAll()) do if not util.IsValidModel(v:GetModel()) then game.MountGMA(gmas[v:GetModel()])--check the model against a table which knows which models are from which gma v:SetModel("models/player/arctic.mdl") --give the error model player a clientside model that is visible for gameplay purposes, even if it's not the correct one end end[/lua] hooked to when a player is fully loaded in. This is so a player could begin playing on the server without finishing the complete download.
[QUOTE=MaximLaHaxim;49749057]I'm looking into finding algorithms to parse contents from strings (stuff like XML, HTML, JSON, etc.). What should I get started with?[/QUOTE] I think in the last WAYWO someone was making this sort of thing to be used with VGUI.
Is there some kind of render hook that's called after the client has a large lag spike, or enters "record" in console? Anything with EnableMatrix or PhysicsFromMesh enabled on the client's end will reset if the client lags too much or uses "record" in console, so I was hoping to hook into something to refresh it after such an event.
[QUOTE=Splerge;49752026]How can I run a clientside check for an error playermodel? do i just run util.IsValidModel(player:GetModel()) clientside? this is in case a player is missing content. when the new update is released I was gonna do something like [lua]for k,v in pairs(player.GetAll()) do if not util.IsValidModel(v:GetModel()) then game.MountGMA(gmas[v:GetModel()])--check the model against a table which knows which models are from which gma v:SetModel("models/player/arctic.mdl") --give the error model player a clientside model that is visible for gameplay purposes, even if it's not the correct one end end[/lua] hooked to when a player is fully loaded in. This is so a player could begin playing on the server without finishing the complete download.[/QUOTE] Why are you looping through all players if the gma mount is a clientside function? [B]Edit[/B] Didnt see the :GetModel table thing Ups
[QUOTE=geferon;49755023]Why are you looping through all players if the gma mount is a clientside function?[/QUOTE] this is called clientside? It has to check each players model, read the post
I'm using these two pieces of code to create blur and draw lines on my derma panels: [code] local blur = Material("pp/blurscreen") local function DrawBlur(panel, amount) local x, y = panel:LocalToScreen(0, 0) local scrW, scrH = ScrW(), ScrH() surface.SetDrawColor(255, 255, 255) surface.SetMaterial(blur) for i = 1, 6 do blur:SetFloat("$blur", (i / 3) * (amount or 6)) blur:Recompute() render.UpdateScreenEffectTexture() surface.DrawTexturedRect(x * -1, y * -1, scrW, scrH) end end local function drawRectOutline( x, y, w, h, color, thickness ) surface.SetDrawColor( color ) for i=0, thickness - 1 do surface.DrawOutlinedRect( x + i, y + i, w - i * 2, h - i * 2 ) end end [/code] For some reason when people access the menu, they are now getting huge frame drops. Anyone know why this happens?
[QUOTE=kpjVideo;49755350]I'm using these two pieces of code to create blur and draw lines on my derma panels: -6X blur- For some reason when people access the menu, they are now getting huge frame drops. Anyone know why this happens?[/QUOTE] lots of blur lags like a bitch, not sure why talk to Neth, he loves Blur
Does "TableToJSON" support GLua stuff like vectors? If not, whats the best serialization module right now? I can't use JSON, and vON doesn't work for me (deserialization gives me a table full of blank spaces)
I'm trying to apply a png as material on a car but I can't quite seem to get it right. This ran on the client [code] -- veh is the vehicle local imat, num = Material('data/mercedes_e350_taxi.png', 'vertexlitgeneric') veh:SetSubMaterial(0, '!'..imat:GetName()) [/code] Produces this: [t]https://i.gyazo.com/4ba88c3206ad77e7a9cd90bf024b4679.png[/t] Any suggestions?
[QUOTE=MaxShadow;49755904]Does "TableToJSON" support GLua stuff like vectors? If not, whats the best serialization module right now? I can't use JSON, and vON doesn't work for me (deserialization gives me a table full of blank spaces)[/QUOTE] Nevermind, pON works fine.
Am I retarded? (yes) I'm trying to make a simple rocket with the "models/props_phx/rocket1.mdl" model but I'm getting a little confused with the vectors/angles for setting the velocity correctly. I was using GetUp() since the model spawns the rocket upwards, so I expected to be able to set the angles to facing "upwards" towards the way the player was facing, but it does not work correctly at all. What am I doing wrong? EDIT: More specifically, can someone explain what exactly GetUp() does? I know that while the prop is upright, it is the vector upwards, but when you pitch/roll the entity, GetUp() is incredibly odd. EDIT: Fixed. PhysicsSimulation and was using SIM_LOCAL_ACCELERATION opposed to GLOBAL
I'm trying to make a Fallout-ish compass, but I'm having troubles getting the npc markers to be accurate. I have this so far: [code] function LineAng(p1, p2) xDiff = p2:GetPos().x - p1:GetPos().x; yDiff = p2:GetPos().y - p1:GetPos().y; return math.atan2(yDiff, xDiff) * (180 / math.pi); end local w, h = 600, 50 hook.Add("HUDPaint", "compass", function() surface.SetDrawColor(color_white) surface.DrawOutlinedRect(ScrW()/2 - w/2, ScrH() - h - 20, w, h) for k,v in pairs(ents.FindByClass("npc_*")) do local xpos = math.Clamp(LocalPlayer():GetAngles().y - LineAng(LocalPlayer(), v), -140, 140) surface.DrawRect(ScrW()/2 + xpos, ScrH() - h - 20, 2, h) end end) [/code] and while the markers are close, they don't act like they should. I tried using ToScreen, because I just need the X coordinate, but still not what I'm looking for. Any advice?
Sorry, you need to Log In to post a reply to this thread.