• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
why is atlas chat killing fps so much?
[QUOTE=GreenGold;46859392]why is atlas chat killing fps so much?[/QUOTE] Max chats is probably set to 10000 go into the settings and lower it
[QUOTE=Commander11;46856952]index your table numerically , use math.Random() as your randValue and setup some enums I.E. _CABBAGE = 1 etc etc oh wow, I'm late. [sp]I didn't know table.Random returned the key as well[/sp] :suicide:[/QUOTE] -snip- this explained a bunch: [url]http://lua-users.org/wiki/OptimisationCodingTips[/url]
I making moba style gamemode how do i making rectangle and circle collision in gmod lua? additional: All vector is a 2D
[url]http://wiki.garrysmod.com/page/Entity/PhysicsInitBox[/url] [url]http://wiki.garrysmod.com/page/Entity/PhysicsInitSphere[/url] ???
[QUOTE=Robotboy655;46860301][url]http://wiki.garrysmod.com/page/Entity/PhysicsInitBox[/url] [url]http://wiki.garrysmod.com/page/Entity/PhysicsInitSphere[/url] ???[/QUOTE] I'm not used entity collision it's very sucks Because entity Box collision is not Rectangle and not rotated And i really waste of time looking for my past posts After all i do not like entity projectile and collision
[QUOTE=HumbleTH;46858217]How does syntax highlighting in a derma text box work? ( for example, in Luapad )[/QUOTE] I partly rewrote and cleaned up a version of LuaPad I found on the internet. [url]https://github.com/wyozi/gmod-luapad[/url] Here's the relevant file: [url]https://github.com/wyozi/gmod-luapad/blob/master/lua/cl_luapad_panel_syntax.lua[/url] Edit: basically the whole thing uses draw.SimpleText to draw everything, including the blinking cursor. IIRC SyntaxColorLine is called on each text change and then drawn [URL="https://github.com/wyozi/gmod-luapad/blob/master/lua/cl_luapad_panel_render.lua#L64"]here[/URL]
Been wanting to make a jukebox and found a function where i could stream the music rather than make people download 200mb's of songs before loading into the server. Tried using sound.Play and it doesn't work with youtube or soundcloud? Can't you use them for it? Is there another function that could play sounds from there without having to load a steam window up?? (replaced "URL" with my own in previous code) [code] sound.PlayURL ( "URL", "3d", function( station ) if ( IsValid( station ) ) then station:SetPos( LocalPlayer():GetPos() ) station:Play() else LocalPlayer():ChatPrint( "Invalid URL!" ) end end ) [/code]
I have two versions of an NPC, each one is the same, but with a different weapon effect. Is it possible to put both weapons on the same NPC? LIke make it alternate fire between the laser and the toxic gas?
will this give me same result [CODE] hook.Add("EntityTakeDamage", "EntityTakeDamage.Headshot", function(targ, dmginfo) if targ:IsPlayer() and !(targ.IsGhost and targ:IsGhost()) then if dmginfo:IsBulletDamage() then if targ.was_headshot then targ.lastHitGroup = HITGROUP_HEAD end end end end [/CODE] as this: [CODE] hook.Add("ScalePlayerDamage", "ScalePlayerDamage.Headshot", function(ply, hitGroup) ply.lastHitGroup = hitGroup end) [/CODE] when i use it in PlayerDeath hook [CODE] if victim.lastHitGroup && victim.lastHitGroup == HITGROUP_HEAD then killer.headshots = killer.headshots + 1; end [/CODE]
-snipped- Worked out my problem :P
-snip- all fixed
How do I disable Vehicle's collision?
[QUOTE=rebel1324;46866159]How do I disable Vehicle's collision?[/QUOTE] Do you mean just collision in general? Well, I am personally a big fan of nocollide.
Has anyone encountered plain white text outputs in console saying the following? [CODE].txt' from client [Arbitrary player's name] failed.[/CODE] It was printed out a few times a week or two ago, and it's just recently printed back with a different player. I've already tried searching through the GMod directory, including lua, gamemodes, addons, html, etc in n++ for "failed." and nothing related comes up (besides some non-matching files like util/workshop_files.lua, TTT English translation file, and some Wire E2 text). As far as n++ reports, I can't find any script that contains the above debug message, though it might be in the dlls somewhere. I only ask because it is a slightly disconcerting message, though it's probably nothing.
[QUOTE=Mista Tea;46866395]Has anyone encountered plain white text outputs in console saying the following? [CODE].txt' from client [Arbitrary player's name] failed.[/CODE] It was printed out a few times a week or two ago, and it's just recently printed back with a different player. I've already tried searching through the GMod directory, including lua, gamemodes, addons, html, etc in n++ for "failed." and nothing related comes up (besides some non-matching files like util/workshop_files.lua, TTT English translation file, and some Wire E2 text). As far as n++ reports, I can't find any script that contains the above debug message, though it might be in the dlls somewhere. I only ask because it is a slightly disconcerting message, though it's probably nothing.[/QUOTE] You said you went through "addons", did you mean *.Lua files, or did you also check *.gma files? *.gma stores Lua in plain-text so you could search them too, if you didn't already.
[QUOTE=Acecool;46866444]You said you went through "addons", did you mean *.Lua files, or did you also check *.gma files? *.gma stores Lua in plain-text so you could search them too, if you didn't already.[/QUOTE] I was naming off directory folders so yes, gma files were included.
[QUOTE=Mista Tea;46866395]Has anyone encountered plain white text outputs in console saying the following? [CODE].txt' from client [Arbitrary player's name] failed.[/CODE] It was printed out a few times a week or two ago, and it's just recently printed back with a different player. I've already tried searching through the GMod directory, including lua, gamemodes, addons, html, etc in n++ for "failed." and nothing related comes up (besides some non-matching files like util/workshop_files.lua, TTT English translation file, and some Wire E2 text). As far as n++ reports, I can't find any script that contains the above debug message, though it might be in the dlls somewhere. I only ask because it is a slightly disconcerting message, though it's probably nothing.[/QUOTE] People be trying to exploit your server. What message is directly before that?
[QUOTE=Willox;46866748]People be trying to exploit your server. What message is directly before that?[/QUOTE] I don't have console logging enabled so unfortunately I've already lost the most recent one. I don't remember the lines prior to it being of consequence on any of the occasions. This most recent time involved a player that was trying to inform me to keep my rcon password less than 10 characters due to some exploit (what), and I explained I don't have the rcon password set and I would do it via command line anyway. He didn't seem malicious, and since he was just trying to inform me, I didn't think much of it. A few minutes later I peered back at my console and saw the message above, the player name being his. Unlike the most recent incident, the previous ones didn't involve any correspondence between me and the players. I just remember seeing about 3 of the same messages, each from a different player iirc, most likely seconds apart since they were in succession.
Are base_ai entities supposed to respond to NPCs attacking them, even without being told to do so?
How to make a gradient effect for a derma panel? -snip-
[QUOTE=Scarface3353;46868498]How to make a gradient effect for a derma panel? -snip-[/QUOTE] For the first question, Entoros made this function awhile back that might be useful. [lua] GRADIENT_HORIZONTAL = 0; GRADIENT_VERTICAL = 1; function draw.LinearGradient(x,y,w,h,from,to,dir,res) dir = dir or GRADIENT_HORIZONTAL; if dir == GRADIENT_HORIZONTAL then res = (res and res <= w) and res or w; elseif dir == GRADIENT_VERTICAL then res = (res and res <= h) and res or h; end for i=1,res do surface.SetDrawColor( Lerp(i/res,from.r,to.r), Lerp(i/res,from.g,to.g), Lerp(i/res,from.b,to.b), Lerp(i/res,from.a,to.a) ); if dir == GRADIENT_HORIZONTAL then surface.DrawRect(x + w * (i/res), y, w/res, h ); elseif dir == GRADIENT_VERTICAL then surface.DrawRect(x, y + h * (i/res), w, h/res ); end end end [/lua] For the second question the answer is you're running it clientside. [editline]6th January 2015[/editline] [QUOTE=meharryp;46867768]Are base_ai entities supposed to respond to NPCs attacking them, even without being told to do so?[/QUOTE] A standard base_ai entity? No.
[QUOTE=zzaacckk;46868565][/QUOTE] And where should I put that?
[QUOTE=Scarface3353;46868627]And where should I put that?[/QUOTE] In some appropriate clientside file
Bump from earlier: What function can I use to play sounds from the web without opening a panel or the steam overlay etc
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/sound/PlayURL]sound.PlayURL[/url]
What is the purpose in the drive entity system thing for "mv" and "cmd"? The wiki is very lacking in information on this library.
[QUOTE=Ylsid;46874650]What is the purpose in the drive entity system thing for "mv" and "cmd"? The wiki is very lacking in information on this library.[/QUOTE] The drive functions are just bindings to [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/CreateMove]GM/CreateMove[/url] , [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/SetupMove]GM/SetupMove[/url] and etc, read the documentation for those and these. [URL="http://wiki.garrysmod.com/page/Category:CMoveData"]CMoveData[/URL] [URL="http://wiki.garrysmod.com/page/Category:CUserCmd"]CUserCmd[/URL]
"mv" is the movedata and "cmd" is the user command. [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/drive/StartMove"]drive.StartMove[/URL] It tells you what the objects represent on the page along with a brief description, and each one has a link to the relevant wiki page that has a longer explanation and list of functions. [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][URL="http://wiki.garrysmod.com/page/Category:CMoveData"]CMoveData[/URL] [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][URL="http://wiki.garrysmod.com/page/Category:CUserCmd"]CUserCmd[/URL]
Here's something else about drive I don't understand: how "Origin" and "Velocity" interact. What is the purpose of having both? Why not just have origin and modify it according to a velocity variable as one might expect? It would be very helpful if someone put together some sort of basic car or something as I'm at am impasse how on earth to get it working as one, which is presumably the purpose of said drive entity.
Sorry, you need to Log In to post a reply to this thread.