|
| 27 Nov 2012 06:11 PM |
This script colors, sets fog start and fog end, a gui tint, and brightness relative to day of time, which changes constantly. It works fine, but any other ideas on the weather part? Just sunny, foggy, or cloudy? How could I do rain (No guis).
repeat wait() until _G.DAY_AND_NIGHT ~= nil
light = game:service("Lighting") respawnTime = 12 local MinutesInDay = 60 * 24 --1440 local light = game.Lighting wbright,wfoge,wfogs,wtint = 1,1,1,1
function chooseWeather() local w_n = math.random(1,10) if w_n == 1 or w_n == 2 then print("Sunny Day") bright = 1.5 foge = 1 fogs = 1 tint = 1 elseif w_n == 3 then print("Foggy day") bright = 0.7 foge = 1.5 fogs = 2 tint = 1 else print("Cloudy day") bright = 0.7 foge = 1 fogs = 1 tint = 0.8 end return bright,foge,fogs,tint end
while _G.DAY_AND_NIGHT and wait(_G.DAY_AND_NIGHT_SPEED) do if game.Lighting.TimeOfDay == "00:00:00" then wbright,wfoge,wfogs,wtint = chooseWeather() end if not booted then print("Day and night loop running") booted = true end local t = light:GetMinutesAfterMidnight() local color = -.5*math.cos(2 * math.pi * (t / MinutesInDay)) + .5 light.FogStart = 100 * color / wfogs light.FogEnd = 700 * color + 300 / wfoge light.FogColor = Color3.new(color, color, color) light.Brightness = light.FogEnd / 1000 * wbright local players = game.Players:children() for i = 1, #players do players[i].PlayerGui.Scripts.Darkness.BackgroundTransparency = light.FogEnd / 1000 + 0.15 / wtint end light:SetMinutesAfterMidnight(light:GetMinutesAfterMidnight()+1) end |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 27 Nov 2012 06:34 PM |
Rain is a pain.
If you want the rain effect itself and if GUIs are out of the question, falling bricks would be the best way to do it, sadly enough.
A simple drizzle may be possible, but for a bad storm falling bricks could be unacceptably laggy. The correct move is therefore to cheat, and try to get the best effect possible with as few bricks as possible. What you might be able to do to save some moving bricks is simulate the other effects of a severe thunderstorm (extremely dense fog, occasional thunder, sound of rain falling) and then have like 1 or 2 bricks per second spawned in front of the player's field of view in the fog (to give the impression that the rain is difficult to see so the player writes off not seeing a lot of it). |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
| |
|
|
| 27 Nov 2012 07:32 PM |
GUIs are best for rain. Bricks that fall down would be VERY laggy and I recommend you don't do it. |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 07:34 PM |
| billboard guis for rain cus i do it da complex hard way |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 27 Nov 2012 07:38 PM |
| billboard guis = even more rain lol |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 07:40 PM |
| lolno i hat dem gnomfe wif dem ugly faic. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 27 Nov 2012 08:56 PM |
@Jarod
Kind of, sort of. Simple GUIs look atrocious if the player, for instance, looks down (THE RAIN IS FALLING SIDEWAYS, AHHH). Billboard GUIs look better, but it's tricky to get them as good as bricks.
A few (on the order of 10/20 total in the place), carefully placed bricks shouldn't lag more than any other moving part.
Roblox needs to give us real particle effects. :/ |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2012 09:19 AM |
| I think it could be possible to make the gui rain "particles" go in the direction relative to the localplayers camera CFrame, I would now know how to do this though |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Nov 2012 03:36 PM |
wiki.roblox.com has your answers.
- thedestroyer115 |
|
|
| Report Abuse |
|
|