VanaTime 2.1.0 README

This document was last updated on Mon Sep 17 23:09:51 EDT 2007.

Introduction to VanaTime

VanaTime is a group of classes that deal with times, days, and moon phases in the MMORPG Final Fantasy Online (aka FFXI). Besides translating earth time to game time, you can also convert game time to real time, step forward a day, get a time estimate about how long you have left until the next optimal moon phase, and a few other useful features.

VanaTime is a work in progress and the API may change from time to timeā€¦ you may want to use explicit versioning in any code depending on it.


This will probably be the only class you end up using directly. It wraps everything else up in a convenient cascading update system that keeps things in sync, only does updates when necessary, and provides callbacks for firing off your code on events. Huzzah! Callbacks have access to the instance of TimeManager that fired the callback (in case you need access to values other than the property you're installing the callback for), the old value for the property, and the new value for the property. Cascading updates are enabled by enable_cascading_updates and disabled by disable_cascading_updates.

Here's a quick example text clock:

tm =
tm.callback(:time_string) {|m,old,new| puts "Time: #{new}"}
tm.callback(:next_phase_countdown_string) do |manager, old, new|
  puts "Countdown until #{manager.moon.next_phase}: #{new}"
loop {tm.update_earth_time( ; sleep 0.5}

If you want to manage existing VanaTime, VanaDay, and etc you can pass these as options on init, and any objects not passed in will be created for you. The name for the option will be similar to the class name:

tm = =>

Note that you can have as many TimeManager objects as you want or need for the same set of vanatime objects, as long as only one of them has cascading updates enabled.

The following are the supported properties for adding callbacks, along with the classes that define them (with the more interesting properties first):

> VanaTime
> VanaDay
> VanaMoon
> VanaMoonCountdown
> SkillupCalculator


* name
* direction
* strength
* weakness
* color
* enfeeble
* attribute
* ninjutsu
* avatar

FFXI::SkillupCalculator API

* crystal_element=(element)
* recipe_cap=(cap)
* skill=(skill)

All other details are handled by cascading updates via TimeManager.