[Release] DinoWeather | Dynamic Weather For ALL AREAS of the Map! | Smooth Transitions!

Version 1.0.2 Released

I have added command support to allow administrators to set the weather in the current zone they are in. See the original post for details!

Very happy to see extended use of this resource, baffles me that its been 8 months and its still going strong with new users.

If you have any suggestions, please post them here.

3 Likes

Does this have to use specific ā€œzonesā€ that are part of base GTA, or is it possible to add new ā€œcustomā€ zones. Like if a small area within a larger area should always be foggy, is there a way it can be customized?

I have not added this functionality, however if you or someone you know would like to add it, go ahead and be my guest. It should be fairly easy given the layout of the code.

The resource uses natives in the game as you can see in the sh_config.lua there are several zones that make up the larger areas of the map. Get the zone you are in and make a new array with just the foggy weather option to accomplish this goal.

any solution?
image

This is really cool and I like it a lot! My only gripe is the hard cut weather changes. Theyā€™re rather jarring but if I read up correctly, I believe they weather over time natives are bugged? Any ETA on that being fixed or do we just have to wait?

1 Like

Call me stupid butā€¦ Where do I set user permissions to be able to use it?

1 Like

I am also wondering on how I set user permssionsā€¦

Started having an issue with this resource where it sets the weather on server start, then 5-10 seconds after joining, the weather becomes rainy and never stops. Has anyone else experienced this?

Yes. Iā€™ve even went so far as to removing anything rain related, ie thunderstorm, rain, snow etc. and it still rains! I just updated to the latest resource and at least you can set the zoneā€™s weather now. But still, the rain is overwhelming.

Alright I redid the randomizeSystems function and this works well for reducing rain occurances.

So in sh_config.lua youā€™ll want to replace the whole function randomizeSystems() with:

function randomizeSystems()
  for i, weatherSystem in ipairs(WeatherConfig.weatherSystems) do
    local currentSeason = getCurrentSeason()
    local availableWeathers = weatherSystem[currentSeason + 1]
    local pickedWeather = availableWeathers[math.random(1, #availableWeathers)]
    for _, weatherZone in ipairs(weatherSystem[1]) do
      if os.date("*t").month == 12 and isSnowDay() and WeatherConfig.snowEnabled then
        table.insert(activeWeatherSystems, {weatherZone, "XMAS"})
      elseif pickedWeather == "THUNDER" or pickedWeather == "CLEARING" then
        table.insert(activeWeatherSystems, {weatherZone, "EXTRASUNNY"})
	  elseif pickedWeather == "RAIN" then
		local chanceofrain = math.random(1,10)
		if chanceofrain == 5 then
			table.insert(activeWeatherSystems, {weatherZone, "RAIN"})
		else
			table.insert(activeWeatherSystems, {weatherZone, "CLEAR"})
		end
	  else
		table.insert(activeWeatherSystems, {weatherZone, pickedWeather})
      end
    end
  end
end
2 Likes

@Slavko For me the ressource is ā€œkindaā€ working. I am able to set the weather (in zones) while Iā€™m ingame. But my script seems not to be working, it doesnā€™t set up different weather zones like in my config.

WeatherConfig = {}
WeatherConfig = setmetatable(WeatherConfig, {})

activeWeatherSystems = {}

WeatherConfig.snowEnabled = true -- Set to false if you do not want snow enabled.
WeatherConfig.decemberSnowDays = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 } -- Days that snow will appear during the month of December.

WeatherConfig.weatherTypes = {
  "CLEAR",
  "EXTRASUNNY",
  "CLOUDS",
  "OVERCAST",
  "RAIN",
  "CLEARING",
  "THUNDER",
  "SMOG",
  "FOGGY",
  "XMAS",
  "SNOWLIGHT",
  "BLIZZARD"
}

WeatherConfig.randomizeTime = 1800000 -- 1 Hour (TIME TO RANDOMIZE WEATHER SYSTEMS IN MILLISECONDS)

WeatherConfig.weatherSystems = {
  {
    { "TERMINA", "ELYSIAN", "AIRP", "BANNING", "DELSOL", "RANCHO", "STRAW", "CYPRE", "SANAND" },
    { WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
  }, -- South LS
  {
    { "MURRI", "LMESA", "SKID", "LEGSQU", "TEXTI", "PBOX", "KOREAT" },
    { WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
  }, -- Central LS
  {
    { "MIRR", "EAST_V", "DTVINE", "ALTA", "HAWICK", "BURTON", "ROCKF", "MOVIE", "DELPE", "MORN", "RICHM", "GOLF", "WVINE", "DTVINE", "HORS", "LACT", "LDAM" },
    { WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
  }, -- North LS
  {
    { "BEACH", "VESP", "VCANA", "DELBE", "PBLUFF" },
    { WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
  }, -- LS Beaches
  {
    { "EBURO", "PALHIGH", "NOOSE", "TATAMO" },
    { WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
  }, -- Eastern Valley
  {
    { "BANHAMC", "BANHAMCA", "CHU", "TONGVAH" },
    { WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
  }, -- Coastal Beaches
  {
    { "CHIL", "GREATC", "RGLEN", "TONGVAV" },
    { WeatherConfig.weatherTypes[9], WeatherConfig.weatherTypes[10] }
  }, -- North LS Hills
  {
    { "PALMPOW", "WINDF", "RTRACK", "JAIL", "HARMO", "DESRT", "SANDY", "ZQ_UAR", "HUMLAB", "SANCHIA", "GRAPES", "ALAMO", "SLAB", "CALAFAB" },
    { WeatherConfig.weatherTypes[6], WeatherConfig.weatherTypes[7] } -- Summer
  }, -- Grand Senora Desert
  {
    { "MTGORDO", "ELGORL", "BRADP", "BRADT", "MTCHIL", "GALFISH" },
    { WeatherConfig.weatherTypes[1], WeatherConfig.weatherTypes[12] }
  }, -- Northern Moutains
  {
    { "LAGO", "ARMYB", "NCHU", "CANNY", "MTJOSE", "CCREAK" },
    { WeatherConfig.weatherTypes[2], WeatherConfig.weatherTypes[3] }
  }, -- Zancudo
  {
    { "CMSW", "PALCOV", "OCEANA", "PALFOR", "PALETO", "PROCOB" },
    { WeatherConfig.weatherTypes[1], WeatherConfig.weatherTypes[12] }
  }, -- Palteo
}

WeatherConfig.timesOfYear = {
  { 3, 4, 5 }, --SPRING 1
  { 6, 7, 8 }, --SUMMER 2
  { 9, 10, 11 }, --FALL 3
  { 12, 1, 2 } --WINTER 4
}

function getCurrentSeason()
  for i, timeOfYear in ipairs(WeatherConfig.timesOfYear) do
    for k, month in ipairs(WeatherConfig.timesOfYear[i]) do
      if month == os.date("*t").month then
        return i
      end
    end
  end
end

function isSnowDay()
  for i, decemberSnowDay in ipairs(WeatherConfig.decemberSnowDays) do
    if decemberSnowDay == os.date("*t").day then
      return true
    end
  end
  return false
end

function findZoneBySubZone(zoneName)
  for i, weatherSystem in ipairs(WeatherConfig.weatherSystems) do
    for _, weatherZone in ipairs(weatherSystem[1]) do
      if weatherZone == zoneName then
        return i
      end
    end
  end
end

function randomizeSystems()
  activeWeatherSystems = {}
  for i, weatherSystem in ipairs(WeatherConfig.weatherSystems) do
    local currentSeason = getCurrentSeason()
    local availableWeathers = weatherSystem[currentSeason + 1]
    local pickedWeather = availableWeathers[math.random(1, #availableWeathers)]
    for _, weatherZone in ipairs(weatherSystem[1]) do
      if os.date("*t").month == 12 and isSnowDay() and WeatherConfig.snowEnabled then
        table.insert(activeWeatherSystems, {weatherZone, "XMAS"})
      else
        table.insert(activeWeatherSystems, {weatherZone, pickedWeather})
      end
    end
  end
end

Anything wrong on my end?

Edit: I got this error in my console:

SCRIPT ERROR: @DinoWeather/sh_config.lua:141: attempt to get length of a nil value (local 'availableWeathers')e[0m
e[93m> fne[0m (e[36m@DinoWeather/sv_dinoweather.luae[0m:31)

Where do I set user permissions to be able to use it?

I seem to be having some issues and Iā€™m not sure why.

vSync is disabled and vMenu weather is turned off, though the weather still seems to flicker and the regions donā€™t seem to have differentiating weather. Any recommendations?

it does not work with vMenu
to add the commando do
add_ace group.name?? dinoweather.cmds allow also when I do the command to set it to clear /setzoneweather CLEAR it wonā€™t change anything.
another thing is when I restart the server itā€™s always snowingā€¦
wish in a near future we have better weather transitions.
would be cool to add a time to it as well with the month to display.
good job. :ok_hand:

this has been a great addition to my server, been looking for something like this for awhile to pair up with my real time mod. Much thanks <3

This is soooo cool.
I also believe DoJRP is using this, Not entirely sure.

will there be any updates for this script it looks awesome and i have been wanting to try it

Iā€™m not sure either

Weā€™ve had this in for about a week and have yet to see any rain. Is there a way to slightly increase the chance of it happening?

How do I change weather in the zones? Please someone respond with a dumb down response for me. I know where to find it I just donā€™t understand how to change the weather