Speaking of dfhack:
I made some small progress with side project "dfhack4ss", here is first draft of lua script:
log = io.open("ss_fix.log", "a")
function msg(m, c)
dfhack.gui.showAnnouncement(m,dfhack.color(c))
log:write(m)
log:write("\n")
log:flush()
dfhack.println(m)
end
-- SEASON FIX
--403200 per year, 100800 per season
season = math.floor(df.global.cur_year_tick/100800)
if season == 0 then
msg("Spring has arrived on the calendar.",COLOR_LIGHTGREEN)
elseif season == 1 then
msg("Summer has arrived on the calendar.",COLOR_LIGHTGREEN)
elseif season == 2 then
msg("Autumn has arrived on the calendar.",COLOR_LIGHTGREEN)
elseif season == 3 then
msg("Winter has arrived on the calendar.",COLOR_LIGHTGREEN)
end
-- WEATHER FIX
raining = 0
snowing = 0
for x=0, #df.global.current_weather-1 do
for y=0, #df.global.current_weather[x]-1 do
weather = df.global.current_weather[x][y]
if weather == 1 then
raining = 1
elseif weather == 2 then
snowing = 1
end
end
end
if (snowing == 0 and raining == 0) then
msg("The weather has cleared.",COLOR_LIGHTGREEN)
elseif raining == 1 then
msg("It has started raining.",COLOR_LIGHTGREEN)
elseif snowing == 1 then
msg("A snow storm has come.",COLOR_LIGHTGREEN)
end
-- SIEGE FIX
--local function event_loop()
-- msg(df.global.cur_year_tick,COLOR_LIGHTGREEN)
-- dfhack.timeout(1, 'ticks', event_loop)
--end
event_loop()
io.close(log)
It reads current state of game and outputs it in logfile (which soundsense modified to read multiple files reads) so that it can restore some state information afer game is loaded:
* Weather
* Seasons
I would like to add more messages, begining with:
* Siege start (used to show in logfiles, disabled with recent updates), however i have no idea how to read siege state in dfhack.
* Siege end (if we can detect start, end would be easy)
* Dwarf reaching legendary (also used to show in logfiles, disabled in df 2010)
Also, items mentioned in:
http://www.bay12forums.com/smf/index.php?topic=64834.msg1520083#msg1520083