• My Fancy client-side snow script
    47 replies, posted
Uh util.Trace, check like 1000 up and see if its hitting anything o.O
Any idea why it kills my FPS? My computer is by no means bad, it runs GMod at a decent FPS on high settings.
[QUOTE=noobcake;33770484]Any idea why it kills my FPS? My computer is by no means bad, it runs GMod at a decent FPS on high settings.[/QUOTE] Try snow_skyboxswap For some reason, I dislike the skybox, if only there was a serverside CVar to disable that aspect, aswell as the sound. Not to mention SOME of my player complain about FPSrape with it, i think it's the skybox.
Great Addon. One question, could the same be done to imitate rain? Obviously you'd have to change the code and whatnot, but I was just wondering since there used to be "Weather Mod", which would simulate a bunch of different weather effects, and this seems more promising than it ever did.
Yeah, that weathermod was kind of a piece of ass, but this looks really good. [editline]17th December 2011[/editline] [QUOTE=Phoenixf129;33771233]Try snow_skyboxswap For some reason, I dislike the skybox, if only there was a serverside CVar to disable that aspect, aswell as the sound. Not to mention SOME of my player complain about FPSrape with it, i think it's the skybox.[/QUOTE] It's not the skybox, it's the snow that does it.
The snow rendering is what makes this lag, like noobcake said. just confirming.
[QUOTE=sabreman;33770066]Nope. What if your in a tall prop house? Don't worry though, I got this.[/QUOTE] Do like what Ruzza said and check a ridiculous distance (I think using 4096 * 4 and the checking distance is the max you can do) and if you hit the sky or hit nothing then spawn snow. You can even make it so if the trace hits an entity run another trace so if the entity is something small you can still spawn the snow above it. Here is something I threw together so show what I mean: [lua] local tracedata = {} tracedata.start = Player:GetPos() tracedata.endpos = Player:GetPos()+(Player:GetUp() * 4096 * 4) tracedata.filter = Player trace = util.TraceLine(tracedata) if trace.HitSky then //you hit the sky so spawn snow elseif !trace.Hit then //you didn't hit anything so its safe to spawn snow elseif trace.Entity and !trace.Entity:IsWorld() then //you hit a entity thats not the world so do another trace up to check for stuff above local tracedata2 = {} tracedata2.start = trace.Entity:GetPos() tracedata2.endpos = trace.Entity:GetPos()+(Player:GetUp() * 256) tracedata2.filter = trace.Entity trace2 = util.TraceLine(tracedata2) if trace2.HitSky then //you hit the sky so spawn snow elseif !trace2.Hit then //you didn't hit anything so its safe to spawn snow end end [/lua] Its untested but it should do all what I just explained.
Instead of repeating the code twice, you should do [lua]if trace2.HitSky or !trace2.Hit then[/lua]
[QUOTE=Phoenixf129;33737996][url]http://www.facepunch.com/threads/1146969?p=33716087#post33716087[/url] It's possible to move the sun, at least.[/QUOTE] Wow. Using Entity:Fire() and using the "FadeToPattern" control on the light_environment is genius. I'm going to have to see if that works. Of course, it'll only work on specific maps, where the light_environment is named (because otherwise Hammer will bake the light entity into the map, meaning you can't affect it at all in-game). That'd work beautifully with a gamemode idea I've had (though I have a project I am currently working on I need to finish first).
[QUOTE=Gmod4ever;33777471]Wow. Using Entity:Fire() and using the "FadeToPattern" control on the light_environment is genius. I'm going to have to see if that works. Of course, it'll only work on specific maps, where the light_environment is named (because otherwise Hammer will bake the light entity into the map, meaning you can't affect it at all in-game). That'd work beautifully with a gamemode idea I've had (though I have a project I am currently working on I need to finish first).[/QUOTE] It comes on rp_evocity_v33x [url]http://www.facepunch.com/threads/1079279[/url] I don't know if it will work on ALL maps.
for some reason I'm getting script errors on line 57 [code]local VelTrace = util.QuickTrace(part:GetPos(),[/code] Also dropbox link is dead and had to use gmod link
Thats because this thing is 2 years old.
[QUOTE=Robotboy655;42996494]Thats because this thing is 2 years old.[/QUOTE] But I want this! lol
[QUOTE=Judd;42996516]But I want this! lol[/QUOTE] And I want 100000€, we can help each other.
[QUOTE=Robotboy655;42996559]And I want 100000€, we can help each other.[/QUOTE] You always have the most helpful replies.
[QUOTE=Judd;42996571]You always have the most helpful replies.[/QUOTE] Thanks, finally at least someone acknowledges my hard work. :v:
Wow I remember this didn't even realize it was a public release
You're a boss! This is a good christmas script.
Sorry, you need to Log In to post a reply to this thread.