Difference between revisions of "User:Rasikko"

Jump to navigation Jump to search
1,924 bytes removed ,  01:47, 4 July 2018
imported>Rasikko
imported>Rasikko
Line 55: Line 55:




== Calendar Functions ==
== Calendar Info ==
Various functions for dealing with the months, weeks, or days. Months in Skyrim are index based. Meaning Morning Star is Month 0, and Evening Star is Month 11.
Months in Skyrim are index based. Meaning Morning Star is Month 0, and Evening Star is Month 11.
Days of the week are also index based, where Sundas is 0, and Loredas is 6. One day passes on Morndas, 18th, Last Seed,4E201. The game starts at 8:00AM, Sundas, 17th Last Seed 4E 201, which is exactly 16 hours til the next day.<br /><br/>
Days of the week are also index based, where Sundas is 0, and Loredas is 6. One day passes on Morndas, 18th, Last Seed,4E201. The game starts at 8:00AM, Sundas, 17th Last Seed 4E 201, which is exactly 16 hours til the next day.<br /><br/>
Skyrim's calendar resets(first day of the year starts on middas again) every 6 years, thus the average length of a skyrim year is exactly 365 days(2,190/6).
Skyrim's calendar resets(first day of the year starts on middas again) every 6 years, thus the average length of a skyrim year is exactly 365 days(2,190/6).
The years can be broken up into indexes with 201 = 1, 202 = 2, 203 = 3, etc, resetting back to 1 on the year 207. To find the index for the year, divide the last two digits of the year by 6 and take only the remainder. I'm working towards a formula for getting the current 'calendar' for any skyrim year. Hoping to eventually solve the problem concerning [[GetCurrentGameTime - Utility]].<br><br>
The years can be broken up into indexes with 201 = 1, 202 = 2, 203 = 3, etc, resetting back to 1 on the year 207. To find the index for the year, divide the last two digits of the year by 6 and take only the remainder. Due to the game beginning on the 17th, a full calendar month thus occurs on the 17th of every month until 20th, First Seed 202 because of Sun's Dawn only having 28 days, from there, the 20th of every month will be a full calendar month.<br><br>
Due to the game beginning on the 17th, a full calendar month thus occurs on the 17th of every month until 20th, First Seed 202 because of Sun's Dawn only having 28 days, from there, the 20th of every month will be a full calendar month.<br><br>
In case I forget: Sun's Dawn and First Seed always begins on the same day of the week, like February and March.
In case I forget: Sun's Dawn and First Seed always begins on the same day of the week, like February and March.
*Finding the day of the week for the first day of the following month: (TotalDaysPreviousMonth + StartingDoWPreviousMonth) % 7
*Finding the day of the week for the first day of the following month: (TotalDaysPreviousMonth + StartingDoWPreviousMonth) % 7
<br/><br />
<br/><br />
The following function is the same as using GameMonth.GetValue(), but without using a property or [[GetValue - GlobalVariable]]. The idea behind all the following functions is to serve as an alternative to properties.
<source lang="papyrus">
Int Function GetCurrentGameMonth() Global
Int daysPassed = Utility.GetCurrentGameTime() as int
; the number of days left in the year when the game starts
Int daysRemainingGameStart =  136
; the number of days that have passed(which are not counted)
; when the game starts.
Int daysPassedGameStart = 228
Float monthlyAverage = 30.416667
if (daysPassed < daysRemainingGameStart)
return ((daysPassedGameStart + daysPassed) / monthlyAverage) as int
else
return ((daysPassed - daysRemainingGameStart) / monthlyAverage) as int
endif
EndFunction
</source>
<br>
Getting the current week of the year.
<source lang="papyrus">
Int Function GetCurrentGameWeek()
    Int totalDays = Utility.GetCurrentGameTime() as int
    Int daysRemainingGameStart = 136
    Int daysPassedGameStart = 228
    if (totalDays < daysRemainingGameStart)
    return (totalDays + daysPassedGameStart) / 7
    else
    return (totalDays - daysRemainingGameStart) / 7
    endif
EndFunction
</source>
<br>
This one should be self explanatory.
<source lang="papyrus">
Int Function GetGameMonthTotalDays(int aiGameMonth = 0) Global
; returns the number of days for this month.
Int[] months = new Int[12]
months[0] = 31
months[1] = 28
months[2] = 31
months[3] = 30
months[4] = 31
months[5] = 30
months[6] = 31
months[7] = 31
months[8] = 30
months[9] = 31
months[10]= 30
months[11]= 31
return months[aiGameMonth]
EndFunction
</source>


== Lunar Functions ==
== Lunar Functions ==
Anonymous user

Navigation menu