Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
My guess would be to take the time of day, map it to 12 hours by subtracting half from it (given that 0.5 would equal 12am) and dividing it by half so we have a range from 0 to 1 over 12 hours. Then we just need to multiply it by how many frames you have.
(Timeofday-0.5)/0.5 * 30
So it would be something like .setFrame((engine.timeOfDay-0.5)/0.5*30|0)
And probably an Else or Math.max() for the first frame for if that equation is a negative value.
I haven’t testet that or have a clear mind at 2:30, but it surely is possible without any wemath functions :p
Anyway, just for the theory:
Doing the whole thing for a range of 6 hours (for convenient values only and because 1/2 isn't the best example :D) would then be like this?
.setFrame((engine.timeOfDay-0.75)/0.25*30|0)
So this one goes from 6 o'clock to 18 o'clock.
Also haven't tested it though. But it's important to clamp the frames correctly or it will just show frame zero if the selected frame is invalid (i.e. like Pancakes said about negative values). This only matters if the time is scaled like this, otherwise it will never be invalid.
I really only wanted to understand what I need to do with ll of those values and try if I can get something working out of it. :D
Well that means R.I.P. multiplier script, you were well loved, at least by me. ^^
All right, back to the testing-ground.