Difference between revisions of "SetWeather"

From NWN Lexicon
Jump to: navigation, search
(Created page with " =SetWeather(object, int)= Allows you to set the weather for an area or the entire module. void  SetWeather(      object  oTarget,...")
 
Line 7: Line 7:
 
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>
 
  [[void | void ]] SetWeather(
 
  [[void | void ]] SetWeather(
 
      [[object | object ]] oTarget,
 
      [[object | object ]] oTarget,
 
      [[int | int ]] nWeather
 
      [[int | int ]] nWeather
 
  );
 
  );
 +
</nwscript>
  
 
====Parameters====
 
====Parameters====
Line 48: Line 50:
 
====Example====
 
====Example====
  
<font color="#007f00">// script to make it snow (module wide)  
+
<nwscript>
  </font><font color="#0000ff">void</font> main()
+
// script to make it snow (module wide)  
 +
  void main()
 
  {
 
  {
     <font color="#0000ff">object</font> oModule = GetModule();
+
     object oModule = GetModule();
 
     SetWeather(oModule, WEATHER_SNOW);
 
     SetWeather(oModule, WEATHER_SNOW);
 
  }
 
  }
 +
</nwscript>
  
 
====See Also====
 
====See Also====

Revision as of 22:00, 25 August 2012



SetWeather(object, int)

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

 [[void | void ]] SetWeather(
     [[object | object ]] oTarget,
     [[int | 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_*


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 will make the weather go to the appropriate precipitation *without stopping*.



Remarks

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.


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.61

Example

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

See Also

functions: 

SetCalendar

constants: 

WEATHER_* Constants



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