Difference between revisions of "User:Rasikko"
m
→Time Functions
imported>Scrivener07 (GetAnyDayOfWeek) |
imported>Scrivener07 m (→Time Functions) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 37: | Line 37: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
String Function GetCurrentDayOfWeek(Float afDaysPassed) Global | String Function GetCurrentDayOfWeek(Float afDaysPassed) Global | ||
; Returns the day of week | ; Returns the day of week. | ||
Int dayOfWeek = afDaysPassed as int % 7 | Int dayOfWeek = afDaysPassed as int % 7 | ||
String[] daysOfWeek = new String[7] | |||
daysOfWeek[0] = "Sunday" | |||
daysOfWeek[1] = "Monday" | |||
daysOfWeek[2] = "Tuesday" | |||
daysOfWeek[3] = "Wednesday" | |||
daysOfWeek[4] = "Thursday" | |||
daysOfWeek[5] = "Friday" | |||
daysOfWeek[6] = "Saturday" | |||
return "" | return daysOfWeek[dayOfWeek] | ||
EndFunction | |||
</source> | |||
<br> | |||
Converting functions..(short description) | |||
<source lang="papyrus"> | |||
Float Function GameDaysPassedToGameSecondsPassed(Float afDaysPassed) | |||
; Converts the GameDaysPassed return value to seconds passed. | |||
return afDaysPassed * 3600.0 | |||
EndFunction | EndFunction | ||
</source> | </source> | ||
Line 98: | Line 98: | ||
--[[User:Rasikko|Rasikko]] ([[User talk:Rasikko|talk]]) 2018-09-07T16:15:58 (EDT) | --[[User:Rasikko|Rasikko]] ([[User talk:Rasikko|talk]]) 2018-09-07T16:15:58 (EDT) | ||
<source lang=" | <source lang="papyrus"> | ||
String Function GetAnyDayOfWeek(Int day, Int month, Int year) Global | String Function GetAnyDayOfWeek(Int day, Int month, Int year) Global | ||
; returns the day of week that any day falls on for any month of any year. | ; returns the day of week that any day falls on for any month of any year. | ||
Line 137: | Line 137: | ||
EndFunction | EndFunction | ||
</source> | </source> | ||
The key values represent the days of the week that the first day of every month starts on for the year 2287. The formulas involved uses those values to find the days of the week for any day. --[[User:Rasikko|Rasikko]] ([[User talk:Rasikko|talk]]) 2018-09-09T00: | The key values represent the days of the week that the first day of every month starts on for the year 2287. The formulas involved uses those values to find the days of the week for any day. --[[User:Rasikko|Rasikko]] ([[User talk:Rasikko|talk]]) 2018-09-09T00:34:08 (EDT) |