What is Simple/Colloquial Weather?
Simple Weather is a concluded module to simulate the environment a player sees within the game. here are some features and things to know!
-
Many Behavior Options to choose from, such as Ambiance and Cloud Settings
-
Transitions between Weather Types, which include: Sound, Lighting and Sky, and Wind
-
Easy to Modify and Add Changes, please recommend these to me.
-
Runs on the Client, to sync between players continue reading…
Small Showcase (OLD)
If you’d like to try it out with a place I made here it is!
Example.rbxl (136.5 KB)
How do I use it?
- Download the Module, requiring the ID does not work.
- Open a Local-Script, and Initialize.
local SimpleWeather = require(game.ReplicatedStorage.SimpleWeather) SimpleWeather.Init() -- loads the module, you can put a weather type to start with, inside '()' task.delay(5, function() SimpleWeather.ChangeWeather("Rain") end) SimpleWeather.WeatherChanged:Connect(function(NewWeather) print('The Current Weather is now : '..NewWeather) end)
How to Sync Simple/Colloquial Weather across Clients
This is quite a simple way to sync data between clients, this is generally better as it makes the tweens much smoother, since everything is calculated and processed in the client.
Create Two Events
Create A Local-Script and a (Server-)Script
Communicator : (Server-)Script
--// Services : https://devforum.roblox.com/t/simple-weather-14/3028058
local replicatedStorage = game:GetService("ReplicatedStorage")
--// Modules
local modules = replicatedStorage.Modules
local SimpleWeather = require(modules.SimpleWeather)
--// Shared
local shared_ = replicatedStorage.Shared
local GetWeatherFunction = shared_.GetWeather
local ChangeWeatherEvent = shared_.ChangeWeather
--// Constants
local MIN_CHANGE_TIME = 5
local MAX_CHANGE_TIME = 10
--// Values
local currentWeather = SimpleWeather.GetRandomWeather()
SimpleWeather.CurrentWeather = currentWeather
--// Functions
function ChangeWeather(name)
if name and SimpleWeather.WeatherTypes[name] then
currentWeather = name
else
currentWeather = SimpleWeather.GetRandomWeather()
end
SimpleWeather.CurrentWeather = currentWeather
ChangeWeatherEvent:FireAllClients(currentWeather, tick()) -- Fire to all clients
end
--// Connection
GetWeatherFunction.OnServerInvoke = function()
return SimpleWeather.CurrentWeather
end
while task.wait(Random.new():NextInteger(MIN_CHANGE_TIME,MAX_CHANGE_TIME)) do
ChangeWeather(nil)
end
WeatherHandler : Local-Script
--// Services : https://devforum.roblox.com/t/simple-weather-14/3028058
local replicatedStorage = game:GetService("ReplicatedStorage")
--// Modules
local modules = replicatedStorage.Modules
local SimpleWeather = require(modules.SimpleWeather)
--// Shared
local shared_ = replicatedStorage.Shared
local GetWeatherFunction = shared_.GetWeather
local ChangeWeatherEvent = shared_.ChangeWeather
--// Values
local weatherChangeConnection:RBXScriptConnection
--// Functions
-- Prepares and Syncs the Weather
function Setup()
local currentWeather = GetWeatherFunction:InvokeServer() -- ask from the server what the weather is like currently
SimpleWeather.Init(currentWeather) -- catch up to current weather
weatherChangeConnection = SimpleWeather.WeatherChanged:Connect(function(currentWeather)
print("Change to",currentWeather)
end)
end
function ChangeWeather(name, requested:number)
local instant = tick() - requested >= 5
SimpleWeather.ChangeWeather(name,instant)
if instant then
warn("The client is experiencing latency, quickly changing.")
end
end
--// Connection
spawn(Setup)
ChangeWeatherEvent.OnClientEvent:Connect(ChangeWeather)
How can I add more Types of Weather?
- Open the Module, and scroll down to here:
Information is given in this image…
Other Similar Sources
In no particular order:
- Dynamic Weather | anon53193547 (BEST)
- Data Aspect’s Weather System
- TwentyTwoPilots’s Weather System (OLD)
Please note the the leaves moving is using another module called WindShake | boatbomber, I highly recommend this module too!
UPDATES
-
Version 1.0 - 1.4 | BETA
- Bug Fixes
- New Features
- Slight tweaks & edits
- Smoother sound transitions
-
Version 2.6 | Full Release
- Code Revamp (1.0+)
- New Features (0.1+)
- Slight tweaks & edits (0.1+)
NOTICE
This Module will be receiving less updates, this is because of the loss of attraction toward this Module. I thank you all for using and finding interest toward Simple Weather.
~ KALARAN