Page 1 of 5

Weather

Posted: Fri Aug 03, 2012 11:17 am
by DeVeous
Weather Patch Details

v1
Weather updates occur half past every 3rd vana’diel hour
Weather is immediately sent to all players in the zone
Zone weather information stored in zone_weather.sql

v2
Weather is sent to any player(s) who enters the zone for the duration of the weather
lua script function 'player:getWeather()' added, weathers in a numerical value

v3
GM command @setweather added
BUG FIX - weather updates causing significant lag spikes

v4
Beaucedine_Glacier, Xarcabard and Castle_Zvahl_Baileys has a default weather of cloudy
Beaucedine_Glacier[S], Xarcabard[S] and Castle_Zvahl_Baileys[S] has a default weather of cloudy
All Cloisters have a constant extreme weather condition base on their element

v5
Weather changes will spawn\despawn the appropriate Elementals
Selbina shares weather with Valkurm Dunes
Mhaura shares weather with Buburimu Peninsula
Ranguemont Pass shares weather with Beaucedine Glacier

v6
Weather frequency is now more accurate thanks to PrBlahBlahtson
Data for zones with Static, Shared or Default weathers; move from core to zone_weather.sql
Weather updates have been spread out to last longer
Elementals will now respawn if their weather effect is still active
Weather updates now occurs immediately after server start

Re: Weather

Posted: Sat Aug 04, 2012 12:12 pm
by bluekirby0
I'm about to test this, but just from your description, it will be more efficient to return a numeric value for that function and provide aliases to the numbers. For example:

Code: Select all

WEATHER_CLEAR_SKIES = 0;
WEATHER_RAIN = 1;
etc... and have player:getWeather() return the number rather than a string. You can use the aliases to keep it readable.

Re: Weather

Posted: Sat Aug 04, 2012 12:52 pm
by DeVeous
Ok, I'm working on the updating the sql with all the corrent data by zone based on the wiki, then I'll change the lua to push back a numeric value. I was thinking about making a weather.lua in globals to add more functions like player:getWeatherType(), player:getWeatherElement, and player:getWeatherColor()

Not sure if that's too much or not.

Re: Weather

Posted: Sat Aug 04, 2012 1:05 pm
by bluekirby0
Ok I came across this:

Code: Select all

switch(m_zoneID){
	case 111:
	case 112:
		m_weather = WEATHER_SNOW;
	}
The default weather condition for Xarcabard is "Cloudy". I *think* that is also true for Beaucedine Glacier (but it has been a while since I played on retail). It is true that these zones have weather effects more often than not, but the defaults should not be set to a specific elemental weather.

Re: Weather

Posted: Sat Aug 04, 2012 1:11 pm
by bluekirby0
I should also mention that cloisters always have double weather effects, so it would be good to set that as a default here and set the frequency to max (or possibly even bypass the function to change it for those zones).

Re: Weather

Posted: Sat Aug 04, 2012 1:18 pm
by bluekirby0
Okay, some suggestions:

add a setWeather LUA binding so it can be used as a GM command for testing. If you want to see how to go ahead and make this into a GM command you can look at scripts/commands/changejob.lua for an example of how to pass it strings on the command and send numbers to the function.

The only function you absolutely need is getWeather that will return a numerical value for a weather effect. The other functions you mentioned don't sound particularly useful, but perhaps there is some context I am missing.

If you want to add some icing on the cake, you can add functions that calculate common mechanical elements relating to weather such as MAB bonus or penalties, damage bonus or penalties, etc... There are already comments all over the place that are ready to plug in such a function if it existed.

Re: Weather

Posted: Sat Aug 04, 2012 4:37 pm
by DeVeous
Edit : Removed out-dated patch

Re: Weather

Posted: Sat Aug 04, 2012 5:03 pm
by Ayame
this is awsome now we gonna have weather in the game :D

Re: Weather

Posted: Sun Aug 05, 2012 12:41 am
by PrBlahBlahtson
Ayame wrote:this is awsome now we gonna have weather in the game :D
New features? New bugs to find and fix! :D

But yeah, I've kind of missed weather.

Re: Weather

Posted: Sun Aug 05, 2012 9:31 am
by DeVeous
Edit : Removed out-dated patch