730 Results
Did you even do the most basic of google searches? This has been answered hundreds of times. http://wiki.garrysmod.com/page/Grid-Based_Inventory_System
stealthpaw Lua Developer Discussion Reply
It might be possible if you were to overlay the desired hands model using something like bone-merge and hide the existing one, but it would be very hacky and unreliable i expect.
stealthpaw Lua Developer Discussion Reply
Are you sure Gamemode:NewRound() is being called?
stealthpaw Lua Developer Discussion Reply
Update! Thanks people, after much struggle i have implemented a simplified version of Dijkstra. Result: https://files.facepunch.com/forum/upload/654/a985acaa-c048-40fe-abac-a1f754e119e9/image.png
stealthpaw Lua Developer Discussion Reply
Thanks for the replies! I'll check out an implementation of A* and see how that goes.
stealthpaw Lua Developer Discussion Reply
Hi all. I need to calculate the fastest path in an array of vectors to get from X-start to Y-target. Illustration: https://files.facepunch.com/forum/upload/654/9b3550e1-8d20-4427-9fe4-c9e0d65139f7/image.png I have tried various ways to work this out to no avail. Can anyone...
stealthpaw Lua Developer Discussion Reply
Calculate fastest path in vector array
stealthpaw Lua Developer Discussion Thread
Looks like you are trying to run it in a shared file. ents.Create is a server-side only function. I'm not 100% sure because i've not used it before but ProjectedTexture might also suit your needs.
stealthpaw Lua Developer Discussion Reply
Post your code and we can try to see why it didn't work, but as Rubat said, a lamp is what you are after. Dynamic lights work more like a light-bulb with an area of light.
stealthpaw Lua Developer Discussion Reply
This is exactly what Garry has so far said it is not. S&box as far as we know it is more of a wrapper for developing games the UE4 engine.
stealthpaw Sandbox Game Reply
http://wiki.garrysmod.com/page/Entity/ResetSequence cameraShipPlayer:ResetSequence( cameraShipPlayer:LookupSequence( "idle_all_01" ) )
stealthpaw Lua Developer Discussion Reply
Thanks for the response @zamboni , i ended up going with the following function with help from another forum but you pointed me in the right direction. function input.GetCursorBearing( x, y ) local iX, iY = input.GetCursorPos() local t = math.atan2(iX - x, y - iY) if (t <...
stealthpaw Lua Developer Discussion Reply
Wow, that's a super creative way to spawn things! Very nice.
stealthpaw Lua Developer Discussion Reply
Bump. Anyone going to collect these coins?
stealthpaw Lua Developer Discussion Reply
Is it supposed to look so pixelated?
stealthpaw Lua Developer Discussion Reply
Hi all. Having trouble working out the math for making an arrow drawn with surface.DrawTexturedRectRotated point at the cursor. Can anyone help me with this? surface.SetDrawColor( color_white ) surface.SetTexture( surface.GetTextureID( "gui/arrow" ) ) local x, y = input.GetCu...
stealthpaw Lua Developer Discussion Reply
Cursor tracking on RectRotated
stealthpaw Lua Developer Discussion Thread
@TrickstarOG I published this a while back, maybe you can use it? Feel free to make a derivative if you want: https://steamcommunity.com/sharedfiles/filedetails/?id=1277801183
stealthpaw Lua Developer Discussion Reply
Facepunch is the last real forum i lurk and (rarely) post in. If it were to disappear i wouldn't bother finding a new one.
stealthpaw {{Meta}} Reply
For the time being i have registered again this year, but i have just entered my uni exam period so i will be many weeks late on starting if i do.
stealthpaw Lua Developer Discussion Reply
Same here in Australia. I was in the scouts for a few years while we did interesting things until it started just becoming who can remember the most ways to tie a knot.
stealthpaw Sensationalist Headlines Reply
What if some of those dependencies gets taken off the workshop? Your entire addon is now broken.
stealthpaw Sandbox Game Reply
This is pretty ironic considering Google just accepted them into their Summer of Code project.
stealthpaw Sensationalist Headlines Reply
I use continue in loops all the time with Lua? Plus how hard is it to do object = {} object.Action = function(self, parameter) end
stealthpaw Sandbox Game General Reply
The day i learned that i could use self in tables was the day i finally understood how to properly use Lua. Previous to that everything had been hacky and unreliable.
stealthpaw Lua Developer Discussion Reply
Except they are the only way of maintaining player data over sessions unless you make your own SQL database functions, but considering InVaLiD is having with even basic functions i doubt he is going to be learning SQL any time soon.
stealthpaw Lua Developer Discussion Reply
What is there to get? If by "init only" you mean server only and you need to save data about a player on the server and that data is only available on the client then you need to send that data from the client to the server for saving. Read this wiki page about how to do that....
stealthpaw Lua Developer Discussion Reply
I would use this approach or something similar: local Limits = {Default = 10} Limits.entity_name = 5 local function BuyEntity(ply, Name) if !IsValid(ply) then return end ply.boughtEntities = ply.boughtEntities or {} if (ply.boughtEntities[Name] or 0) >= (Limits[Name] or L...
stealthpaw Lua Developer Discussion Reply
I'm trying to figure out how to translate a 3D map vector ( lets say Vector(100,200,0) ) to a 2d coordinate within a frame. Can anyone assist me with this? I've tried a few things but can't seem to work out the math and it's got me stumped. I've kind of illustrated what i'm th...
stealthpaw Lua Developer Discussion Reply
Translating 3D vectors to 2D coordinates
stealthpaw Lua Developer Discussion Thread
This is exactly what i was wondering a few days ago before i made a hacky workaround. Thanks!
stealthpaw Lua Developer Discussion Reply
stealthpaw {{Meta}} Reply
When you say "no gamemode evolving" are you simply ignoring DarkRP, TTT, ZS, GMS and their many, many variations that have been constantly played, changed and improved over the history of Garry's Mod? Nobody said being 3D made coding harder, i don't know where you got that fro...
stealthpaw Lua Developer Discussion Reply
There is a HUGE difference between making total conversion mod for a 2D game like SS13 then it is a 3D game like Gmod. To make something that looks even somewhat aesthetically different to the source engine Garry's Mod is built on, it requires vast amounts of time and effort t...
stealthpaw Lua Developer Discussion Reply
Finally got around to publishing the Emoji addon today that i showcased in WAYWO many months back. I should probably apologize to all Gmod players in advance for this atrocity.
stealthpaw Lua Developer Discussion Reply
Good, but it should also have the bumping rule in a smaller font in the warning box too.
stealthpaw {{Meta}} Reply
No armor is not an entity, it is part of the health system built into the source engine. local mySWEP = "your_swepClass" hook.Add( "EntityTakeDamage", "BypassArmor", function( target, dmginfo ) if target:IsPlayer() and dmginfo:GetAttacker():GetActiveWeapon():GetClass() == myS...
stealthpaw Lua Developer Discussion Reply
No, EntityTakeDamage != ShouldCollide
stealthpaw Lua Developer Discussion Reply
Whoops. Fixed. As i mentioned, i didn't test. [edit] I can think of a few more ways to achieve what you are looking for @Lenny Lennington but you should investigate these things on the wiki yourself.
stealthpaw Lua Developer Discussion Reply
Not really, @mx.silent . This can be achieved with something along these lines (not tested): hook.Add( "EntityTakeDamage", "BypassArmor", function( target, dmginfo ) if target:IsPlayer() then local newHealth = target:Health() - dmginfo:GetDamage() dmginfo:SetDamage( 0 )...
stealthpaw Lua Developer Discussion Reply
Yes, it is possible, but not practical. Entity
stealthpaw Lua Developer Discussion Reply
You seem to be misunderstanding how Lua files are read and how hooks work. Not tested, but this should do it: local function comma_value(amount) local formatted = amount while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if (k == 0) then ...
stealthpaw Lua Developer Discussion Reply
Rather then calling LocalPlayer() over and over, at the top put local ply = LocalPlayer() then use ply, makes things more readable. Also, when using surface.GetTextSize(), since the first parameter is always width you don't need to put the 2nd (h) into a variable. local HTSize...
stealthpaw Lua Developer Discussion Reply
local myTab = {"tab1","tab2"} local wait local i = 0 hook.Add( "Think", "SleepTest", function( ply, data ) for _,v in ipairs(myTab) do if (wait or 0) > CurTime() then continue end if i >= #myTab then wait = CurTime() + 1 print("Sleeping...") i = 0 end i = i + 1 print...
stealthpaw Lua Developer Discussion Reply
I see you are pretty much only using the surface library, but you can also use the http://wiki.garrysmod.com/page/Category:draw draw library, which are essentially helper functions to reduce the amount of code needed. For example, you do: surface.SetFont("Default") surface.Set...
stealthpaw Lua Developer Discussion Reply
HUD painting is usually a clusterfuck, the usual way to reduce the pile is to create local functions for repeated tasks.
stealthpaw Lua Developer Discussion Reply
Uh ? It will skip some index no ? Yes - fixed; local wait local i = 0 for _,v in ipairs(myTab) do    if (wait or 0) > CurTime() then continue end   if i >= #myTab then wait = CurTime() + 1 i = 0 end -- sleep 1 sec    i = i + 1   -- do stuff  end
stealthpaw Lua Developer Discussion Reply
local wait for _,v in ipairs(myTab) do    if (wait or 0) > CurTime() then continue end   wait = CurTime() + 1 -- sleep 1 sec    -- do stuff  end
stealthpaw Lua Developer Discussion Reply
Not that i'm aware of, but i have no idea why you would want to go to all that extra work anyway.
stealthpaw Lua Developer Discussion Reply
[QUOTE=DaCommie1;53050172]When I heard about this, I had to ask myself what kind of racist shitbag goes after a fucking child?[/QUOTE] Likely the same kind of mentality that allows the throwing of acid on a childs face for not conforming to a religion. In fact, this kind of ...
stealthpaw Sensationalist Headlines Reply
[QUOTE=Reflex F.N.;53039073]I had been using Windows from the age of 3 till the age of 19, then I decided to switch to GNU/Linux just to try it out. It's been two years since that time and I am still using GNU/Linux. Honestly, if you use Ubuntu, the first month is the o...
stealthpaw Sensationalist Headlines Reply
A relevant read: https://wiki.garrysmod.com/page/Object_Oriented_Lua
stealthpaw Developing Reply
If you were going for an MS Paint-esk feel, it's looking great.
stealthpaw Developing Reply
You are likely drawing the HUD using the HUD Paint hook but AvatarImage is a panel so you are creating a new panel every frame the HUD is in view. This question has been answered many many times before but in different ways, try googling the keyword AvatarImage around facepu...
stealthpaw Developing Reply
Never forget.
stealthpaw Sandbox Game General Reply
Could be a colony ship constructed out of an asteroid? [URL="http://sidonia-no-kishi.wikia.com/wiki/Sidonia"][IMG]https://vignette4.wikia.nocookie.net/sidonia-no-kishi/images/e/ec/Sidonia.png/revision/latest?cb=20151116003332[/IMG][/URL]
stealthpaw Sensationalist Headlines Reply
You don't have permission to view this result. It's probably in a forum that your account has no access to.
Unfortunately you have no idea what you are talking about. You probably already use countless desktop applications that use HTML for their GUI. Use Discord? Twitch? Google Music? Github? Spotify? Chrome extensions? All made in HTML/JavaScript. Here is a list of just a few ap...
stealthpaw Sandbox Game General Reply
I think you are wanting to make a new spawn menu tab? If so look at spawnmenu.AddCreationTab.
stealthpaw Developing Reply
Why do you need help? Errors? Problems? At least put in a base amount of effort if you want the help of others.
stealthpaw Developing Reply
Remove the boot animation and it's very nice.
stealthpaw Developing Reply
It may have something to do with surface.GetTextSize() returning different values because the font is changing. You need to call surface.SetFont("MyFont") before using surface.GetTextSize(), otherwise it will use the text size that was last set in the frame buffer.
stealthpaw Developing Reply
I feel really unconformable posting an entire thread just for a singular video/image, maybe it's just the mega-thread mentality that has been around for so many years, but i just really don't see the point of creating an entire thread for a few passing thoughts on what i'm cur...
stealthpaw Meta Reply
Generally unless a function has 'local' in front of it, they are global and can be called from any lua file regardless of it's location. If DarkRP's function name to bring up the job menu is OpenDarkRPMenu() then you just call that in your entity. If the function is local then...
stealthpaw Developing Reply
This forum might be more appropriate: Help & Support
stealthpaw Developing Reply
https://files.facepunch.com/garry/43ddf103-2b9b-4ea6-abdf-4a1ae4eb58fc.png
stealthpaw General Discussion Reply
You might want something like this: function ENT:Use(ply) ply.beforeJug = { Armor = ply:Armor(), RunSpeed = ply:GetRunSpeed(), WalkSpeed = ply:GetWalkSpeed(), Model = ply:GetModel() } ply:SetArmor(200) ply:SetRunSpeed(150) ply:SetWalkSpeed(110) ply:SetModel( "mod...
stealthpaw Developing Reply
Can we get profile pictures on profiles and not just posts? I associate people with their profile picture and it helps to quickly identify where i am.
stealthpaw Meta Reply
stealthpaw General Discussion Reply
I think he was referring to the fact that the information i provided you with, was incredibly easy to obtain with some very simple searching skills. You will be amazed at the variable plethora of "help" you can find with a simple google search.
stealthpaw Developing Reply
I have seen a few over the years, but those two are the only ones that are actually used i'm pretty sure.
stealthpaw Developing Reply
Take a look at the sample code on this page: GM:PostPlayerDraw It's pretty self explanatory.
stealthpaw Developing Reply
Then just use a loop: local function countJobs( jobs ) local i = 0 for _,v in pairs( jobs or {} ) do i = i + team.NumPlayers(v) end return i end print( countJobs( {TEAM_JOB, TEAM_JOB1} ) ) // 5 if there are 2 players in TEAM_JOB and 3 players in TEAM_JOB1
stealthpaw Developing Reply
To count a table with numbered keys you just use #: local tab = { 1, 2, 3 } print( #tab ) // 3 If the keys are non-numeric then you need to do something different, such as manually counting the keys in a for-each loop or using table.count (inefficient for things done every tic...
stealthpaw Developing Reply
Creator of anime Rurouni Kenshin charged with possession of child porn
stealthpaw Sensationalist Headlines Thread
[URL]https://www.animenewsnetwork.com/news/2017-11-21/rurouni-kenshin-creator-nobuhiro-watsuki-charged-with-child-pornography-possession/.124308[/URL] [QUOTE] The Tokyo Metropolitan Police has charged 47-year-old manga creator Nobuhiro Watsuki (real name Nobuhiro Nishiwa...
stealthpaw Sensationalist Headlines Reply
RIP no voters, glad this drama is over... for now.
stealthpaw General Discussion Reply
The vote won't actually change/force anything. It's just an opinion vote, so the government doesn't need to legalize it even if everyone votes yes - they just look like dicks if they don't modify the laws to reflect it.
stealthpaw Polidicks Reply
[QUOTE=txike;52600815]I think I found a problem with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/JSONToTable]util.JSONToTable[/url].[/QUOTE] I can't think of any reason why you would want to do that anyway.
stealthpaw Developing Reply
Read title as "nano-transaction" and thought someone had implemented micro-transaction DLC for hospitals.
stealthpaw Sensationalist Headlines Reply
Anyone know how i can fix the Z layer issues with [URL="https://github.com/mattkrins/gfodder/blob/master/entities/entities/base_food_preparation.lua#L128"]3D2D[/URL]? [t]https://puu.sh/x4CmM/f47d1f0cfe.png[/t]
stealthpaw Developing Reply
[QUOTE=pierre0158;52547377]Keep the hook.Run/Call for others devs (if they want to make addons for your GM) and call your functions without using hooks.[/QUOTE] Nitpicking like you are is an obvious sign of jealousy and pretty unsightly to be honest. My gamemode is built...
stealthpaw Developing Reply
I'm going to apologize in advance... [vid]https://puu.sh/wZvd6/350f657163.mp4[/vid]
stealthpaw Developing Reply
[QUOTE=FPtje;52529812]Also, I probably don't fully understand your idea, but how would you plan on using it clientside?[/QUOTE] Easiest way would to just mount everything as usual but ignore any folder that isn't map/material/model/sound/resource. An even better method would b...
stealthpaw Developing Reply
[IMG]https://user-images.githubusercontent.com/2367602/28755154-c5fd8868-7597-11e7-855f-20bee32f275e.png[/IMG] [URL]https://github.com/mattkrins/gfodder[/URL] [t]https://cdn.discordapp.com/attachments/323588874905452554/341629464016322580/unknown.png[/t] [t]https://cdn.dis...
stealthpaw Developing Reply
Well that was too bloody close - I noticed my games HDD (obviously containing my gamemode) was going a bit slower then usual, so i did a scan and found a shit-ton of bad sectors. Immediately went out and bought a replacement today and I am currently in the process of backing u...
stealthpaw Developing Reply
[QUOTE=NeatNit;52499035]Yes, with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/halo/RenderedEntity]halo.RenderedEntity[/url], see example usage at [url]https://github.com/Facepunch/garrysmod/blob/784cd57576d85712fa13a7cea3a9523b4df966b0/...
stealthpaw Developing Reply
Does anybody know if it's possible to use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/halo/Add]halo.Add[/url] without it rendering over 3D2D materials, just the model?
stealthpaw Developing Reply
[QUOTE=Minelayer;52494976]Space Engineers prepared me for this.[/QUOTE] Reminded me more of Shattered Horizon.
stealthpaw Developing Reply
[url]https://facepunch.com/showthread.php?t=1560743&p=52492165#post52492165[/url]
stealthpaw Developing Reply
[QUOTE=pierre0158;52489532]okwhat restarting gmod fixed it spooky[/QUOTE] Looks like some junk data somehow made it's way into your net.Write call.
stealthpaw Developing Reply
Any Mappers available? My gamemode is nearly finished and it can use any map. That being said, a (simple) custom map would certainly add some icing to the cake.
stealthpaw Developing Reply
That shit-posting from before has [URL="http://i.imgur.com/frE7mp0.jpg"]really screwed[/URL] with the rendering of this page for me lol.
stealthpaw Developing Reply
[QUOTE=fruxodaily;52403714]I feel well have quantum personal consumer computers within at least the next 20-30 years. End of decade seems like a big stretch[/QUOTE] [QUOTE=Instant Mix;52403815]there's literally no reason to have a quantum personal computer. QCs are very go...
stealthpaw Sensationalist Headlines Reply
[QUOTE=colincooke;52340258]Children shouldn't be playing per the Steam subscriber agreement[/QUOTE] "I don't think thing should happen, so it isn't." Ignorance is bliss as they say.
stealthpaw Addons Reply
[QUOTE=colincooke;52338694]I don't see any rationale for this add-on over using Win+L[/QUOTE] You must be a highly intelligent unbiased rationally thinking individual then. What if someone only has access to a family computer which imposes a no personal accounts/passwords rul...
stealthpaw Addons Reply
[QUOTE=CelaeonSan;52336554]I believe you'd just have to reconnect to the server, I think passwords are per connection.[/QUOTE] It is actually per server. If you disconnect while locked, when you rejoin it will still be locked. To reset a password the server will need to be...
stealthpaw Addons Reply
Sick and tired of your siblings trying to interfere with your game while you go AFK? Ever needed that little bit more privacy or a way to password protect your game session without logging off? [B]Introducing Gmod Locker![/B] [img]http://i.imgur.com/Tn3iq6b.png[/img] [QUOTE...
stealthpaw Addons Reply
Gmod Locker
stealthpaw Addons Thread
[QUOTE=Robotboy655;52323779]net library.[/QUOTE] So is the net library faster & more efficient then concommands?
stealthpaw Developing Reply