Author: tortuosit
Author Website:

Requirements: No addons required

Version: 1.3.3
Signed: No

Short description: This script or addon creates dynamic weather, is heavily configurable, has starting presets, weather trends and min/max values.

Date: 2014-11-07 20:10


Comments: (0)
Rating:



 



Dynamic weather

by
tortuosit


Description:
The script/addon creates dynamic and semi random weather based on a random seed, is heavily configurable, has starting presets, weather trends and min/max values.
Standard behaviour is that script lets weather cycle between min and max values. But you can also pin the weather at a specific level with the "constant" trend.
Random weather outbreaks can occur depending on your settings.

- Presets are respecting min/max values.
- Rain is controlled by ArmA.
- Generally, fog levels are more likely to be low.
- Semi-Randomness, it uses a random or user defined random seed (always logged to rpt): with the same seed number and arguments you will get the same weather progression.

Weather changes / trend changes are executed every 30 minutes with no brute force, i.e. no abrupt changes and no cpu spikes (except at startup). After all, especially cloud/overcast change is slow in ArmA.

Script is for SP usage, I'm planning to expand it to MP. The script is derived from a script of forum user Meatball.


Installation:
Please check your config files in Steam\SteamApps\common\Arma 3\userconfig\tort_DynamicWeather\, at best, overwrite them with the newly distributed ones.
Island weather definitions are in: userconfig\tort_DynamicWeather\tort_islands.sqf
To enable them, you need to set "islandTemplates = 1;" in tort_DynamicWeather_config.hpp

\Steam\SteamApps\common\Arma 3\userconfig\tort_DynamicWeather\tort_islands.sqf must be available for the mod to work!

Extract into the ArmA 3 Directory, by default this is located in:
32-Bit - C:\Program Files\Steam/Steamapps\Common\ArmA 3\
64-Bit - C:\Program Files (x86)\Steam/Steamapps\Common\ArmA 3\
After extraction it should look like this:
Steam\Steamapps\Common\ArmA 3\@your_mod_folder_name\addons\

You can also use the "Arma 3 Alpha" folder in your "My Documents" folder. Your folder setup could than look like for example this:
mydocuments\Arma3 Alpha\@your_mod_folder_name1\addons\
mydocuments\Arma3 Alpha\@your_mod_folder_name2\addons\
mydocuments\Arma3 Alpha\@your_mod_folder_name2\addons\

When present place the "userconfig" folder into your game install folder, usually:
"C:\Program Files (x86)\Steam\steamapps\common\Arma 3".
You may already have "userconfig" folder from other addons and/or mods in which case it is safe to merge the contents from this archive.

You'll also need to add a Launch Parameter to Steam, in order to do so right-click on ArmA 3 Alpha and click Properties and then Set Launch Options. In the window that opens enter in -mod=@your_mod_folder_name
For using multiple mods you would then do so like this:
-mod=@mod_name;@mod_name2;@mod_name3;@mod_name4;@mod_name5

Note:
You can also use -nosplash to get rid of the splash art and intro videos.


And of course you can also enable and disable community made addons and mods through the in-game Options Expansions menu if you do not want to mess with startup parameters!

When the above information still does not provide you with enough to learn how to install custom addons and mods you can always ask in our Guide On Installing Mods.


Included files:
tort_DynamicWeather.pbo


Usage:
Please check your config files in Steam\SteamApps\common\Arma 3\userconfig\tort_DynamicWeather\, at best, overwrite them with the newly distributed ones.
Island weather definitions are in: userconfig\tort_DynamicWeather\tort_islands.sqf
To enable them, you need to set "islandTemplates = 1;" in tort_DynamicWeather_config.hpp

\Steam\SteamApps\common\Arma 3\userconfig\tort_DynamicWeather\tort_islands.sqf must be available for the mod to work!

Addon usage:
a) Copy "@tort_DynamicWeather\" folder from inside the zip file into your Arma 3 directory.
b) Start @tort_DynamicWeather\CopyOrEditConfig.cmd in order to copy and/or edit the mods config file.

Script usage:
Step 1)
Put the file script\tort_DynamicWeather.sqf on top level of your mission folder
- OR -
call it directly from my addon folder, examples below.

Step 2)
Call script from editor, e.g. from initialisation of player unit
- OR -
call script from other scripts.
Examples of script calls below in examples section.

Example calls:
** Initial weather, Trend, ProbRndChange, Variance, MinMaxValues, Debugmode, Seed **

0 = ["random", "better"] execVM "\@tort_DynamicWeather\script\tort_DynamicWeather. sqf";
Weather initially random and will definitely become better.
This is the call when the script resides in the "Arma 3\scripts\" folder.

0 = [[0.5, 0.3, 0.1, 0.8], "constant"] execVM "\@tort_DynamicWeather\script\tort_DynamicWeather. sqf";
User defined values instead preset. 0.5 overcast, 0.3 fog, 0.1 wind and 0.8 rain.
Weather will stay constant.

0 = ["bad", "pBetter", [0.1, 0], [0, 0.2], 0, [0, 1, 0.4, 0.8, 0, 1]] execVM "\@tort_DynamicWeather\script\tort_DynamicWeather. sqf";
Bad starting weather, probability to tend towards better. 10% probability of a
completely random change. We have a constant fog level of 0.4-0.8.

0 = ["foggy", "constant", [0.2, 0], [0.05, 0.2], [0, 1, 0.4, 0.8, 0, 1], 0, 0] execVM "\@tort_DynamicWeather\script\tort_DynamicWeather. sqf";
Foggy starting weather, 20% probability of a completely random change. Weather
will stay like this (+/- 0.05); - weather will then always return back to
starting weather in maximum 0.2 steps. Uses a random seed (default)

0 = [[0.35, 0, 0.2, 0], "constant", [0.1, 0], [0.1, 0.25], [0, 0.7, 0, 0.5, 0, 0.6], 200, 1337] execVM "\@tort_DynamicWeather\script\tort_DynamicWeather. sqf";
Nice Altis weather with a light chance of not overly extreme breakouts. Debug level n with [n>10] will output <n> weather calculations to rpt, so here it will output 200 calculations. Randomization based on random seed number 1337.

Arguments (all opyional):
initial            "clear"|"sunny"|"cloudy"|"foggy"|"bad"|"random"|"rndGood"|"rndBad"
                   Alternative: [0.2, 0.5, 0.4] (order: overcast,fog,wind) Negative values randomize, -0.6 means "random 0.6".
trend,             ("constant"|"worse"|"pWorse"|"better"|"pBetter"|"freeCycle"|"random"|"oscillate")
                    Weather trends towards this direction.
                    "pWorse"/"pBetter" have a 2/3 chance to trend towards their direction
                    "better"/"worse" trend to their direction in any case
                    "constant" keeps the weather as applied initially and in case of
                     random breakouts, weather slowly returns to constant level.
                    "oscillate": weather always oscillates between extreme values
probRndChange[]    [a,b] Probability of a random change per cycle.
                    [0.2, 0.1] means:
                    20% chance of next weather being random, respecting minMax[] values.
                    If a random event happens, then in 10% it does not respect
                    minMax[] values, but chooses values in the whole weather range.
variation[]        [min, max] Example: [0.05, 0.2] If weather trend leads somewhere,
                    a change per cycle is at least 0.05, at max 0.2.
                    If trend is "constant": 0.2 is the max change per cycle, to return to
                    constant level. +/-0.05 is the max variance around constant level then.
                    - No effect if you choose "random" trend.
minMax[]           [minOvercast, maxOvercast, minFog, maxFog, minWind, maxWind]
                    Here you can define the minimum and maximum values in which
                    overcast, fog and wind have to be.
debugMode         (0,1,2,3,n) 0 = no messages, 1 = show hints, 2 = change weather every few seconds and
                    show hints, so you can observe what happens. 3 = write 100 calculations to rpt, n>10 = write n calcs to rpt.
randomSeed         seed number (1 - 999999) / 0=script chooses a random seed number
delaySeconds         script delayed execution in seconds || neg.values: smooth transition to initial weather


Notes:
If you notice a hole above the player:
It's ArmA. The higher your cloud settings, the smaller the hole.


Future plans:
- Make menu available to script version
- Userconfig option for menu on/off
- Expose all possible weather/trend/mod aspects in menu
- Simple/Extended/Off menu toggle


Changelog:
v1.3.3
- Fix: "FreeCycle" trend did not move at all... Some minor bug fixes.

v1.3.1
- Adresses above setovercast problem.
- "oscillate" trend (jumps permanently from full cloud to zero clouds) was broken by design. Fixed.
- You can now alt-tab to Arma 3\userconfig\tort_DynamicWeather\tort_islands.sqf, edit it, return to your mission and your changes will be applied after mod restart (which is in the 0-8-1 support menu).



Credits & Thanks:
The script is derived from a script of forum user Meatball.


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: Dynamic,   Fog,   Overcast,   Rain,   Sunshine,   Weather