Matthijs 40 Posted February 14, 2016 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 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. 17 2 Share this post Link to post Share on other sites
das attorney 858 Posted September 4, 2016 Very clever! Thanks for sharing :) 1 Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted September 4, 2016 Can you return day of the week? (mon/tues/wed/...)? Share this post Link to post Share on other sites
das attorney 858 Posted September 4, 2016 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
Grumpy Old Man 3545 Posted September 4, 2016 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 1 Share this post Link to post Share on other sites
ceeeb 147 Posted September 4, 2016 Very nice, but no license? Also, noon is 12:00PM Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted September 5, 2016 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
Grumpy Old Man 3545 Posted September 5, 2016 but yea i am still trying to put together a function to convert date to day-of-week Did you miss my spoiler? Cheers 1 Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted September 5, 2016 Did you miss my spoiler? 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
Grumpy Old Man 3545 Posted September 5, 2016 Google, heh. Has quite a few sites covering this. Here's one of them. Updated my snippet in the spoiler above. Cheers 1 Share this post Link to post Share on other sites
tortuosit 486 Posted September 5, 2016 * Sunrise time (hours) – [/size]llw_fnc_getSunRise * Sunset time (hours) – [/size]llw_fnc_getSunRise BIS_fnc_sunriseSunsetTime 1 Share this post Link to post Share on other sites
Matthijs 40 Posted July 4, 2017 Ouch, seems I should visit the forums more often. 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! 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. 1 Share this post Link to post Share on other sites
Undeceived 392 Posted December 25, 2017 @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. 1 Share this post Link to post Share on other sites
pierremgi 4836 Posted December 25, 2017 I like sunOrMoon command and moonIntensity. 1 Share this post Link to post Share on other sites
Matthijs 40 Posted December 25, 2017 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... Share this post Link to post Share on other sites
Feint 137 Posted March 11, 2018 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!! 4 1 Share this post Link to post Share on other sites
Matthijs 40 Posted May 1, 2018 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! 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 1 Share this post Link to post Share on other sites
The Real Bunc 137 Posted May 27, 2019 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
Matthijs 40 Posted May 29, 2019 As per PM, feel free to re-use. Please be aware that the inShadow function is rather CPU intensive. Have fun! 4 1 Share this post Link to post Share on other sites
Samotion 0 Posted July 8, 2022 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
Matthijs 40 Posted July 9, 2022 Thanks for the heads up. Added new download link and included the APL agreement. Share this post Link to post Share on other sites