Difference between revisions of "SetWeather"

From NWN Lexicon
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
);
 
);
 
</nwscript>
 
</nwscript>
 +
====Parameters====
  
====Parameters====
 
 
;oTarget
 
;oTarget
 
:If this is GetModule(), all outdoor areas will be modified by the weather constant. If it is an area, oTarget will play the weather only if it is an outdoor area.
 
:If this is GetModule(), all outdoor areas will be modified by the weather constant. If it is an area, oTarget will play the weather only if it is an outdoor area.
 
 
;nWeather
 
;nWeather
 
:[[ weather (constant) | WEATHER_* ]] (or a line from weathertypes.2da)
 
:[[ weather (constant) | WEATHER_* ]] (or a line from weathertypes.2da)
 +
  
 
====Description====
 
====Description====
Line 20: Line 20:
  
 
* WEATHER_USE_AREA_SETTINGS will set the area back to whatever weather the area had set in the toolset.
 
* WEATHER_USE_AREA_SETTINGS will set the area back to whatever weather the area had set in the toolset.
* WEATHER_CLEAR, WEATHER_RAIN, WEATHER_SNOW or another line from weathertypes.2da will make the weather go to the appropriate precipitation *without stopping*.
+
* WEATHER_CLEAR, WEATHER_RAIN, WEATHER_SNOW or another line from weathertypes.2da will make the weather go to the appropriate precipitation using the delay in weathertypes.2da (usually 6000, or 6 seconds).
 +
 
  
 
====Remarks====
 
====Remarks====
Line 27: Line 28:
  
 
''Note:'' There is still no way to set the chance of lighting. The area in question must have a lightning % chance set in the area properties. Of course new weather effects means you could put lightning into your usual weather fx, and have that deal with it.
 
''Note:'' There is still no way to set the chance of lighting. The area in question must have a lightning % chance set in the area properties. Of course new weather effects means you could put lightning into your usual weather fx, and have that deal with it.
 +
  
 
====Known Bugs====
 
====Known Bugs====
  
 
When changing the weather from WEATHER_RAIN to WEATHER_SNOW, the lightning weather effect continues to occur. Go from WEATHER_RAIN to WEATHER_CLEAR to WEATHER_SNOW to avoid this unnatural phenomenon.
 
When changing the weather from WEATHER_RAIN to WEATHER_SNOW, the lightning weather effect continues to occur. Go from WEATHER_RAIN to WEATHER_CLEAR to WEATHER_SNOW to avoid this unnatural phenomenon.
 +
  
 
====Version====
 
====Version====
Line 36: Line 39:
 
1.31 - [[GetWeather]] added.
 
1.31 - [[GetWeather]] added.
  
1.80.8193.14 - Added weathertypes.2da for custom weathers.
+
{{patchnwnee|patch=1.80.8193.14|link=https://steamcommunity.com/games/704450/announcements/detail/2724067792533337541|type=updated}} You can now define new weathers using weathertypes.2da.
 +
 
  
 
====Example====
 
====Example====
Line 48: Line 52:
 
}
 
}
 
</nwscript>
 
</nwscript>
 +
  
 
====See Also====
 
====See Also====
Line 54: Line 59:
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
|
 
|
[[  SetCalendar  | SetCalendar ]]
+
[[  SetCalendar  | SetCalendar ]] [[GetWeather]]
 
|-
 
|-
 
|-
 
|-

Latest revision as of 16:03, 14 March 2021

Nwnee logo.jpg Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

Allows you to set the weather for an area or the entire module.

void SetWeather(
    object oTarget,
    int nWeather
);

Parameters

oTarget
If this is GetModule(), all outdoor areas will be modified by the weather constant. If it is an area, oTarget will play the weather only if it is an outdoor area.
nWeather
WEATHER_* (or a line from weathertypes.2da)


Description

Set the weather for oTarget.

  • WEATHER_USE_AREA_SETTINGS will set the area back to whatever weather the area had set in the toolset.
  • WEATHER_CLEAR, WEATHER_RAIN, WEATHER_SNOW or another line from weathertypes.2da will make the weather go to the appropriate precipitation using the delay in weathertypes.2da (usually 6000, or 6 seconds).


Remarks

In NWN:EE custom weathers can be supported by using weathertypes.2da. These can be mean new visual effects and lightning effects.

Note: There is still no way to set the chance of lighting. The area in question must have a lightning % chance set in the area properties. Of course new weather effects means you could put lightning into your usual weather fx, and have that deal with it.


Known Bugs

When changing the weather from WEATHER_RAIN to WEATHER_SNOW, the lightning weather effect continues to occur. Go from WEATHER_RAIN to WEATHER_CLEAR to WEATHER_SNOW to avoid this unnatural phenomenon.


Version

1.31 - GetWeather added.

This function was updated in 1.80.8193.14 of NWN:EE. You can now define new weathers using weathertypes.2da.


Example

// script to make it snow (module wide) 
void main()
{
    object oModule = GetModule();
    SetWeather(oModule, WEATHER_SNOW);
}


See Also

functions: 

SetCalendar GetWeather

constants: 

WEATHER_* Constants



 author: Chaz Mead, editor: Jasperre, additional contributor(s): Sean Fuller, Lilac Soul, Jonathan Williams