• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
[QUOTE=ROFLBURGER;47111589]Yeah I already solved it. I used PlayerCommand or w/e it's called The thing with SetWalkSpeed is that virtually every Addon uses it (DarkRP, Admin Mods, Other Gamemodes, ect) so you're going to have conflicting speeds[/QUOTE] I'm using it in my SWEP's right now simply because it's meant for my game modes, but what I was going to do in the future for a public release is save the player's speed before the speed is modified, so it can roll back when it switches to a different weapon.
Anyone know what's the best way to add blur to a single prop? In this case an airplane propeller
I have another question <_< I'm making a swep for a gamemode and everyone has the same weapon, it switches between burst, semi auto, and full auto. Each mode has it's own stats but my problem is when anyone changes the fire mode the damage stats that are changed affect everyone. So my question is, how can I make a variable be specific for each individual person without using separate lua files for the weapon? Here is the paste pin [url]http://pastebin.com/2p3weh9y[/url]
[QUOTE=Hoffa1337;47111669]Anyone know what's the best way to add blur to a single prop? In this case an airplane propeller[/QUOTE] What do you mean exactly? You could blur it out a little with particles or if you want it somewhat invisible, you could change it's alpha with ent:SetColor ( Color ( 255, 255, 255, 120 ) ) You'd need to change its render group though. Or what ever it was called again.
What is the easiest and most good looking way to approach Depth of Field? I always seem to break the "Bokeh" blur, but the blur effect looks awesome. I just can't make it focus on whatever I'm looking at.
[QUOTE=robbert^^;47111705]What do you mean exactly? You could blur it out a little with particles or if you want it somewhat invisible, you could change it's alpha with ent:SetColor ( Color ( 255, 255, 255, 120 ) ) You'd need to change its render group though. Or what ever it was called again.[/QUOTE] I wanna achieve this effect without having to render an extra overlay on the propeller or having to replace the default propeller model: [t]http://lightroomkillertips.com/files/2012/03/badblur_lg.jpg[/t] SetColor doesn't look good and since we have one propeller model for each of our planes I need a good uniform solution that deals with all shapes and sizes. Edit: [QUOTE=mistopportuni;47111680]I have another question <_< I'm making a swep for a gamemode and everyone has the same weapon, it switches between burst, semi auto, and full auto. Each mode has it's own stats but my problem is when anyone changes the fire mode the damage stats that are changed affect everyone. So my question is, how can I make a variable be specific for each individual person without using separate lua files for the weapon? Here is the paste pin [url]http://pastebin.com/2p3weh9y[/url][/QUOTE] fireDelay = 0.12 fireMode = 1 fireDamage = 12 is your problem. You use 3 global variables for all weapons, this variables are shared between all weapons that use them meaning if one player updates, since it's a global, everyone else will be affected. use SWEP.fireDelay then reference the variable with self.fireDelay
[QUOTE=Hoffa1337;47111723]I -snip- [/QUOTE] Oh wow, ehm, I think you'd have to preform some dark stencil magic then, pm bobbleheadbob and he might be able to help you. My worry about it is is that it probaply will be an fps killer, atleast that was my last experience with stencil when I tried to do something with it. Good luck!
[QUOTE=Hoffa1337;47111723]I wanna achieve this effect without having to render an extra overlay on the propeller or having to replace the default propeller model: [t]http://lightroomkillertips.com/files/2012/03/badblur_lg.jpg[/t] SetColor doesn't look good and since we have one propeller model for each of our planes I need a good uniform solution that deals with all shapes and sizes. [/QUOTE] I am afraid that is impossible in GMod without using a separate mesh & texture for the blurred propeller, like airboat does.
[QUOTE=Robotboy655;47111959]I am afraid that is impossible in GMod without using a separate mesh & texture for the blurred propeller, like airboat does.[/QUOTE] blurring single objects would be so useful tho :( Drawing a mesh works fine for uniform single color propellers but for cases like pictured above makes it a bit more annoying if i want a sweeping solution for it. I'm trying to get away with as little work as possible here :p
[QUOTE=Hoffa1337;47112350]blurring single objects would be so useful tho :( Drawing a mesh works fine for uniform single color propellers but for cases like pictured above makes it a bit more annoying if i want a sweeping solution for it. I'm trying to get away with as little work as possible here :p[/QUOTE] For motion blur couldn't you draw the object in 14 rotations with reduced alpha? (probably look weird) Alternatively, could you draw the model in all possible rotations to make an oblong circle in the stencil buffer, then apply the motion blur screenspace effect, but only within the stencil? Don't know how well that would work. Lastly, you could make a model that is literally just one plane (not airplane) in blender which has that prop blur texture and make it slowly spin in reverse. That seems like the best choice. I can work the blender if you don't know how.
[QUOTE=bobbleheadbob;47112571]For motion blur couldn't you draw the object in 14 rotations with reduced alpha? (probably look weird) Alternatively, could you draw the model in all possible rotations to make an oblong circle in the stencil buffer, then apply the motion blur screenspace effect, but only within the stencil? Don't know how well that would work. Lastly, you could make a model that is literally just one plane (not airplane) in blender which has that prop blur texture and make it slowly spin in reverse. That seems like the best choice. I can work the blender if you don't know how.[/QUOTE] The problem is that we currently have like 40 different planes (and another 40 or so in the pipeline) so making new propellers for each and everyone is too much work and I don't wanna give my poor modeller even more work to do, he's already putting hours into assembling the planes from lose parts. But yeah I was thinking of re-rendering with lower alpha but last time i did that it didn't look too great. I haven't worked anything with stencil buffers so that would be a whole new area for me to explore.
[QUOTE=Hoffa1337;47112632]The problem is that we currently have like 40 different planes (and another 40 or so in the pipeline) so making new propellers for each and everyone is too much work and I don't wanna give my poor modeller even more work to do, he's already putting hours into assembling the planes from lose parts. But yeah I was thinking of re-rendering with lower alpha but last time i did that it didn't look too great. I haven't worked anything with stencil buffers so that would be a whole new area for me to explore.[/QUOTE] If the propellers already rotate, just not blur, then I wouldn't think it would be too difficult to add a material/bodygroup that you could toggle when the propeller reached a certain speed. Like Robotboy said about the airboat, it is also what the manhacks do for their propellers. You might even be able to use the new, fancy SetSubMaterial thing if recompiling models are the issue.
Is there an easy way of getting the vectors of an area for use in a ents.findinbox?
[QUOTE=AlexRainbows;47112763]Is there an easy way of getting the vectors of an area for use in a ents.findinbox?[/QUOTE] Is that not already what you pass to the function? If you're talking about checking if a vector is within that box then [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Vector/WithinAABox]Vector:WithinAABox[/url] might help you.
[QUOTE=mistopportuni;47111680]I have another question <_< I'm making a swep for a gamemode and everyone has the same weapon, it switches between burst, semi auto, and full auto. Each mode has it's own stats but my problem is when anyone changes the fire mode the damage stats that are changed affect everyone. So my question is, how can I make a variable be specific for each individual person without using separate lua files for the weapon? Here is the paste pin [url]http://pastebin.com/2p3weh9y[/url][/QUOTE] Anytime I want per player variable I just stick it on the player's table. so like [code] -- in SWEP:Initialize if !(self.Owner == nil) then self.Owner.fireMode =1 self.Owner.fireDamage =12 self.Owner.fireDelay =0.12 end -- Then just use it the same way -- in some function, like secondary fire... self.Owner.fireMode = 2 --or whatever [/code] this is just the basic idea/concept. You'll need to find where in the swep initializing the variables works best/ Owner isn't nill. Also to note, these variables will stay with the player till the player leaves the game, so it'll remember the settings, you may want to reset these regularly. Hope this helps.
[QUOTE=Revenge282;47112786]Is that not already what you pass to the function? If you're talking about checking if a vector is within that box then [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Vector/WithinAABox]Vector:WithinAABox[/url] might help you.[/QUOTE] Well I'm making it so that a command will only work in a certain area of the map, and I need to get the vectors for it so I can check if they're inside the given box. But how do I actually find out the vectors?
[QUOTE=Revenge282;47112759]If the propellers already rotate, just not blur, then I wouldn't think it would be too difficult to add a material/bodygroup that you could toggle when the propeller reached a certain speed. Like Robotboy said about the airboat, it is also what the manhacks do for their propellers. You might even be able to use the new, fancy SetSubMaterial thing if recompiling models are the issue.[/QUOTE] No it's not hard to change material or add new bodygroups, but with 40 planes already existing with physical 3d model propellers, and another 40 planes in the pipeline yet to be made, adding bodygroups to 80 planes is alot of work which is would much prefer to solve with code. I'm thinking that redrawing the propeller model enough times to make it cover 360* with shifting alpha is our best bet right now.
[QUOTE=AlexRainbows;47112815]Well I'm making it so that a command will only work in a certain area of the map, and I need to get the vectors for it so I can check if they're inside the given box. But how do I actually find out the vectors?[/QUOTE] What vectors are you trying to find out? All you have to do is: [lua]local ply = player.GetByID(1) local theirpos = ply:GetPos() local mins = Vector(0,0,0) local maxs = Vector(10,10,10) if theirpos:WithinAABox(mins,maxs) then //they are in box else //they arent in box end [/lua]
[QUOTE=Hoffa1337;47112818]No it's not hard to change material or add new bodygroups, but with 40 planes already existing with physical 3d model propellers, and another 40 planes in the pipeline yet to be made, adding bodygroups to 80 planes is alot of work which is would much prefer to solve with code. I'm thinking that redrawing the propeller model enough times to make it cover 360* with shifting alpha is our best bet right now.[/QUOTE] Is the propeller a separate entity or is it compiled into each plane model?
[QUOTE=bobbleheadbob;47112866]Is the propeller a separate entity or is it compiled into each plane model?[/QUOTE] Separate entity. They all use the same base entity with only the model and health differing between planes.
[QUOTE=Hoffa1337;47112890]Separate entity. They all use the same base entity with only the model and health differing between planes.[/QUOTE] I'm making you a propblur.mdl to change the propellers to once they reach max speed.
[QUOTE=Revenge282;47112848]What vectors are you trying to find out? All you have to do is: [lua]local ply = player.GetByID(1) local theirpos = ply:GetPos() local mins = Vector(0,0,0) local maxs = Vector(10,10,10) if theirpos:WithinAABox(mins,maxs) then //they are in box else //they arent in box end [/lua][/QUOTE] Pardon me if I'm missing the obvious here. But say I want a command to only work if you're in the spawning area of gm_construct, which part of this actually determines what is the spawn area and what isn't? This is for server-side use.
[QUOTE=AlexRainbows;47112930]Pardon me if I'm missing the obvious here. But say I want a command to only work if you're in the spawning area of gm_construct, which part of this actually determines what is the spawn area and what isn't? This is for server-side use.[/QUOTE] Just make a quick script that prints you position in the console every time you say something in chat. Go to each corner, make it print your position, write it down somewhere, and there you go!
You can print position in console with the console command "getpos"
This is going to seem like a giant rookie error, but I've resorted to using resource.AddFile to add my .png files because workshop apparently doesn't like to use them - (Dear Garry / everybody, please let us add .pngs to workshop) I'm addfile'ing my .png - it says it's downloading it when I join but when I get in-game it's still pink and black.
[QUOTE=Minteh Fresh;47113110]This is going to seem like a giant rookie error, but I've resorted to using resource.AddFile to add my .png files because workshop apparently doesn't like to use them - (Dear Garry / everybody, please let us add .pngs to workshop) I'm addfile'ing my .png - it says it's downloading it when I join but when I get in-game it's still pink and black.[/QUOTE] You can add png files to the workshop, silly. I don't know what you're doing wrong. Also, your error is most likely in your usage of your file within your code. How do you reference it? @Hoffa: [video=youtube;90BcLOXBDu4]http://www.youtube.com/watch?v=90BcLOXBDu4[/video] [url]https://dl.dropboxusercontent.com/u/104427432/Lua%20Clients/Propeller%20Blur.zip[/url] You can change the material as you choose. It's kinda ugly as of now but there you go. One blurred-propeller model.
You guys... I really don't mean to be rude, but I don't quite understand why no one is replying to my thread [url]http://facepunch.com/showthread.php?t=1450299[/url] I'm asking some pretty basic (though difficult to figure out on my own) questions there.
What's the best way to get a player's FPS? I've played around with FrameTime and RealFrameTime, but they seem really sporadic and I can't read it for shit. I want something like net_graph has. It just seems that net_graph does it the best way and it's readable in terms of how fast it refreshes or something, I don't know.
-snip-
[QUOTE=TheLuaNoob;47114197]What's the best way to get a player's FPS? I've played around with FrameTime and RealFrameTime, but they seem really sporadic and I can't read it for shit. I want something like net_graph has. It just seems that net_graph does it the best way and it's readable in terms of how fast it refreshes or something, I don't know.[/QUOTE] 1/RealFrameTime() is your fps based on just the last two frames, to smooth it out you can either only check every couple frames or you can store the last couple values and average them
Sorry, you need to Log In to post a reply to this thread.