Difference between revisions of "User:Rasikko"
no edit summary
imported>Scrivener07 |
imported>Scrivener07 |
||
Line 11: | Line 11: | ||
<source lang="papyrus">Float daysPassed = (Game.GetFormFromFile(0x00000039, "Fallout4.ESM") as GlobalVariable).GetValue()</source> | <source lang="papyrus">Float daysPassed = (Game.GetFormFromFile(0x00000039, "Fallout4.ESM") as GlobalVariable).GetValue()</source> | ||
<br> | <br> | ||
Using any of them, you pass into the arguments where needed for the following | Using any of them, you pass into the arguments where needed for the following function: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Float Function GetGameTime(Float afDaysPassed) Global | Float Function GetGameTime(Float afDaysPassed) Global | ||
Line 26: | Line 26: | ||
</source> | </source> | ||
<br> | <br> | ||
This function requires the return value from GetGameTime() above. | |||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Float Function GetCurrentInGameTime(Float afGameTime) Global | Float Function GetCurrentInGameTime(Float afGameTime) Global | ||
Line 33: | Line 34: | ||
EndFunction | EndFunction | ||
</source> | </source> | ||
<br> | |||
<source lang="papyrus"> | |||
String Function GetCurrentDayOfWeek(Float afDaysPassed) Global | |||
; Returns the day of week. Returns an empty string if something went wrong. | |||
Int dayOfWeek = afDaysPassed as int % 7 | |||
if dayOfWeek == 0 | |||
return "Sunday" | |||
elseif dayOfWeek == 1 | |||
return "Monday" | |||
elseif dayOfWeek == 2 | |||
return "Tuesday" | |||
elseif dayOfWeek == 3 | |||
return "Wednesday" | |||
elseif dayOfWeek == 4 | |||
return "Thursday" | |||
elseif dayOfWeek == 5 | |||
return "Friday" | |||
elseif dayOfWeek == 6 | |||
return "Saturday" | |||
endif | |||
return "" | |||
EndFunction | |||
</source> | |||
<br> |