Difference between revisions of "Talk:Bethesda Tutorial Scenes"
Jump to navigation
Jump to search
imported>Lmstearn m (→Extra Credit) |
imported>Lmstearn m (→Extra Credit) |
||
Line 15: | Line 15: | ||
string Function GetGreeting() | string Function GetGreeting() | ||
string | string Greet = "" | ||
float Time = Utility.GetCurrentGameTime() | float Time = Utility.GetCurrentGameTime() | ||
Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit | Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit | ||
Time *= 24 ; Convert from fraction of a day to number of hours | Time *= 24 ; Convert from fraction of a day to number of hours | ||
if Time < 13 | if Time < 13 | ||
Greet = "Good Morning" | |||
elseif Time > 17 | elseif Time > 17 | ||
Greet = "Good Evening" | |||
else | else | ||
Greet = "Good Afternoon" | |||
endif | endif | ||
Return | Return Greet | ||
EndFunction | EndFunction | ||
--[[User:Lmstearn|Lmstearn]] ([[User talk:Lmstearn|talk]]) 2015-01-27T07:21:07 (EST) | --[[User:Lmstearn|Lmstearn]] ([[User talk:Lmstearn|talk]]) 2015-01-27T07:21:07 (EST) |
Revision as of 07:22, 27 January 2015
Extra Credit
Can someone hint without too much spoilers how to make Bendu greet Gilfre different depending on time of day? Guess one way is placing timer check with GetCurrentTime, but would require 3 different phases in the scene which seems wrong? Another way I guess might be with a scene where the greet only trigger if they should come within a specific distance (with package template of some kind). --Nemesis 09:16, 15 February 2012 (EST)
- I would like to know this as well. GetCurrentTime does seem like the way to go, but it is unclear to me what the range is of the variable that is returned. Is time a number between 1-24? 0-1? And should the function be ran on Subject? --Mr6 10:22, 16 February 2012 (EST)
- GetCurrentTime should return a value between 0 and 24, although I'm not sure which of those two values should be returned at midnight. It's not a reference function, so it doesn't need to be called on anything.
- -- Cipscis 15:52, 16 February 2012 (EST)
Values 0 and 24 would both come back as midnight. Also if you use 25 you get 1am, 26 2am ect. --SoaringChris137 16:53, 3 March 2012 (EST)
- Using [this] we can try:
string Function GetGreeting() string Greet = "" float Time = Utility.GetCurrentGameTime() Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit Time *= 24 ; Convert from fraction of a day to number of hours if Time < 13 Greet = "Good Morning" elseif Time > 17 Greet = "Good Evening" else Greet = "Good Afternoon" endif Return Greet EndFunction