Add a script to expose the correct season to soundsense on world load.

develop
Alexander Gavrilov 2012-12-06 19:00:48 +04:00
parent 126c31684e
commit 885059c887
3 changed files with 34 additions and 0 deletions

@ -23,6 +23,7 @@ DFHack future
- embark: lets you embark anywhere. - embark: lets you embark anywhere.
- lever: list and pull fort levers from the dfhack console. - lever: list and pull fort levers from the dfhack console.
- stripcaged: mark items inside cages for dumping, eg caged goblin weapons. - stripcaged: mark items inside cages for dumping, eg caged goblin weapons.
- soundsense-season: writes the correct season to gamelog.txt on world load.
New GUI scripts: New GUI scripts:
- gui/guide-path: displays the cached path for minecart Guide orders. - gui/guide-path: displays the cached path for minecart Guide orders.
- gui/workshop-job: displays inputs of a workshop job and allows tweaking them. - gui/workshop-job: displays inputs of a workshop job and allows tweaking them.

@ -137,6 +137,13 @@ tweak military-color-assigned
# remove inverse dependency of squad training speed on unit list size and use more sparring # remove inverse dependency of squad training speed on unit list size and use more sparring
tweak military-training tweak military-training
###########
# Scripts #
###########
# write the correct season to gamelog on world load
soundsense-season
####################################################### #######################################################
# Apply binary patches at runtime # # Apply binary patches at runtime #
# # # #

@ -0,0 +1,26 @@
-- On map load writes the current season to gamelog.txt
local seasons = {
[0] = 'Spring',
[1] = 'Summer',
[2] = 'Autumn',
[3] = 'Winter',
}
local args = {...}
local function write_gamelog(msg)
local log = io.open('gamelog.txt', 'a')
log:write(msg.."\n")
log:close()
end
if args[1] == 'disable' then
dfhack.onStateChange[_ENV] = nil
else
dfhack.onStateChange[_ENV] = function(op)
if op == SC_WORLD_LOADED then
write_gamelog(seasons[df.global.cur_season]..' has arrived on the calendar.')
end
end
end