• GMod - What are you working on? November 2017 (#75)
    191 replies, posted
[img]https://i.imgur.com/3BwwlNC.png[/img] [B]Highlights from the [URL="https://facepunch.com/showthread.php?t=1580650"]previous thread[/URL][/B] [QUOTE=AlbertoBC's Desolation gamemode;52739034]I've been advancing progress in Desolation. One of the bigger things is the new dreaming mechanic: [video=youtube;epVBhKuMuIU]https://www.youtube.com/watch?v=epVBhKuMuIU&feature=youtu.be[/video] The video is low res, has glitches and there are some soft cuts (to show multiple "hints"), but you can get the idea. Basically there are some items that'll appear from time to time that, on use, will reveal a cryptic hint about something random (crafting skill required for a certain item, useful items, etc.). Also, if there's a main symptom present (hunger, thirst, cold, hot, etc.), random words will appear and vanish in the screen revealing ways to counter those symptoms.[/QUOTE] [QUOTE=Invule's menu;52746337]Talking about UI's... Not much but got the base of it done, now it's time to implement the fun stuff!! [t]https://i.imgur.com/VB1US2g.png[/t] [t]https://i.imgur.com/9e6DCGZ.png[/t] [t]https://i.imgur.com/ihcfQhC.png[/t] Always appreciate feedback![/QUOTE] [QUOTE=Moat's emotes;52748649]i made this after 27 hours of no sleep [IMG]https://i.imgur.com/hIzW2TI.gif[/IMG] i think im just going to make more facepunch smilies until i get tired [editline]October 5th 2017[/editline] i was about to finish this one but i think im starting to lose vision from sitting at the computer for too long also have no idea why im doing this going to go to sleep now [IMG]https://i.imgur.com/VziMsbE.gif[/IMG][/QUOTE] [QUOTE=vrej's gDisasters effects;52770966]gDisasters has over 40 unique particle effects of tornadoes for 9 different tornado types. Here are two of them: Tornado: [img]https://steamuserimages-a.akamaihd.net/ugc/88220693548075481/5E8EB2CA0A209F10F59719D801CEEE862EEBEFFB/[/img] Firenado: [img]https://steamuserimages-a.akamaihd.net/ugc/88220071327361051/A7DB4122E6BE215AE41EFA2740289966A9E82F41/[/img] [img]https://steamuserimages-a.akamaihd.net/ugc/88220420645000564/DBC0F050AB196C20DB49A0441AD001B90D6C7627/[/img] [QUOTE=vrej;52772941]Here you go: [img]https://i.imgur.com/KAfkdyZ.gif[/img][/QUOTE][/QUOTE] [QUOTE=Heroezzz' 3D2D circle;52782024]Circle 2d3d [CODE]hook.Add("HUDPaint","Math",function() for double = 1,14 do local xd = math.sin( CurTime() * 2+double ) * 40 + 40 local yd = math.cos( CurTime() * 2+double ) * 40 + 40 for i=1,90 do local x = math.sin( CurTime() * 1+i ) * 120 + ScrW()/2 local y = math.cos( CurTime() * 1-i ) * 120 + ScrH()/2 surface.SetDrawColor(HSVToColor( CurTime() % 6 * 60, 1, 1 )) surface.SetMaterial(Material("effects/softglow")) --effects/softglow surface.DrawTexturedRect(x + xd, y + yd, 16, 16) end end end)[/CODE] [IMG]https://i.imgur.com/tfZQzmj.gif[/IMG][/QUOTE] [QUOTE=MPan1's 3D bullet holes;52787714]Minor update: I made the bullet holes move with entities rather than being static on the map: [video]https://youtu.be/cEpU9TZqnQI[/video] As you can see, lag is still a problem though. [QUOTE=MPan1;52787793]It works sometimes depending on the size: [video]https://youtu.be/uWc2CrWGO2E[/video][/QUOTE][/QUOTE] [QUOTE=Darkomni's Super Monkey Ball gamemode;52796116][video=youtube;4PM0i4HHEpY]https://www.youtube.com/watch?v=4PM0i4HHEpY[/video] Finally got around to fixing up this gamemode and making it legitimately playable. Built ten levels very quickly with a buddy - it's a lot of fun! Controls exceptionally well up to about 100-120ms ping, but past that, precision navigation is a chore. Dunno why the camera is a lot more fussy when rolling around on props as opposed to world geometry - it jitters a bit, but nothing that impacts gameplay to any extent. Building levels is easy peasy - you create them out of props. If there's interest I may release the level saver I've made, so people can have a go at making their own. I'm going to be adding support for moving / animated pieces soon. If you'd like to try out the prototype you see in this video, the server address is [b]bites.hopto.org:27016[/b][/QUOTE] [QUOTE=CapsAdmin's PAC3 external imports;52800660]A while back I added the ability to load mdl files externally to PAC3. This works by adding the model you want along with its assets to a zip file without compression, upload the zip file somewhere and put the url in the editor. Then there's some lua that reads the zip and creates a gma archive with the content. The difficult part is that I have to "hex" the models to make them not collide with other models. So if you have an archive like this: [code]materials/models/aw/body.vmt materials/models/aw/body.vtf models/aw/Asura.dx80.vtx models/aw/Asura.dx90.vtx models/aw/asura.mdl models/aw/asura_animations.mdl models/aw/Asura.phy models/aw/Asura.sw.vtx models/aw/asura.vvd[/code] it gets turned into this [code]materials/pac3/123456789/body.vmt materials/pac3/123456789/body.vtf models/pac3/123456789/model.dx80.vtx models/pac3/123456789/model.dx90.vtx models/pac3/123456789/model.mdl models/pac3/123456789/model_inc_1.mdl models/pac3/123456789/model.phy models/pac3/123456789/model.sw.vtx models/pac3/123456789/model.vvd[/code] To do this I have to edit the mdl and vmt files in lua and change where it should look up its resources. This can also be loaded on the server so hitboxes and everything is correct. Some examples of a player model and a non player model: [img]https://i.imgur.com/NrDFh22.jpg[/img][img]https://i.imgur.com/W8uVyGQ.png[/img] A long with this I've added some material parts to PAC3 that are closer to source engine. [img]https://i.imgur.com/298kuR5.png[/img] [img]https://i.imgur.com/5g75v8m.png[/img] It should cover everything source engine can do, although I've manually renamed some properties to make them group together. I'll probably remove some properties that don't make sense or don't work in source engine at all, etc. I've done a lot already based on feedback from people experimenting. This is the list of material parameters I've built [url]https://github.com/CapsAdmin/pac3/blob/master/lua/pac3/libraries/shader_params.lua[/url] It was first semi automatically built based on source engine headers and then later on hand edited based on valve wiki. Maybe it's useful for the wiki? I'm really happy that this has given some people the motivation to make models and animations in blender and whatnot. It's more of a useful skill in the real world than pac3.[/QUOTE] [QUOTE=Ilyaaa's HUD;52804231]Making a new hud for my bhop gamemode [IMG]https://puu.sh/y3jg0/9fcfcf137a.gif[/IMG] thots? [QUOTE=Ilyaaa;52809987][t]https://steamuserimages-a.akamaihd.net/ugc/862863063072791703/04E8E33553A062595271A0EF175933B33FEA6DE2/[/t] Added keys and completely redid how I create the 3D hud. Will probably completely redo it again soon for some performance improvements, but for now I'm glad I was able to get the math right because I barely know dick about Vector and Angle math. [URL="https://gist.github.com/IlyaShastin/3cddee60307219dcfb67655b02055a85#file-3dpaintablepanel-lua"]Heres how I do it.[/URL] Pretty much creates a 3D cam and renders a 3D2D cam inside it from all the 3DPaintablePanels. Can be pretty fps impactful if you have alot of them (haven't done too much optimization yet). 2 doesn't seem to do much to my fps. I think a better alternative would be to render to a texture then just put that in the 3D cam... but thats work for another day... [URL="https://gist.github.com/IlyaShastin/3cddee60307219dcfb67655b02055a85#file-example-lua"]Heres how I make the keys for example.[/URL] Theres some lazy/dumb shit in there because I was getting tired and probably won't address them until I make a better version. Like how w and h in Paint3D are always ScrW and ScrH... Either way maybe you can find something useful in there.[/QUOTE][/QUOTE]
Those are some great quality highlights! Can't wait to see what else gets shown off this month ^.^,
[t]https://i.imgur.com/JbsOtTq.jpg[/t] I'm still tweaking the MOTD I'm making. I think the colors are good now. It also highlights the tab you choose now. I should mention that I know next to nothing about glua so this is all a learning experience for me.
[QUOTE=Shendow;52844718]Messing with FFT or something (maybe loud): [vid]https://my.mixtape.moe/yleuxf.webm[/vid][/QUOTE] How do you get those sound waves? Are they completely random?
Turns out you need to call the Tick hook for gm_bromsock to work.
Currently working on a complete implementation of the Color class. - The constructor now takes hex strings ("#RGB", "#RGBA", "#RRGGBB", and "#RRGGBBAA") as well as tables (i.e. {r = 1-255, g = 1-255, b = 1-255}) - You can also use Color.FromHSL() and Color.FromHSV() - New functions so far: [code] - Color:GetHue() - Color:GetSaturation() - Color:GetLightness() - Color:GetValue() - Color:GetHSL() - Color:GetHSV() - Color:GetHSLV() - Color:SetHue() - Color:SetSaturation() - Color:SetLightness() - Color:SetValue() - Color:SetHSL() - Color:SetHSV() [/code] Planned functions: [code] Color:Blend(color, frac) Color:Invert() [/code]
[QUOTE=wauterboi;52846480]Currently working on a complete implementation of the Color class. - The constructor now takes hex strings ("#RGB", "#RGBA", "#RRGGBB", and "#RRGGBBAA") as well as tables (i.e. {r = 1-255, g = 1-255, b = 1-255}) - You can also use Color.FromHSL() and Color.FromHSV() - New functions so far: [code] - Color:GetHue() - Color:GetSaturation() - Color:GetLightness() - Color:GetValue() - Color:GetHSL() - Color:GetHSV() - Color:GetHSLV() - Color:SetHue() - Color:SetSaturation() - Color:SetLightness() - Color:SetValue() - Color:SetHSL() - Color:SetHSV() [/code] Planned functions: [code] Color:Blend(color, frac) Color:Invert() [/code][/QUOTE] Reminds me of the old pull request I did for [url=https://github.com/Facepunch/garrysmod/pull/1202]HSL support[/url] back in 2016. Never heard from the devs tho. HSV is the superior color format over HSL, however HSL is outright easier/better when you need a human to set and/or understand a color value (e.g. HUD's). Nothing beats LAB tho
[QUOTE=wauterboi;52846480]Planned functions: [code] Color:Invert() [/code][/QUOTE] Surely invert wouldn't take very long to implement? [CODE] function Invert(color) return Color( 255 - color.r, 255 - color.g, 255 - color.b, color.a ) end [/CODE] I guess it might take longer if you have a separate color system for each type, e.g. hex colors might be harder, but you could just convert everything to RGB
[QUOTE=wauterboi;52846480]Currently working on a complete implementation of the Color class. [code] - Color:GetHue() - Color:GetSaturation() - Color:GetLightness() - Color:GetValue() - Color:GetHSL() - Color:GetHSV() - Color:GetHSLV() - Color:SetHue() - Color:SetSaturation() - Color:SetLightness() - Color:SetValue() - Color:SetHSL() - Color:SetHSV() [/code][/QUOTE] You might find some of my old functions useful (I've cut the functions you already made):[code] -- Get Luma amount function ColorToLuminance(_color) return 0.2126 * _color.r + 0.7152 * _color.g + 0.0722 * _color.b end function COLOR:ToLuminance() return ColorToLuminance(self) end -- Color manipulation function COLOR:Lighten(num) local h,s,l = ColorToHSL(self) return HSLToColor(h,s,l + num) end function COLOR:Darken(num) return self.lighten(-num) end function COLOR:Invert() return Color(255 - self.r,255 - self.g,255 - self.b) end function COLOR:ToGrayscale() local H,S,L = self:ToHSL() return HSLToColor(H,0,L) end -- Color functions function COLOR:IsBright() return ColorToLuminance(self) >= 127.5 end function COLOR:IsDark() return not self:IsBright() end[/code] Luma is useful to determent what text-color should be used.
[QUOTE=Nak;52847640] [code]function COLOR:IsBright() return ColorToLuminance(self) >= 127.5 end function COLOR:IsDark() return not self:IsLight() end[/code] [/QUOTE] Should it be 'return not self:IsBright()' or did you leave something out?
[QUOTE=zeaga;52848136]Should it be 'return not self:IsBright()' or did you leave something out?[/QUOTE] Ups .. kinda renamed it without noting it. Fixed it now.
I've lost count of how many times I've made Source shit itself while trying to get this to work, but I finally did it. [video=youtube;MQ0l8aMvKN4]https://www.youtube.com/watch?v=MQ0l8aMvKN4[/video] Since stencil code examples are very hard to find here's my code: [url]https://pastebin.com/KMzUXraz[/url] It's not finished though, I have to recalculate the lighting and figure out a way to make the muzzleflash show up in front of the stencils. Anyone who knows these dark secrets please share :pyramid:
[QUOTE=buu342;52848681]I've lost count of how many times I've made Source shit itself while trying to get this to work, but I finally did it. Since stencil code examples are very hard to find here's my code: [url]https://pastebin.com/KMzUXraz[/url] It's not finished though, I have to recalculate the lighting and figure out a way to make the muzzleflash show up in front of the stencils. Anyone who knows these dark secrets please share :pyramid:[/QUOTE] If you use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/ClearBuffersObeyStencil]render.ClearBuffersObeyStencil[/url] instead of cam.IgnoreZ I think the muzzle should work.
[QUOTE=buu342;52848681]I've lost count of how many times I've made Source shit itself while trying to get this to work, but I finally did it. [video=youtube;MQ0l8aMvKN4]https://www.youtube.com/watch?v=MQ0l8aMvKN4[/video] Since stencil code examples are very hard to find here's my code: [url]https://pastebin.com/KMzUXraz[/url] It's not finished though, I have to recalculate the lighting and figure out a way to make the muzzleflash show up in front of the stencils. Anyone who knows these dark secrets please share :pyramid:[/QUOTE] THANK YOU FOR INCLUDING THE CODE! I don't know how to use stencils so I can't help with the muzzleflash but I'll give you what I know! Make sure the ENT:Initialize function is server side only by putting this inside of it before anything else: [lua] if CLIENT then return end [/lua] It will make the physgun follow the thing when you move it around, I know it's not much but it's just a little thing to make it look nicer :-)
[QUOTE=ralle105;52848737]If you use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/ClearBuffersObeyStencil]render.ClearBuffersObeyStencil[/url] instead of cam.IgnoreZ I think the muzzle should work.[/QUOTE] Worked like a charm! Thank you! [QUOTE=Ubre;52848744]THANK YOU FOR INCLUDING THE CODE! I don't know how to use stencils so I can't help with the muzzleflash but I'll give you what I know! Make sure the ENT:Initialize function is server side only by putting this inside of it before anything else: [lua] if CLIENT then return end [/lua] It will make the physgun follow the thing when you move it around, I know it's not much but it's just a little thing to make it look nicer :-)[/QUOTE] To be honest I half assed that entity, and it wasn't really meant to be moveable to begin with as I wanted it to be placed in walls, but thank you anyway ^^
Jesus Christ So here are the functions that are for sure available: [code] function Color:new() -- can be called by just Color, and with '#RGB', '#RGBA', '#RRGGBB', '#RRGGBBA', a table with the keys 'r', 'g', 'b', and 'a', and your normal 3-4 argument method function Color:__tostring() -- prints to one line function Color.__add(leftHand, rightHand) -- adds colors together function Color.__sub(leftHand, rightHand) -- subtracts colors together function Color.__mul(leftHand, rightHand) -- multiply by number, table, or color function Color:GetIntermediateValues() -- used to cache things shared by a lot of the computation ('get') functions - pass the results to the other functions function Color.GetHue(arg) function Color.GetSaturation(arg) function Color.GetLightness(arg) function Color.GetLuminance(arg) function Color.GetHSL(arg) function Color.GetHSV(arg) function Color.FromHSL(hue, saturation, lightness, alpha) -- creates a new color function Color.FromHSV(hue, saturation, value) -- creates a new color function Color:SetHue(newHue) -- Sets the hue to a specific number function Color:SetSaturation(newSaturation, fallbackHue) -- Sets the saturation to a specific number. fallbackHue is when you set it so low that it no longer has a hue function Color:SetValue(newValue, fallbackHue) -- same for value function Color:SetLightness(newLightness, fallbackHue) -- same for lightness function Color:RotateHue(addHue) - this adds to the hue itself function Color:Invert() -- this inverts all channels exactly function Color:Blend(target, frac) -- basically lerp for colors [/code] Also did an override on type() to simulate custom types
[QUOTE=buu342;52848681]Since stencil code examples are very hard to find here's my code: [url]https://pastebin.com/KMzUXraz[/url][/QUOTE] Why is the reference value 43? If you set it to 1 you could probably be able to set the write and test masks to 1 as well. Also, it's faster to cache materials, such as Material( "models/misc/dirtfloor001a" ) in your case, outside a render loop. Also, there's some really good reference code I used for a stencil thing [URL="https://github.com/MattJeanes/world-portals/blob/master/lua/entities/linked_portal_door/cl_init.lua#L19-L44"]here[/URL]. Just [URL="https://github.com/MattJeanes/world-portals/blob/master/lua/entities/linked_portal_door/cl_init.lua#L31-L34"]replace these lines[/URL] with whatever you use to draw the mask, and [URL="https://github.com/MattJeanes/world-portals/blob/master/lua/entities/linked_portal_door/cl_init.lua#L40-L42"]these lines[/URL] with whatever you use to draw something in the mask.
As beta cuck always looking to receive society's approval because I think so little of myself (joke), I'm proud of the improvement I had made in my gamemode's UI. Some of the people who are a part of this thread's discussion have also commented on the original thread but I'm here just to showboat a little. Old menu system: [IMG]https://i.imgur.com/EbEU44O.jpg[/IMG] - [IMG]https://i.imgur.com/bjsM3cB.jpg[/IMG] New System: [IMG]https://i.imgur.com/XCM24yU.jpg[/IMG] - [IMG]https://i.imgur.com/UdATqkn.png[/IMG] - [IMG]https://i.imgur.com/A6F8lCY.png[/IMG] - [IMG]https://i.imgur.com/HxioxlS.png[/IMG] The old iteration of menu was the third one I had ever created, and the new one is officially my 4th ever. As someone who was always [QUOTE=Deathking15;52850582]FUNCTIONALITY OVER FORM.[/QUOTE] I'm quite happy with myself.
[QUOTE=Deathking15;52850582]As beta cuck always looking to receive society's approval because I think so little of myself (joke), I'm proud of the improvement I had made in my gamemode's UI. Some of the people who are a part of this thread's discussion have also commented on the original thread but I'm here just to showboat a little. -snip- The old iteration of menu was the third one I had ever created, and the new one is officially my 4th ever. As someone who was always I'm quite happy with myself.[/QUOTE] Awesome gui work! Tip 1: You can use [t][./t] tags to make smaller images. Tip 2: Use Material("path/to.png","smooth") to make them less pixellated.
[QUOTE=bobbleheadbob;52850698]Tip 2: Use Material("path/to.png","smooth") to make them less pixellated.[/QUOTE] [URL="https://facepunch.com/showthread.php?t=1582636&p=52829551&viewfull=1#post52829551"]I did a huge post about Material parameters on his thread before. It might help someone in the future so I'm linking it here.[/URL]
[QUOTE=MPan1;52850709][URL="https://facepunch.com/showthread.php?t=1582636&p=52829551&viewfull=1#post52829551"]I did a huge post about Material parameters on his thread before. It might help someone in the future so I'm linking it here.[/URL][/QUOTE] Tbh .. this should be on the wiki. Its really an in-depth post you made.
[QUOTE=MPan1;52850224]Why is the reference value 43? If you set it to 1 you could probably be able to set the write and test masks to 1 as well. Also, it's faster to cache materials, such as Material( "models/misc/dirtfloor001a" ) in your case, outside a render loop. Also, there's some really good reference code I used for a stencil thing [URL="https://github.com/MattJeanes/world-portals/blob/master/lua/entities/linked_portal_door/cl_init.lua#L19-L44"]here[/URL]. Just [URL="https://github.com/MattJeanes/world-portals/blob/master/lua/entities/linked_portal_door/cl_init.lua#L31-L34"]replace these lines[/URL] with whatever you use to draw the mask, and [URL="https://github.com/MattJeanes/world-portals/blob/master/lua/entities/linked_portal_door/cl_init.lua#L40-L42"]these lines[/URL] with whatever you use to draw something in the mask.[/QUOTE] Of the little documentation/examples I could find on stencils, I was told that the reference value is arbitrary which we would use for the comparisons (essentially, a stencil identifier), and we should avoid reference number 1 as it is used by Garry's glow effect. But documentation on the subject is so scarce that I pretty much believe whatever is told to me :v:
Working on my police prop spawning (trunks) Just gotta get snapping completed and it's done. Feedback welcomed. [QUOTE] [video=youtube;k9dTxGv9zn4]https://www.youtube.com/watch?v=k9dTxGv9zn4[/video] [/QUOTE]
[QUOTE=Nak;52851353]Tbh .. this should be on the wiki. Its really an in-depth post you made.[/QUOTE] Thanks, but I'm not sure it's accurate... [B]EDIT:[/B] [URL="http://wiki.garrysmod.com/index.php?title=Material_Parameters"]Added it anyway[/URL]. Sorry to whoever has the job of fixing that mess (Robotboy). I also added a bit bobbleheadbob told me today. Thanks!
[QUOTE=Nykez;52852724]Working on my police prop spawning (trunks) Just gotta get snapping completed and it's done. Feedback welcomed.[/QUOTE] The animation is really slow and could annoy players who are actively using it, maybe have it show only one time instead? Looks neat nonetheless!
Got bored so I decided to play around and make a kind of save-apartment / house type of thing - where if the user is within the house area all their props show from before and when they leave they're removed and saved. [QUOTE][vid]http://webm.land/media/O3B0.webm[/vid] [/QUOTE]
[QUOTE=iRyno;52855295]Got bored so I decided to play around and make a kind of save-apartment / house type of thing - where if the user is within the house area all their props show from before and when they leave they're removed and saved.[/QUOTE] How are the apartments designated?
[QUOTE=bobbleheadbob;52856437]How are the apartments designated?[/QUOTE] Using Zones :duh:
What can be cooler than two black holes merging? I dunno, but certainly this is pretty sweet. [IMG]https://i.imgur.com/PftiLU3.gif[/IMG]
[QUOTE=bobbleheadbob;52856437]How are the apartments designated?[/QUOTE] Right now, it's just vector positions - will plan to eventually try and get rooms / room spaces registered.
Sorry, you need to Log In to post a reply to this thread.