Author Topic: Another Weather Question  (Read 1259 times)

Legacy_Gawain_VIII

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Another Weather Question
« on: May 12, 2016, 04:29:12 am »


               

I'm playing around with weather, setting up "Template" areas from which all the playable outdoor areas get their weather from (One each for Arid, Temperate, Artic, Forest, and Swamp)...


 


Ideally, Arid is always dry; Temperate has 50% chance of rain and 12.5% chance of thunderstorms (meaning 25% of all rains will be storms); Artic will have 50% chance of snow (no thunderstorms); Forest will have 100% chance of rain (no storms) at night, with dry days; and Swamp which is always raining but never storming. In all cases, the wind is variable unless it's storming, when wind should always be high.


 


The toolset has options for Wind, % Rain, % Snow, and % Lightning. The GetWeather() and SetWeather() functions can adjust from *_CLEAR, *_RAIN, and *_SNOW; I can change the SkyBoxes to correspond to the weather. All of that should be easy enough to manipulate, but...


 


How would I get or set the Lightning and wind settings?


 


Is the % for Lightning independent from, or a sub-set of, the Rain %? Can it be lightning when it's not raining? If I want it to rain half the time, and storm half of the time that it is raining, should I set this to 50% or 25%If I set this to 25%?



               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Another Weather Question
« Reply #1 on: May 12, 2016, 02:55:12 pm »


               

You don't for wind and lightning. They are static settings that remain as defined under the Area Properties for each individual area.


Lightning at 100% will not flash without rain.


Lightning at 25% will only flash when it rains AND if it falls within the percentage (25%) set for that area.


An area that has its weather changed from CLEAR to RAIN via scripting, should always have the percentage for RAIN and SNOW, set to 0 under Area Properties. The weather system you implement will define these values instead. When lightning has a percentage, it would fire within that percentage when it is indeed raining.


The problem is although lightning fires in one area to simulate a thunderstorm, even if it is raining in an adjacent area, lightning may not fire if it does not fall within the predefined percentage (25%) in this example.


Hope that helps.



FP!



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Another Weather Question
« Reply #2 on: May 12, 2016, 03:58:56 pm »


               

Lightning and Wind Gusts - I believe are worked out and calculated client side: Probably explaining why we have less control of them from scripting.


When the player enters the area - the area gff is sent to the client. (either that or when the player enters the module - not sure which)


In any case- the game client reads those fields and then renders the wind effects and does the lightning flash effects for you.


If you could change the values server side, the server would have to re-send the area gff down to the client.


 


That's why when in a multiplayer game, one player might see a lightning flash, but another play may not.


 


The area on the server side probably says when we are inside the Rain phase and the 25% phase - but the client will actually decide when to display the lightning.


 


I don't think the server sends a message to trigger lightning flashes - if it did, nwnx would suddenly have a new plugin called nwnx_lightning - allowing you to call a 


'Flash()' function that triggers lightning flashes on clients. I know that it would be awesome for cinematic effects.