moonPhase: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma3 | | arma3 | ||
|1.58 | |1.58 | ||
|gr1= Environment | |gr1= Environment | ||
| Returns the phase of the in-game Moon on the given date in range 0...1, where 0 - new Moon, 1 - full Moon. According to this command the fullest Moon in Arma 3 at midnight is on <tt>[[setDate]] [4804,7,13,0,0];</tt> Use [[Arma_3_Utilities#Moon_Phases|Moon Phase Utility]] to find out date for a mission with desired moon. | | Returns the phase of the in-game Moon on the given date in range 0...1, where 0 - new Moon, 1 - full Moon. According to this command the fullest Moon in Arma 3 at midnight is on <tt>[[setDate]] [4804,7,13,0,0];</tt> Use [[Arma_3_Utilities#Moon_Phases|Moon Phase Utility]] to find out date for a mission with desired moon. | ||
| '''moonPhase''' date | | '''moonPhase''' date | ||
|p1= date: [[Array]] - required date in [[date]] format | |p1= date: [[Array]] - required date in [[date]] format | ||
| [[Number]] | | [[Number]] | ||
|x1= <code>_currentMoonPhase = [[moonPhase]] [[date]];</code> | |x1= <code>_currentMoonPhase = [[moonPhase]] [[date]];</code> | ||
|x2= <code>// Returns array of dates for given year when moon is at its fullest | |x2= <code>// Returns array of dates for given year when moon is at its fullest | ||
fnc_fullMoonDates = | fnc_fullMoonDates = | ||
Line 44: | Line 44: | ||
//set random full moon date in year 1970 | //set random full moon date in year 1970 | ||
[[setDate]] [[selectRandom]] (1970 [[call]] fnc_fullMoonDates);</code> | [[setDate]] [[selectRandom]] (1970 [[call]] fnc_fullMoonDates);</code> | ||
| [[moonIntensity]], [[sunOrMoon]] | | [[moonIntensity]], [[sunOrMoon]] | ||
}} | }} |
Revision as of 01:05, 18 January 2021
Description
- Description:
- Returns the phase of the in-game Moon on the given date in range 0...1, where 0 - new Moon, 1 - full Moon. According to this command the fullest Moon in Arma 3 at midnight is on setDate [4804,7,13,0,0]; Use Moon Phase Utility to find out date for a mission with desired moon.
- Groups:
- Environment
Syntax
Examples
- Example 1:
_currentMoonPhase = moonPhase date;
- Example 2:
// Returns array of dates for given year when moon is at its fullest fnc_fullMoonDates = { private _year = param [0, 2035]; private ["_date", "_phase", "_fullMoonDate"]; private _fullMoonPhase = 1; private _waxing = false; private _fullMoonDates = []; for "_i" from dateToNumber [_year, 1, 1, 0, 0] to dateToNumber [_year, 12, 31, 23, 59] step 1 / 365 do { _date = numberToDate [_year, _i]; _phase = moonPhase _date; call { if (_phase > _fullMoonPhase) exitWith { _waxing = true; _fullMoonDate = _date; }; if (_waxing) exitWith { _waxing = false; _fullMoonDates pushBack _fullMoonDate; }; }; _fullMoonPhase = _phase; }; _fullMoonDates }; //set random full moon date in year 1970 setDate selectRandom (1970 call fnc_fullMoonDates);
Additional Information
- See also:
- moonIntensitysunOrMoon
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note