Hi!
I've got a question regarding "eventful.lua" in DF-Hack. I'd like to track some information about dwarfs over multiple years. I've written a small LUA script to export data in a kind of XML style. Now I'm looking for way get this LUA script being triggered automatically and thought there could be an event (like at the 1st of each month).
But what I found so far is:
eventType=invertTable{
[0]="TICK",
"JOB_INITIATED",
"JOB_COMPLETED",
"UNIT_DEATH",
"ITEM_CREATED",
"BUILDING",
"CONSTRUCTION",
"SYNDROME",
"INVASION",
"INVENTORY_CHANGE",
"REPORT",
"UNIT_ATTACK",
"UNLOAD",
"INTERACTION",
"EVENT_MAX"
}
Looks like an event being triggered at the beginning of each month is not available. There is an event called "TICK". I was thinking about using this event, but it looks "dangerous" and I found no other script using it so far. As I'm no LUA expert, I'm also unsure how to setup an event handler for this case.
The "TICK" seems to correspond to 0. When looking at the C++ source of the event plugin I saw this:
static const handler_t eventHandlers[] = {
NULL,
ev_mng_jobInitiated,
ev_mng_jobCompleted,
ev_mng_unitDeath,
ev_mng_itemCreate,
ev_mng_building,
ev_mng_construction,
ev_mng_syndrome,
ev_mng_invasion,
ev_mng_inventory,
ev_mng_report,
ev_mng_unitAttack,
ev_mng_unload,
ev_mng_interaction,
};
So eventHandlers[0] == NULL.
My assumption so far: the TICK event is not implemented. Is my assumption correct or did I miss something?
If it should work, can anybody give me an example, how it could be used?