Jump to content

Recommended Posts

Inspired by MKY's blizzard script, I created functions that provide you with climatological information. The functions contain a simple climatological model and statistical data, that I gathered from all kinds or sources on the web. The climatological data can be overridden by terrain makers, using config entries. I hope that this will contribute to the creation of weather add-ons, realism- and survival mods. The archive includes a demonstration script.

 

Download: https://drive.google.com/file/d/1mkwaLX9Mxri2tIQvB-25OJ99t-K_WPq6/view?usp=sharing

 

2016-02-14-00002.jpg  2016-02-14-00001.jpg

 

 

FEATURES

Input variables for functions are mostly limited to time, date and a position or object.  Besides climatological data, the functions determine Latitude, time, date, overcast, fog, cloud occlusion, terrain occlusion, and object occlusion to calculate output values.
 
The following features are included: 
 
 * Air and Sea temperatures (array of numbers: °C) - llw_fnc_getTemperature
 * Date and time (text: YYYY-MM-DD hh:mm:ss) - llw_fnc_getDateTime
 * Shadow detection (boolean: true / false) - llw_fnc_inShadow
 * Solar Azimuth and Elevation angles (array of numbers: degrees) - llw_fnc_getSunAngle

 * Solar Elevation angle at 12:00PM (number: degrees) - llw_fnc_getSunElevationNoon

 * Solar Radiation energy (number: W/m²) - llw_fnc_getSunRadiation
 * Sunrise and Sunset time (array of numebers: hours) - llw_fnc_getSunRise
 
Please refer to the enclosed README.TXT for further details.
 
 

 

 

  • Like 17
  • Thanks 2

Share this post


Link to post
Share on other sites

Doesn't look like it.  I think there's already a function for that in the BIS library somewhere.

Share this post


Link to post
Share on other sites

Doesn't look like it.  I think there's already a function for that in the BIS library somewhere.

Might be, made this back in the days:

 

GOM_fnc_getWeekday = {

params [["_date",date]];

_date params ["_year","_m","_q"];

_weekday = "";

_yeararray = _year call BIS_fnc_numberDigits;
_yeararray params ["_y0","_y1","_y2","_y3"];

_J = (_y0 * 10) + _y1;
_K = (_y2 * 10) + _y3;

if (_m < 3) then {_m = _m + 12};

_hgreg = (_q + floor ( ((_m + 1) * 26) / 10 ) + _K + floor (_K / 4) + floor (_J / 4) - (2 * _J)) mod 7;

_shortDayNames = ["Sat","Sun","Mon","Tue","Wed","Thu","Fri"];
_dayNames = ["Saturday","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"];

if ("SHORT" in _this) exitWith {_shortDayNames select _hgreg};
_dayNames select _hgreg

};

 

Been using the climatological functions to great success!

Very useful stuff!

 

Edit: Fixed params error, use select instead multiple if thens (made this in the very beginnings of my A3 career)

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Very nice, but no license?

 

Also, noon is 12:00PM

Share this post


Link to post
Share on other sites

Very nice, but no license?

 

Also, noon is 12:00PM

 

maybe he means solar zenith or "solar noon"

 

 

but yea i am still trying to put together a function to convert date to day-of-week

Share this post


Link to post
Share on other sites

but yea i am still trying to put together a function to convert date to day-of-week

Did you miss my spoiler?

:yay:

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Did you miss my spoiler?

:yay:

 

Cheers

 

wow cool :)

 

how did you arrive at this equation?

 

_hgreg = (_q + floor ( ((_m + 1) * 26) / 10 ) + _K + floor (_K / 4) + floor (_J / 4) - (2 * _J)) mod 7;

Share this post


Link to post
Share on other sites

* Sunrise time (hours) â€“ [/size]llw_fnc_getSunRise

 * Sunset time (hours) â€“ [/size]llw_fnc_getSunRise

BIS_fnc_sunriseSunsetTime
  • Like 1

Share this post


Link to post
Share on other sites

Ouch, seems I should visit the forums more often. :huh2:

 

On 4-9-2016 at 11:17 PM, Grumpy Old Man said:

Been using the climatological functions to great success!

Very useful stuff!

 

Thanks, it's great to hear that! :smile_o:

 

On 5-9-2016 at 0:27 PM, tortuosit said:

BIS_fnc_sunriseSunsetTime

 

Thanks, I could have saved myself a lot of time. On the other hand, it has been a nice learning experience.  :grinning:

  • Like 1

Share this post


Link to post
Share on other sites

@Matthijs, these are some great and useful functions, thanks a lot!

 

One question: The inShadow function does not work for moonlight, does it? I'm asking because I'm creating a mission where I want to change the camouflageCoef depending of the player being in the shadows (full moon) or running around in the plain fields. Any help would be much appreciated.

 

  • Haha 1

Share this post


Link to post
Share on other sites
1 hour ago, Undeceived said:

@Matthijs, these are some great and useful functions, thanks a lot!

 

One question: The inShadow function does not work for moonlight, does it? I'm asking because I'm creating a mission where I want to change the camouflageCoef depending of the player being in the shadows (full moon) or running around in the plain fields. Any help would be much appreciated.

 

That is correct.

 

The function was created to allow calculation of energy build-up in a body. It does this by calculating the position of the sun and checks for collissions between the body and the sun. (a rather CPU intensive thing I must admit)

 

I did not account for moon, stars nor artificial light, because their energy radiation is negligible. Sorry...

:huh2:

Share this post


Link to post
Share on other sites

I used your sunAngle calculator function on my Depth Gauge Watch addon I just released.  Thanks for making this.  It allowed me to know when it make my depth gauge glow in the dark.  :)  Thanks again @Matthijs!!

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

 

On 11-3-2018 at 7:48 AM, Feint said:

I used your sunAngle calculator function on my Depth Gauge Watch addon I just released.  Thanks for making this.  It allowed me to know when it make my depth gauge glow in the dark.  :)  Thanks again @Matthijs!!

 

Cool! :icon_biggrin:

 

Please be aware that there is a native ArmA3 function that I was not aware of. (I haven't tried it myself though)

Thanks to Tortuosit for pointing it out:

On 5-9-2016 at 12:27 PM, tortuosit said:

BIS_fnc_sunriseSunsetTime

  • Like 1

Share this post


Link to post
Share on other sites

Matthijs, I hope you are still around. You have two functions here ( inShadow and sun angle I think) that I was needing to create myself for my DynamicCamo script but that seems silly when as far as I can see you seem to have already done this. Any chance you could pm me or let me know on here how you feel about reuse etc (with full credits of course). This would not be me just using it personally but wrapping it up into a larger package. Wonderful functions btw. 

 

As an aside my first thought when when I saw you have a solar irradiance function was "agh , soon to be followed by working solar panels in Arma" lol! Great work.

Share this post


Link to post
Share on other sites

As per PM, feel free to re-use.

Please be aware that the inShadow function is rather CPU intensive.

 

Have fun!

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

Hey the download link isnt working anymore? any chance i could get my hands on it?

Share this post


Link to post
Share on other sites

Thanks for the heads up. Added new download link and included the APL agreement.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×