From 61a1b6fafd79372d1e40bba9fdb6f4b3832c0d0b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 10 Oct 2014 20:19:04 +0200 Subject: [PATCH] useful scripts for setting up the game. fix silver->money in the build scripts. config.lua: load the game configuration reports.lua: write the reports for the (initial) turn --- scripts/config.lua | 7 +++++++ scripts/reports.lua | 4 ++++ scripts/tools/build-e4.lua | 2 +- scripts/tools/build.lua | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 scripts/config.lua create mode 100644 scripts/reports.lua diff --git a/scripts/config.lua b/scripts/config.lua new file mode 100644 index 000000000..b9dc8bca8 --- /dev/null +++ b/scripts/config.lua @@ -0,0 +1,7 @@ +local path = 'scripts' +if config.install then + path = config.install .. '/' .. path +end +package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' +require 'eressea' +require 'eressea.xmlconf' diff --git a/scripts/reports.lua b/scripts/reports.lua new file mode 100644 index 000000000..6a7c4aedd --- /dev/null +++ b/scripts/reports.lua @@ -0,0 +1,4 @@ +dofile('config.lua') +eressea.read_game(get_turn() + '.dat') +init_reports() +write_reports() diff --git a/scripts/tools/build-e4.lua b/scripts/tools/build-e4.lua index 1e8c6f5d5..d873ab00b 100644 --- a/scripts/tools/build-e4.lua +++ b/scripts/tools/build-e4.lua @@ -3,7 +3,7 @@ function new_faction(email, race, lang, r) u = unit.create(f, r, 10) u:add_item("log", 5); u:add_item("horse", 2); - u:add_item("silver", 1000); + u:add_item("money", 1000); u:add_item("adamantium", 1); end diff --git a/scripts/tools/build.lua b/scripts/tools/build.lua index 1e8c6f5d5..d873ab00b 100644 --- a/scripts/tools/build.lua +++ b/scripts/tools/build.lua @@ -3,7 +3,7 @@ function new_faction(email, race, lang, r) u = unit.create(f, r, 10) u:add_item("log", 5); u:add_item("horse", 2); - u:add_item("silver", 1000); + u:add_item("money", 1000); u:add_item("adamantium", 1); end