Hey guys....
I'm writing a mod that will give arrival times for boats and zeppelins. A few questions...
1. Has anyone tried this? Is it possible?
2. After a server restart, do all the boats start their rounds at a constant time? (Like, 25 seconds after server start the Theramore / Menethil boat starts it's rounds?)
What I've discovered:
- The Menethil / Theramore roundtrip appears to be around 330 seconds (5 minutes, 30 seconds).
- It appears from my observations that the boat lands at Menethil harbour around 100 seconds after a server restart.
- Using this code to calculate the next arrival time of the boat in menethil seems to come close:
Code:
...
local nextArrivalInSecs = GetSecsToArrival(100, 330)
...
function GetSecsToArrival(anchor, roundtrip)
local result = -1
local currentTime = GetTime()
local intervals = ceil((currentTime - anchor) / roundtrip)
local arrTime = anchor + (intervals * roundtrip)
result = floor(arrTime - currentTime)
return floor(result)
end
- With these assumptions there is still some error, which leads me to believe there may be a random factor involved when the boat zones in / out of each continent (which would make this mod impossible). I'm not sure if this is just floating point drift or an actual random factor, so I'm still experimenting.
I sure hope there's some regularity to these schedules because I'd LOVE to know exactly when some of these boats are gonna be coming....
- FRRjak