I am generating a schedule for a school that requires automatically setting the ingame time as real time continues. So far, I have reached a wall on how to find the formula. Period 1 in real time starts at 4:30pm, and the ingame time has to be 7:00am. Period 8 in real time starts at 7:53pm, and the ingame time has to be 3:00pm. By making a script convert current time (0430P) to military time (1630)
function ConStM(timee) --Convert from Standard to Military
local addtime=false
if timee:sub(5):lower()=="p" then
addtime=true
end
timee=tonumber(timee:sub(1,4))
if addtime==true then
timee=timee+1200
end
return timee
end
print(ConStM("0430P"))
It returns 1630.
So 1630=0700 and 1900=1500.
I get stuck there, how am I going to find the function to that?
1630x=700 and 1900x=1500,
x=700-1630,
x=-930,
1900(-930)=1500,
-1767000=1500
That's not true.. What am I doing?
For example. If it's 4:30pm, it will be 7:00am ingame. If it's 6:13pm, it will be 11:00am ingame. If it's 8:15pm, it will be 3:00pm ingame. If it's earlier than 4:30pm, then it will be near 7:00am. If it's later than 8:15pm, then it will be near 3:00pm. Graph Example http://postimg.org/image/4klzbhim3/

4 comments
Are you just asking how to take advantage of times that look like "4:30p"? Are you asking about how to translate real world time into a faster moving game time?
I am trying to convert the time between 4:30pm and 8:15pm turn into 7:00am and 3:00pm ingame for a realistic school day.
What do you plan to do with the rest of the day?
For example, if the military time was before 1630, then it would be a very small linear line. I'll try to make the formula to make the two lines before and after touch. Just finding the formula for the ingame time to pair with real time I'll need.