Difference between revisions of "SetWeather"

From NWN Lexicon
Jump to: navigation, search
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
+
{{DISPLAYTITLE:SetWeather(object, int)}}__NOTOC__{{NWNEE}}
 
 
 
 
 
 
=SetWeather(object, int)=
 
 
 
 
Allows you to set the weather for an area or the entire module.
 
Allows you to set the weather for an area or the entire module.
 
 
<nwscript>
 
<nwscript>
[[void | void ]] SetWeather(
+
void SetWeather(
    [[object | object ]] oTarget,
+
    object oTarget,
    [[int | int ]] nWeather
+
    int nWeather
);
+
);
 
</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.
 +
;nWeather
 +
:[[ weather (constant) | WEATHER_* ]] (or a line from weathertypes.2da)
  
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''
+
====Description====
  
[[ weather | WEATHER_* ]]
+
Set the weather for oTarget.
  
<br />
+
* 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).
  
====Description====
 
  
Set the weather for oTarget. <br /> - WEATHER_USE_AREA_SETTINGS will set the area back to whatever weather the area had set in the toolset. <br /> - WEATHER_CLEAR, WEATHER_RAIN, WEATHER_SNOW will make the weather go to the appropriate precipitation *without stopping*.
+
====Remarks====
 
 
<br /><br />
 
  
====Remarks====
+
In NWN:EE custom weathers can be supported by using weathertypes.2da. These can be mean new visual effects and lightning effects.
  
As of patch 1.31, BioWare has provided us with a GetWeather function, making it a lot easier to manipulate weather. Module builders not using patch 1.31 (or newer) will have to keep track of weather in areas manually.
+
''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.
  
<br />
 
  
 
====Known Bugs====
 
====Known Bugs====
Line 42: Line 34:
 
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.
  
<br />
 
  
 
====Version====
 
====Version====
  
1.61
+
1.31 - [[GetWeather]] added.
 +
 
 +
{{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====
  
 
<nwscript>
 
<nwscript>
// script to make it snow (module wide)  
+
// script to make it snow (module wide)  
void main()
+
void main()
{
+
{
    object oModule = GetModule();
+
    object oModule = GetModule();
    SetWeather(oModule, WEATHER_SNOW);
+
    SetWeather(oModule, WEATHER_SNOW);
}
+
}
 
</nwscript>
 
</nwscript>
 +
  
 
====See Also====
 
====See Also====
Line 64: 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]]
 
|-
 
|-
 
|-
 
|-
 
| width="1px" align="right" valign="top" | <font color="gray">constants: </font>
 
| width="1px" align="right" valign="top" | <font color="gray">constants: </font>
 
|
 
|
[[ weather | WEATHER_* Constants  ]]
+
[[ weather (constant) | WEATHER_* Constants  ]]
 
|}
 
|}
  

Latest revision as of 15: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