← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/new-tutorials into lp:widelands

 

wl-zocker has proposed merging lp:~widelands-dev/widelands/new-tutorials into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #536532 in widelands: "Integrate new economy gui into campaign or tutorial"
  https://bugs.launchpad.net/widelands/+bug/536532
  Bug #1088222 in widelands: "Barbarians Campaign: small suggestions for improvement"
  https://bugs.launchpad.net/widelands/+bug/1088222
  Bug #1106132 in widelands: "Rework campaign maps/add tutorial maps (thoughts and discussion)"
  https://bugs.launchpad.net/widelands/+bug/1106132
  Bug #1286576 in widelands: "Tutorial fails if player is in road building mode when military building finishes"
  https://bugs.launchpad.net/widelands/+bug/1286576
  Bug #1366580 in widelands: "listitem needs paragraphdivider() before its first entry"
  https://bugs.launchpad.net/widelands/+bug/1366580

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/new-tutorials/+merge/238682

This branch contains four tutorials that will replace the old one. I have removed the first Barbarian campaign because it did not introduce anything new. The story can now be found in bar01.wmf (the former t02.wmf). I have also added a new Lua function message_box_objective in message.lua.

Some links:
- There has been some discussion in our forum: https://wl.widelands.org/forum/topic/1560/
- The Lua interface misses some functionality. See bug 1380286, bug 1380287 and bug 1380288. If they could be implemented before merging, that would be cool. Otherwise, we ship the tutorials without these features and introduce them later.
- The tutorials should get their own menu and be moved to the campaigns folder (they currently are in maps/Tutorials for easy testing). This can be added when https://code.launchpad.net/~widelands-dev/widelands/i18nfixes has been merged.
- I would like to fix the paragraphdivider() (bug 1366580) differently, so please leave this bug open. This branch only fixes the symptoms. I did not fix it to avoid unnecessary conflicts with https://code.launchpad.net/~widelands-dev/widelands/bug-1298301 (and to avoid the diff growing bigger and bigger).

And there are some "TODO(codereview):" in the code. Just grep for them.
-- 
https://code.launchpad.net/~widelands-dev/widelands/new-tutorials/+merge/238682
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/new-tutorials into lp:widelands.
=== renamed directory 'campaigns/t02.wmf' => 'campaigns/bar01.wmf'
=== modified file 'campaigns/bar01.wmf/binary/building'
Binary files campaigns/t02.wmf/binary/building	2010-02-17 21:17:15 +0000 and campaigns/bar01.wmf/binary/building	2014-10-17 09:40:17 +0000 differ
=== modified file 'campaigns/bar01.wmf/binary/mapobjects'
Binary files campaigns/t02.wmf/binary/mapobjects	2010-10-24 17:00:49 +0000 and campaigns/bar01.wmf/binary/mapobjects	2014-10-17 09:40:17 +0000 differ
=== modified file 'campaigns/bar01.wmf/binary/resource'
Binary files campaigns/t02.wmf/binary/resource	2010-10-24 17:00:49 +0000 and campaigns/bar01.wmf/binary/resource	2014-10-17 09:40:17 +0000 differ
=== modified file 'campaigns/bar01.wmf/binary/terrain'
Binary files campaigns/t02.wmf/binary/terrain	2010-10-24 17:48:15 +0000 and campaigns/bar01.wmf/binary/terrain	2014-10-17 09:40:17 +0000 differ
=== modified file 'campaigns/bar01.wmf/elemental'
--- campaigns/t02.wmf/elemental	2014-10-04 18:23:52 +0000
+++ campaigns/bar01.wmf/elemental	2014-10-17 09:40:17 +0000
@@ -1,10 +1,11 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
 [global]
-packet_version=1
-map_w=64
-map_h=64
-nr_players=1
-world=greenland
-name=_"02 – A Place to Call Home"
-author=Winterwind
-descr=_"In this scenario, the higher production buildings including mining and military expansions will be introduced."
-background="campaigns/t02.wmf/pics/background.jpg"
+packet_version="1"
+map_w="64"
+map_h="64"
+nr_players="1"
+name=_"01 – A Place to Call Home"
+author="Winterwind,wl-zocker"
+descr=_"In this scenario, the higher production buildings including mining will be introduced."
+background="campaigns/bar01.wmf/pics/background.jpg

=== modified file 'campaigns/bar01.wmf/extra_data'
--- campaigns/t02.wmf/extra_data	2010-02-17 21:17:15 +0000
+++ campaigns/bar01.wmf/extra_data	2014-10-17 09:40:17 +0000
@@ -1,2 +1,4 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
 [global]
-packet_version=1
+packet_version="1"

=== renamed file 'campaigns/tutorial01.wmf/pics/background.jpg' => 'campaigns/bar01.wmf/pics/background.jpg'
=== modified file 'campaigns/bar01.wmf/player_names'
--- campaigns/t02.wmf/player_names	2010-02-17 21:17:15 +0000
+++ campaigns/bar01.wmf/player_names	2014-10-17 09:40:17 +0000
@@ -1,6 +1,10 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
 [global]
-packet_version=1
+packet_version="2"
 
 [player_1]
-name=Player 1
-tribe=barbarians
+name="Player 1"
+tribe="barbarians"
+ai=
+closeable="false"

=== modified file 'campaigns/bar01.wmf/player_position'
--- campaigns/t02.wmf/player_position	2010-02-17 21:17:15 +0000
+++ campaigns/bar01.wmf/player_position	2014-10-17 09:40:17 +0000
@@ -1,3 +1,5 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
 [global]
-packet_version=2
-player_1=12 10
+packet_version="2"
+player_1="12 10"

=== added file 'campaigns/bar01.wmf/scripting/helper_functions.lua'
--- campaigns/bar01.wmf/scripting/helper_functions.lua	1970-01-01 00:00:00 +0000
+++ campaigns/bar01.wmf/scripting/helper_functions.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,22 @@
+-- =================
+-- Helper functions
+-- =================
+
+function scroll_smoothly_nordwards_to(f, g_T)
+   local mv = wl.ui.MapView()
+   local x, y
+   local map = wl.Game().map
+
+   if math.abs(f.viewpoint_x - mv.viewpoint_x) <
+      math.abs(f.viewpoint_x + 64 * map.width - mv.viewpoint_x)
+   then
+      x = f.viewpoint_x
+   else
+      x = f.viewpoint_x + map.width * 64
+   end
+
+   y = f.viewpoint_y - map.height * 32 -- because we want to go northwards
+
+   return scroll_smoothly_to_pos(x - mv.width / 2, y - mv.height / 2, g_T)
+end
+

=== modified file 'campaigns/bar01.wmf/scripting/init.lua'
--- campaigns/t02.wmf/scripting/init.lua	2014-03-25 06:18:48 +0000
+++ campaigns/bar01.wmf/scripting/init.lua	2014-10-17 09:40:17 +0000
@@ -1,25 +1,28 @@
 -- =======================================================================
---                       Barbarians Campaign Mission 2
+--                       Barbarians Campaign Mission 1
 -- =======================================================================
 
-set_textdomain("scenario_t02.wmf")
+set_textdomain("bar01.wmf")
 
 include "scripting/coroutine.lua"
 include "scripting/objective_utils.lua"
 include "scripting/infrastructure.lua"
+include "scripting/messages.lua"
 
 -- ==========
 -- Constants
 -- ==========
 plr = wl.Game().players[1]
-
--- ===============
--- Initialization
--- ===============
+map = wl.Game().map
+
+sf = map:get_field(12,10)
+al_thunran = map:get_field(5,46)
+grave = map:get_field(24,28)
+
+include "map:scripting/texts.lua"
+include "map:scripting/helper_functions.lua"
+
 include "map:scripting/starting_conditions.lua"
 
-
--- ==============
--- Mission Logic
--- ==============
 include "map:scripting/mission_thread.lua"
+

=== modified file 'campaigns/bar01.wmf/scripting/mission_thread.lua'
--- campaigns/t02.wmf/scripting/mission_thread.lua	2014-08-26 17:25:00 +0000
+++ campaigns/bar01.wmf/scripting/mission_thread.lua	2014-10-17 09:40:17 +0000
@@ -2,53 +2,60 @@
 --                            Main mission thread
 -- =======================================================================
 
-include "map:scripting/mission_thread_texts.lua"
+include "scripting/table.lua"
 include "scripting/ui.lua"
-include "scripting/table.lua"
 
 quarry_done = false
 enhance_buildings_done = false
 build_materials_done = false
 cattle_farm_done = false
 
-function send_msg(t)
-   t.h = 400
-   plr:message_box(t.title, t.body, t)
-end
-
-function add_obj(t)
-   return plr:add_objective(t.name, t.title, t.body)
-end
-
-
--- ==============================================
--- First messages player at beginning of mission
--- ==============================================
+
+-- =====================================================
+-- First messages to the player at beginning of mission
+-- =====================================================
 function introduction_thread()
    sleep(2000)
 
-   send_msg(briefing_msg_1)
-   send_msg(briefing_msg_2)
-   send_msg(briefing_msg_3)
-
-   send_msg(order_msg_1)
-   send_msg(order_msg_2)
+   message_box_objective(plr, briefing_msg_01)
+   -- these buildings are still burning, but only for a while
+   map:place_immovable("destroyed_building",map:get_field(7,41),"barbarians")
+   map:place_immovable("destroyed_building",map:get_field(5,52),"barbarians")
+   plr:reveal_fields(al_thunran:region(8))
+   message_box_objective(plr, briefing_msg_02) -- Al'thunran
+   plr:reveal_fields(grave:region(4))
+   message_box_objective(plr, briefing_msg_03) -- grave
+   message_box_objective(plr, briefing_msg_04)
+
+   message_box_objective(plr, briefing_msg_05)
+   message_box_objective(plr, briefing_msg_06)
+   message_box_objective(plr, briefing_msg_07)
+
+   -- introduction of Khantrukh
+   message_box_objective(plr, briefing_msg_08)
+
+   message_box_objective(plr, order_msg_ranger)
+   local obj = add_campaign_objective(obj_build_rangers)
+
+   while not check_for_buildings(plr, {rangers_hut = 2}) do sleep(500) end
+   obj.done = true
+
+   plr:allow_buildings{"sentry","barrier"}
+
+   message_box_objective(plr, order_msg_1)
+   message_box_objective(plr, order_msg_2)
 
    -- Reveal the rocks
-   local obj = add_obj(obj_claim_northeastern_rocks)
-
    local rocks = wl.Game().map:get_field(27, 48)
-   local intermediate_point = wl.Game().map:get_field(31,12)
    plr:reveal_fields(rocks:region(6))
-   local way1 = scroll_smoothly_to(intermediate_point, 1500)
-   local way2 = scroll_smoothly_to(rocks, 1500)
-
-   send_msg(order_msg_3)
-   send_msg(order_msg_4)
-
-   -- Move back to HQ
-   timed_scroll(array_reverse(way2), 10)
-   timed_scroll(array_reverse(way1), 10)
+   local way = scroll_smoothly_nordwards_to(rocks, 1500)
+
+   message_box_objective(plr, order_msg_3)
+   obj = add_campaign_objective(obj_claim_northeastern_rocks)
+   message_box_objective(plr, order_msg_4)
+
+   -- Move back
+   timed_scroll(array_reverse(way), 10)
 
    -- Now, wait till the quarry comes up
    local f = wl.Game().map:get_field(27,48):region(6)
@@ -57,7 +64,7 @@
    end
    obj.done = true
 
-   send_msg(order_msg_5_quarry)
+   message_box_objective(plr, order_msg_5_quarry)
 
    quarry_done = true
 end
@@ -74,9 +81,9 @@
       sleep(4000)
    end
 
-   -- Send a msg and add the objective
-   send_msg(order_msg_6_geologist)
-   o = add_obj(obj_build_mines)
+   -- Send a message and add the objective
+   message_box_objective(plr, order_msg_6_geologist)
+   o = add_campaign_objective(obj_build_mines)
    plr:allow_buildings{
       "coalmine",
       "oremine",
@@ -84,17 +91,20 @@
       "granitemine"
    }
 
+   sleep(10000)
+   message_box_objective(plr, story_msg2)
+
    -- Wait for completion
    while not check_for_buildings(plr, {coalmine = 1, oremine = 1}) do
       sleep(5000)
    end
    o.done = true
-   send_msg(order_msg_7_mines_up)
-   send_msg(order_msg_8_mines_up)
-   send_msg(order_msg_9_hunter)
-   send_msg(order_msg_10_bread)
+   message_box_objective(plr, order_msg_7_mines_up)
+   message_box_objective(plr, order_msg_8_mines_up)
+   message_box_objective(plr, order_msg_9_hunter)
+   message_box_objective(plr, order_msg_10_bread)
 
-   local obj_bf = add_obj(obj_basic_food)
+   local obj_bf = add_campaign_objective(obj_basic_food)
    -- The function to check for completeness
    run(function()
       local tavern_msg_done = nil
@@ -104,11 +114,11 @@
             "hunters_hut", "gamekeepers_hut", "tavern"
          }
          if #rv.hunters_hut >= 1 and not hunter_msg_done then
-            send_msg(order_msg_11_basic_food_began)
+            message_box_objective(plr, order_msg_11_basic_food_began)
             hunter_msg_done = true
          end
          if #rv.tavern >= 1 and not tavern_msg_done then
-            send_msg(order_msg_13_tavern)
+            message_box_objective(plr, order_msg_13_tavern)
             tavern_msg_done = true
          end
          if #rv.hunters_hut >= 1 and #rv.gamekeepers_hut >= 1
@@ -116,9 +126,11 @@
          sleep(5331)
       end
       obj_bf.done = true
+      sleep(5000)
+      message_box_objective(plr, story_msg4)
    end)
 
-   local obj_farming = add_obj(obj_begin_farming)
+   local obj_farming = add_campaign_objective(obj_begin_farming)
 
    -- Start the cattlefarm thread
    run(cattle_farm)
@@ -131,7 +143,7 @@
          end
          sleep(4234)
       end
-      send_msg(order_msg_12_farming_began)
+      message_box_objective(plr, order_msg_12_farming_began)
       obj_farming.done = true
    end)
 
@@ -151,25 +163,50 @@
    end
 
    -- Ready to build refiner stuff
-   send_msg(order_msg_14_refine_ore)
+   message_box_objective(plr, order_msg_14_refine_ore)
    plr:allow_buildings{"smelting_works"}
-   o = add_obj(obj_refine_ores)
+   o = add_campaign_objective(obj_refine_ores)
    while #plr:get_buildings("smelting_works") < 1 do
       sleep(6223)
    end
    o.done = true
 
    -- Information about making mines deeper
-   send_msg(order_msg_15_mines_exhausted)
-   plr:allow_buildings{ "deep_coalmine", "inn", "micro-brewery" }
-   -- objective.check will make sure that this i finished
-   local obj = add_obj(obj_enhance_buildings)
+   -- Wait until the player has an experienced worker.
+   local chiefminer_found = false
+   while not chiefminer_found do
+      local mines = plr:get_buildings{"coalmine","oremine"}
+      for k,v in ipairs(mines.coalmine) do
+         if v:get_workers("chief-miner") > 0 then
+            chiefminer_found = true
+            break
+         end
+      end
+      for k,v in ipairs(mines.oremine) do
+         if v:get_workers("chief-miner") > 0 then
+            chiefminer_found = true
+            break
+         end
+      end
+
+      -- If everything else is done, show this objective, too. Otherwise, the player has nothing to do.
+      if (build_materials_done and quarry_done and cattle_farm_done) then
+         chiefminer_found = true
+      end
+      sleep(5000)
+   end
+   message_box_objective(plr, order_msg_15_mines_exhausted)
+   plr:allow_buildings{"deep_coalmine", "deep_oremine", "inn", "micro-brewery"}
+   local obj = add_campaign_objective(obj_enhance_buildings)
 
    run(function()
-      while not check_for_buildings(plr,
-         { inn = 1, deep_coalmine = 1, ["micro-brewery"] = 1 })
-      do
-         sleep(5742)
+      while true do
+         local rv = plr:get_buildings{"deep_coalmine", "deep_oremine", "inn", "micro-brewery"}
+         if (#rv.inn > 0 and #rv["micro-brewery"] > 0) and
+            (#rv.deep_coalmine + #rv.deep_oremine > 0) then
+            break
+         end
+         sleep(5421)
       end
       obj.done = true
       enhance_buildings_done = true
@@ -183,7 +220,7 @@
 function build_materials_thread()
    local plr = wl.Game().players[1]
 
-   -- Wait for a barrier or sentry to be build
+   -- Wait for a barrier or sentry to be built
    while true do
       local rv = plr:get_buildings{"sentry", "barrier"}
       if #rv.sentry + #rv.barrier > 0 then
@@ -192,16 +229,21 @@
       sleep(5421)
    end
 
-   send_msg(order_msg_16_blackwood)
+   message_box_objective(plr, order_msg_16_blackwood)
    plr:allow_buildings{"hardener"}
-   local o = add_obj(obj_better_material_1)
+   sf.immovable:set_wares("blackwood",5)
+   -- So that player has really little, but still enough to expand a bit
+   local o = add_campaign_objective(obj_better_material_1)
+
+   sleep(30*1000)
+   message_box_objective(plr, story_msg1)
    while #plr:get_buildings("hardener") < 1 do sleep(5421) end
    o.done = true
 
-   send_msg(order_msg_17_grindstone)
+   message_box_objective(plr, order_msg_17_grout)
    plr:allow_buildings{"lime_kiln", "well", "charcoal_kiln"}
-   o = add_obj(obj_better_material_2)
-   -- Wait for the buildings to be build
+   o = add_campaign_objective(obj_better_material_2)
+   -- Wait for the buildings to be built
    while true do
       local rv = plr:get_buildings{"lime_kiln", "well",
          "coalmine", "deep_coalmine", "charcoal_kiln"}
@@ -213,12 +255,12 @@
    end
    o.done = true
 
-   send_msg(order_msg_18_reed_yard)
+   message_box_objective(plr, order_msg_18_reed)
    plr:allow_buildings{"reed_yard"}
-   o = add_obj(obj_better_material_3)
+   o = add_campaign_objective(obj_better_material_3)
    while #plr:get_buildings("reed_yard") < 1 do sleep(5421) end
 
-   send_msg(order_msg_19_all_material)
+   message_box_objective(plr, order_msg_19_all_material)
    o.done = true
 
    build_materials_done = true
@@ -232,11 +274,14 @@
       sleep(7834)
    end
 
-   send_msg(msg_cattlefarm_00)
+   message_box_objective(plr, msg_cattlefarm_00)
 
-   local o = add_obj(obj_build_cattlefarm)
+   local o = add_campaign_objective(obj_build_cattlefarm)
    plr:allow_buildings{"cattlefarm"}
 
+   sleep(10000)
+   message_box_objective(plr, story_msg3)
+
    while not check_for_buildings(plr, { cattlefarm = 1 }) do
       sleep(2323)
    end
@@ -251,10 +296,10 @@
 -- ======================
 function story_messages_thread()
    wake_me(180 * 1000)
-   send_msg(msg_story_2)
+   message_box_objective(plr, msg_story_2)
 
    wake_me(600 * 1000)
-   send_msg(msg_story_1)
+   message_box_objective(plr, msg_story_1)
 end
 
 -- =================
@@ -266,161 +311,17 @@
          sleep(10000)
    end
 
-   send_msg(msg_mission_complete)
-   plr:reveal_scenario("barbariantut02")
-end
-
--- ===============
--- Village thread
--- ===============
-function village_thread()
-   local plr = wl.Game().players[1]
-   while not (plr:seen_field(wl.Game().map:get_field(52,39)) or
-              plr:seen_field(wl.Game().map:get_field(58,10))) do
-         sleep(6534)
-   end
-
-   reveal_village()
-
-   pts = scroll_smoothly_to(wl.Game().map:get_field(55, 25), 3000)
-
-   send_msg(msg_village)
-
-   timed_scroll(array_reverse(pts), 10)
-   sleep(1500)
-end
-
-
---[[
-   This is a village of poor but friendly people who have settled in a safe
-   valley between two glaciers. They hunt and produce timber and grain but they
-   do not have ores or even stones, so they are dependent on the infrequent
-   merchant that may pass by and provide them with whatever they cannot
-   produce on their own. Their only protection is a guard hut at each entrance
-   to the valley. Therefore they realize that they may have to join a more
-   powerful society for protection in order to stay alive in this world.
-
-   A user that explores the map far from home will discover this village as a
-   bonus. Doing so is not necessary for winning.
-
-   Technically the village is created instantly when the player sees any of the
-   two entrances to the valley. But we place some trees and fields in various
-   stages of growth to make it seem like the village has actually existed for
-   some time. Some land ownership adjustments are made to ensure that the
-   village owns all land between the glaciers.
---]]
-function reveal_village()
-   function force_map_immovables(list)
-      local map = wl.Game().map
-      for idx, id in ipairs(list) do
-         local f = map:get_field(id[2], id[3])
-         if f.immovable then
-            pcall(f.immovable.remove, f.immovable)
-         end
-         map:place_immovable(id[1], f, id[4])
-      end
-   end
-
-   force_map_immovables{
-      { "spruce_summer_old", 55, 19 },
-      { "larch_summer_pole", 58, 19 },
-      { "birch_summer_mature", 58, 20 },
-      { "larch_summer_old", 57, 21 },
-      { "alder_summer_pole", 54, 22 },
-      { "birch_summer_pole", 56, 24 },
-      { "aspen_summer_old", 58, 24 },
-      { "larch_summer_pole", 56, 25 },
-      { "spruce_summer_old", 53, 27 },
-      { "larch_summer_pole", 57, 27 },
-      { "aspen_summer_mature", 52, 29 },
-      { "birch_summer_pole", 54, 30 },
-      { "beech_summer_old", 55, 30 },
-      { "larch_summer_old", 56, 30 },
-      { "field2", 56, 14, "barbarians" },
-      { "field0s",57, 14, "barbarians" },
-      { "field2", 54, 15, "barbarians" },
-      { "field2", 57, 15, "barbarians" },
-      { "field2", 54, 16, "barbarians" },
-      { "field1", 57, 16, "barbarians" },
-      { "field2", 58, 16, "barbarians" },
-      { "field2", 54, 17, "barbarians" },
-      { "field0", 55, 17, "barbarians" },
-      { "field2", 57, 17, "barbarians" },
-      { "field2", 55, 18, "barbarians" },
-      { "field2", 57, 18, "barbarians" },
-      { "field2", 53, 31, "barbarians" },
-      { "field2", 54, 31, "barbarians" },
-      { "field0", 55, 31, "barbarians" },
-      { "field2", 56, 32, "barbarians" },
-      { "field2", 52, 33, "barbarians" },
-      { "field0s",55, 33, "barbarians" },
-      { "field2", 56, 33, "barbarians" },
-      { "field2", 53, 34, "barbarians" },
-      { "field1", 54, 34, "barbarians" },
-      { "field2", 56, 34, "barbarians" },
-      { "field2", 53, 35, "barbarians" },
-      { "field2", 55, 35, "barbarians" },
-   }
-
-   local plr = wl.Game().players[1]
-   prefilled_buildings(plr,
-      {"sentry", 57, 9},
-      {"sentry", 52, 39},
-      {"hunters_hut", 56, 10},
-      {"gamekeepers_hut", 56, 12},
-      {"farm", 56, 16},
-      {"well", 54, 18},
-      {"bakery", 55, 20, wares = {wheat=6, water=6}},
-      {"lumberjacks_hut", 56, 21},
-      {"lumberjacks_hut", 55, 22},
-      {"lumberjacks_hut", 54, 24},
-      {"rangers_hut", 57, 24},
-      {"rangers_hut", 55, 25},
-      {"hardener", 54, 26, wares = {log = 8}},
-      {"warehouse", 53, 28},
-      {"inn", 55, 28, wares = {pittabread = 4, meat = 4}},
-      {"tavern", 57, 28, wares = {pittabread=4, meat = 4}},
-      {"well", 52, 30},
-      {"farm", 54, 33},
-      {"bakery", 51, 35, wares = {wheat = 6, water = 6}},
-      {"well", 52, 37}
-   )
-
-   -- Adjust the borders so that the village owns everything green
-   local map = wl.Game().map
-   plr:conquer(map:get_field(59, 16), 2)
-   plr:conquer(map:get_field(57, 18), 2)
-   plr:conquer(map:get_field(58, 19), 1)
-   plr:conquer(map:get_field(58, 20), 1)
-   plr:conquer(map:get_field(54, 15), 1)
-   plr:conquer(map:get_field(54, 16), 1)
-   plr:conquer(map:get_field(54, 20), 1)
-   plr:conquer(map:get_field(54, 22), 1)
-   plr:conquer(map:get_field(57, 23), 1)
-   plr:conquer(map:get_field(58, 24), 1)
-   plr:conquer(map:get_field(57, 27), 1)
-   plr:conquer(map:get_field(56, 31), 1)
-   plr:conquer(map:get_field(56, 33), 1)
-   plr:conquer(map:get_field(52, 32), 1)
-
-   -- Build roads
-   -- Start at northern sentry
-   connected_road(plr, map:get_field(58, 10).immovable,
-      "w,sw|se,sw|e,se|se,se|sw,sw|sw,w|sw,sw|se,sw|sw,sw|se,sw|" ..
-      "sw,sw|sw,sw|sw,sw|se,se,sw|e,e|sw,sw|se,sw|")
-
-   connected_road(plr, map:get_field(57, 25).immovable, "sw,w|sw,w")
-   connected_road(plr, map:get_field(57, 29).immovable, "w,w|w,w")
-   connected_road(plr, map:get_field(55, 34).immovable, "sw,sw")
-   connected_road(plr, map:get_field(57, 22).immovable, "sw,w")
-   connected_road(plr, map:get_field(54, 19).immovable, "sw,se,e")
-   connected_road(plr, map:get_field(56, 17).immovable, "sw,se")
-end
+   message_box_objective(plr, msg_mission_complete)
+   plr:reveal_scenario("barbariantut01")
+end
+
 
 run(introduction_thread)
 run(mines_and_food_thread)
 run(build_materials_thread)
 run(story_messages_thread)
-run(village_thread)
+
+include "map:scripting/secret_village.lua" -- starts the thread
 
 run(mission_complete_thread)
+

=== added file 'campaigns/bar01.wmf/scripting/secret_village.lua'
--- campaigns/bar01.wmf/scripting/secret_village.lua	1970-01-01 00:00:00 +0000
+++ campaigns/bar01.wmf/scripting/secret_village.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,159 @@
+-- =======================================================================
+--                            Secret Village Thread
+-- =======================================================================
+
+
+function village_thread()
+   local plr = wl.Game().players[1]
+   while not (plr:seen_field(wl.Game().map:get_field(52,39)) or
+              plr:seen_field(wl.Game().map:get_field(58,10))) do
+         sleep(6534)
+   end
+
+   reveal_village()
+
+   pts = scroll_smoothly_to(wl.Game().map:get_field(55, 25), 3000)
+
+   send_msg(msg_village)
+
+   timed_scroll(array_reverse(pts), 10)
+   sleep(1500)
+end
+
+
+--[[
+   This is a village of poor but friendly people who have settled in a safe
+   valley between two glaciers. They hunt and produce timber and grain but they
+   do not have ores or even stones, so they are dependent on the infrequent
+   merchant that may pass by and provide them with whatever they cannot
+   produce on their own. Their only protection is a guard hut at each entrance
+   to the valley. Therefore they realize that they may have to join a more
+   powerful society for protection in order to stay alive in this world.
+
+   A user that explores the map far from home will discover this village as a
+   bonus. Doing so is not necessary for winning. The village can still be found
+   when the scenario is already won.
+
+   Technically the village is created instantly when the player sees any of the
+   two entrances to the valley. But we place some trees and fields in various
+   stages of growth to make it seem like the village has actually existed for
+   some time. Some land ownership adjustments are made to ensure that the
+   village owns all land between the glaciers.
+--]]
+
+function reveal_village()
+   function force_map_immovables(list)
+      local map = wl.Game().map
+      for idx, id in ipairs(list) do
+         local f = map:get_field(id[2], id[3])
+         if f.immovable then
+            pcall(f.immovable.remove, f.immovable)
+         end
+         map:place_immovable(id[1], f, id[4])
+      end
+   end
+
+   force_map_immovables{
+      { "spruce_summer_old", 55, 19 },
+      { "larch_summer_pole", 58, 19 },
+      { "birch_summer_mature", 58, 20 },
+      { "larch_summer_old", 57, 21 },
+      { "alder_summer_pole", 54, 22 },
+      { "birch_summer_pole", 56, 24 },
+      { "aspen_summer_old", 58, 24 },
+      { "larch_summer_pole", 56, 25 },
+      { "spruce_summer_old", 53, 27 },
+      { "larch_summer_pole", 57, 27 },
+      { "aspen_summer_mature", 52, 29 },
+      { "birch_summer_pole", 54, 30 },
+      { "beech_summer_old", 55, 30 },
+      { "larch_summer_old", 56, 30 },
+      { "field2", 56, 14, "barbarians" },
+      { "field0s",57, 14, "barbarians" },
+      { "field2", 54, 15, "barbarians" },
+      { "field2", 57, 15, "barbarians" },
+      { "field2", 54, 16, "barbarians" },
+      { "field1", 57, 16, "barbarians" },
+      { "field2", 58, 16, "barbarians" },
+      { "field2", 54, 17, "barbarians" },
+      { "field0", 55, 17, "barbarians" },
+      { "field2", 57, 17, "barbarians" },
+      { "field2", 55, 18, "barbarians" },
+      { "field2", 57, 18, "barbarians" },
+      { "field2", 53, 31, "barbarians" },
+      { "field2", 54, 31, "barbarians" },
+      { "field0", 55, 31, "barbarians" },
+      { "field2", 56, 32, "barbarians" },
+      { "field2", 52, 33, "barbarians" },
+      { "field0s",55, 33, "barbarians" },
+      { "field2", 56, 33, "barbarians" },
+      { "field2", 53, 34, "barbarians" },
+      { "field1", 54, 34, "barbarians" },
+      { "field2", 56, 34, "barbarians" },
+      { "field2", 53, 35, "barbarians" },
+      { "field2", 55, 35, "barbarians" },
+   }
+
+   local plr = wl.Game().players[1]
+   prefilled_buildings(plr,
+      {"sentry", 57, 9},
+      {"sentry", 52, 39},
+      {"hunters_hut", 56, 10},
+      {"gamekeepers_hut", 56, 12},
+      {"farm", 56, 16},
+      {"well", 54, 18},
+      {"bakery", 55, 20, wares = {wheat=6, water=6}},
+      {"lumberjacks_hut", 56, 21},
+      {"lumberjacks_hut", 55, 22},
+      {"lumberjacks_hut", 54, 24},
+      {"rangers_hut", 57, 24},
+      {"rangers_hut", 55, 25},
+      {"hardener", 54, 26, wares = {log = 8}},
+      -- to make it more realistic
+      {"warehouse", 53, 28,
+         wares = {
+            wheat = 20,
+            log = 40,
+            meat = 30
+         }
+      },
+      {"inn", 55, 28, wares = {pittabread = 4, meat = 4}},
+      {"tavern", 57, 28, wares = {pittabread=4, meat = 4}},
+      {"well", 52, 30},
+      {"farm", 54, 33},
+      {"bakery", 51, 35, wares = {wheat = 6, water = 6}},
+      {"well", 52, 37}
+   )
+
+   -- Adjust the borders so that the village owns everything green
+   local map = wl.Game().map
+   plr:conquer(map:get_field(59, 16), 2)
+   plr:conquer(map:get_field(57, 18), 2)
+   plr:conquer(map:get_field(58, 19), 1)
+   plr:conquer(map:get_field(58, 20), 1)
+   plr:conquer(map:get_field(54, 15), 1)
+   plr:conquer(map:get_field(54, 16), 1)
+   plr:conquer(map:get_field(54, 20), 1)
+   plr:conquer(map:get_field(54, 22), 1)
+   plr:conquer(map:get_field(57, 23), 1)
+   plr:conquer(map:get_field(58, 24), 1)
+   plr:conquer(map:get_field(57, 27), 1)
+   plr:conquer(map:get_field(56, 31), 1)
+   plr:conquer(map:get_field(56, 33), 1)
+   plr:conquer(map:get_field(52, 32), 1)
+
+   -- Build roads
+   -- Start at northern sentry
+   connected_road(plr, map:get_field(58, 10).immovable,
+      "w,sw|se,sw|e,se|se,se|sw,sw|sw,w|sw,sw|se,sw|sw,sw|se,sw|" ..
+      "sw,sw|sw,sw|sw,sw|se,se,sw|e,e|sw,sw|se,sw|")
+
+   connected_road(plr, map:get_field(57, 25).immovable, "sw,w|sw,w")
+   connected_road(plr, map:get_field(57, 29).immovable, "w,w|w,w")
+   connected_road(plr, map:get_field(55, 34).immovable, "sw,sw")
+   connected_road(plr, map:get_field(57, 22).immovable, "sw,w")
+   connected_road(plr, map:get_field(54, 19).immovable, "sw,se,e")
+   connected_road(plr, map:get_field(56, 17).immovable, "sw,se")
+end
+
+run(village_thread)

=== modified file 'campaigns/bar01.wmf/scripting/starting_conditions.lua'
--- campaigns/t02.wmf/scripting/starting_conditions.lua	2014-08-26 17:25:00 +0000
+++ campaigns/bar01.wmf/scripting/starting_conditions.lua	2014-10-17 09:40:17 +0000
@@ -1,31 +1,27 @@
 -- =======================================================================
---                            Starting conditions                           
+--                            Starting conditions
 -- =======================================================================
 
 -- Allow some buildings
 plr:forbid_buildings("all")
 plr:allow_buildings{
    "lumberjacks_hut",
-   "quarry", 
-   "rangers_hut", 
-   "sentry",
-   "barrier"
+   "quarry",
+   "rangers_hut"
 }
 
--- Place hq and fill it with wares
-hq_pos = wl.Game().map:get_field(12,10)
-hq = plr:place_building("headquarters_interim", hq_pos, false, true)
+-- Place headquarters and fill it with wares
+hq = plr:place_building("headquarters_interim", sf, false, true)
 hq:set_wares{
    ax=6,
    bread_paddle=2,
    blackwood=32,
-   coal=12,
+   coal=5,
    fire_tongs=2,
    fish=6,
-   grout=12,
+   grout=4,
    hammer=12,
    hunting_spear=2,
-   iron=12,
    ironore=5,
    kitchen_tools=4,
    meal=4,
@@ -52,23 +48,20 @@
    ["lime-burner"]=1,
    lumberjack=3,
    miner=4,
-   ranger=1,
+   ranger=2,
    stonemason=2
 }
 hq:set_soldiers({0,0,0,0}, 45)
 
 -- ============
--- Build roads 
+-- Build roads
 -- ============
-connected_road(plr, hq_pos.brn.immovable, "r,r|br,r|r,r")
-connected_road(plr, hq_pos.brn.immovable, "l,l|l,bl,bl|br,r|br,r|r,tr|tr,tr,tr")
+connected_road(plr,sf.brn.immovable, "r,r|br,r")
+connected_road(plr, sf.brn.immovable, "l,l|l,bl,bl|br,r|br,r|r,tr|tr,tr,tr")
 
--- Place some buildings from the last map
+-- Place some initial buildings
 prefilled_buildings(plr,
    {"lumberjacks_hut", 15, 11},
-   {"lumberjacks_hut", 12, 13},
-   {"quarry", 8, 12},
-   {"rangers_hut", 9, 13}
-) 
-
-
+   {"lumberjacks_hut", 9, 13},
+   {"quarry", 8, 12}
+)

=== renamed file 'campaigns/t02.wmf/scripting/mission_thread_texts.lua' => 'campaigns/bar01.wmf/scripting/texts.lua'
--- campaigns/t02.wmf/scripting/mission_thread_texts.lua	2014-08-26 17:25:00 +0000
+++ campaigns/bar01.wmf/scripting/texts.lua	2014-10-17 09:40:17 +0000
@@ -18,69 +18,85 @@
 -- =======================================================================
 --                                OBJECTIVES
 -- =======================================================================
+obj_build_rangers = {
+   name = "mission rangers",
+   title = _"Build two ranger's huts",
+   number = 1,
+   body = objective_text(_"Build two ranger's huts",
+      listitem_bullet(_"Build a ranger's hut next to each lumberjack's hut.") ..
+      listitem_arrow(_"Naturally, trees only grow at a slow rate. To make sure you have enough logs, you have to build rangers.")
+   )
+}
+
 obj_claim_northeastern_rocks = {
    name = "mission quarry",
-   title =_"Expand north-east and build a quarry",
+   title = _"Expand north-east and build a quarry",
    number = 1,
-   body = objective_text(_"Expand north-east to the stones", 
+   body = objective_text(_"Expand north-east to the rocks",
       listitem_bullet(_"Build military buildings (like sentries or barriers) to expand your territory.") ..
       listitem_bullet(_"Get to the rocks north-east from you and build a quarry there.")
    ),
 }
 
 obj_build_mines = {
-   name="mission mines",
-   title=_"Start building mines on the mountain",
+   name = "mission mines",
+   title = _"Start building mines on the mountain",
    number = 2,
-   body= objective_text(_"Build coal and iron ore mines",
+   body = objective_text(_"Build coal and iron ore mines",
       listitem_bullet(_"Build a coal mine and an iron ore mine.") ..
       listitem_arrow(_"To do so, place a flag up on the mountain’s flank to the east (on mountain terrain though, not mountain meadow). When you click on the new flag, you can send geologists there. Because the flag is on a mountain, the geologists will search for ores; otherwise, they would search for water. Then build a mine for both kinds of resources that he will find, choosing the mine to be built appropriately:") ..
-_[[Black – coal]] .. "<br>" ..
-_[[Red – iron ore]] .. "<br>" ..
-_[[Yellow – gold]] .. "<br>" ..
-_[[Grey – granite]] .. paragraphdivider() ..
-_[[Mines can only be built on mountain terrain. Suitable places for mines are displayed as orange mine symbols.]]
+   "</rt>" ..
+   rt("image=tribes/barbarians/resi_coal1/resi_00.png", p(_"a bit of coal")) ..
+   rt("image=tribes/barbarians/resi_coal2/resi_00.png", p(_"a lot of coal")) ..
+   rt("image=tribes/barbarians/resi_iron1/resi_00.png", p(_"a bit of iron")) ..
+   rt("image=tribes/barbarians/resi_iron2/resi_00.png", p(_"a lot of iron")) ..
+   rt("image=tribes/barbarians/resi_gold1/resi_00.png", p(_"a bit of gold")) ..
+   rt("image=tribes/barbarians/resi_gold2/resi_00.png", p(_"a lot of gold")) ..
+   rt("image=tribes/barbarians/resi_granite1/resi_00.png", p(_"a bit of granite")) ..
+   rt("image=tribes/barbarians/resi_granite2/resi_00.png", p(_"a lot of granite")) ..
+   rt("image=tribes/barbarians/resi_water1/resi_00.png", p(_"water")) ..
+   rt("image=tribes/barbarians/resi_none/resi_00.png", p(_"nothing was found here")) ..
+   "<rt>" ..
+      p(_[[Mines can only be built on mountain terrain. Suitable places for mines are displayed as orange mine symbols.]])
    )
 }
 
 obj_basic_food = {
-   name="basic food began",
-   title=_"Provide your miners with food",
+   name = "basic food began",
+   title = _"Provide your miners with food",
    number = 3,
-   body= objective_text(_"Build a hunter, a gamekeeper and a tavern", 
+   body = objective_text(_"Build a hunter, a gamekeeper and a tavern",
       listitem_bullet(_"In order to work, your miners need food.") ..
       listitem_arrow(_"A hunter can hunt down animals, while a gamekeeper prevents them from becoming extinct. The meat is then processed in a tavern into lunches for your miners.") ..
-_([[This is only the first example of a ware which has to be refined before being used in a secondary building]] ..
+      _([[This is only the first example of a ware which has to be refined before being used in a secondary building]] ..
 [[ – others will follow.]])
    )
 }
 
 obj_begin_farming = {
-   name="farming began",
-   title=_"Bake bread",
+   name = "farming began",
+   title = _"Bake bread",
    number = 3,
-   body=objective_text(_ "Build a well, a farm and a bakery", _(
-[[Other ways to produce food – different kinds of food – are fishers and hunters. ]] ..
-[[The wheat of the farms has to be processed with water in a bakery before it becomes edible. ]] ..
-[[You can obtain water by building a well at a spot where your geologists have found a water source.]]
-   ))
+   body = objective_text(_"Build a well, a farm and a bakery",
+      _([[Other ways to produce food – different kinds of food – are fishers and hunters. The wheat of the farms has to be processed with water in a bakery before it becomes edible. You can obtain water by building a well at a spot where your geologists have found a water source.]])
+   )
 }
 
 obj_refine_ores = {
-   name="refining began",
-   title=_"Refine your mined resources",
+   name = "refining began",
+   title = _"Refine your mined resources",
    number = 1,
-   body= objective_text(_ "Build a smelting works", _
-[[The iron ore your miners dig up is not usable yet – it has to be melted into iron first.]]
+   body = objective_text(_"Build a smelting works",
+      _[[The iron ore your miners dig up is not usable yet – it has to be melted into iron first.]]
    )
 }
 
 obj_enhance_buildings = {
-   name="enhance buildings",
-   title=_"Enhance buildings and build a micro brewery",
+   name = "enhance buildings",
+   title = _"Enhance buildings and build a micro brewery",
    number = 3,
-   body= objective_text(_[[Enhance the coal mine and the tavern, and build a micro brewery.]],
-      listitem_bullet(_"Enhance the coal mine and the tavern to the better versions of their buildings respectively.") ..
+   body = objective_text(_[[Enhance a mine and the tavern, and build a micro brewery.]],
+      listitem_bullet(_"Enhance the coal mine or the iron mine to a deep mine, and enhance the tavern to an inn.") ..
       listitem_bullet(_"Also build a micro brewery.") ..
       listitem_arrow(_"A normal mine can only dig up about one third of all the resources lying beneath it; then it must be enhanced to a deep mine in order to keep it working properly. To enhance a building, choose it and then click the appropriate button in the appearing window.")  ..
       listitem_arrow(_"Workers gain experience by successful work. With enough experience, they become more advanced workers, who are necessary to operate the enhanced buildings. Do not enhance a building before you have enough advanced workers to operate the advanced building!") ..
@@ -90,51 +106,51 @@
 }
 
 obj_better_material_1 = {
-   name="built hardener",
-   title=_"Build a wood hardener",
+   name = "build hardener",
+   title = _"Build a wood hardener",
    number = 1,
-   body= objective_text(_ "Build a wood hardener", _(
-[[Bigger and better buildings – including all military ones – require better building materials. ]] ..
-[[They cannot be built out of simple logs – the wood has to be refined to blackwood by a wood hardener first. ]] ..
-[[Always remember to build a wood hardener before you run out of blackwood, as without it you cannot expand.]] ..
+   body = objective_text(_"Build a wood hardener",
+      _([[Bigger and better buildings – including all military ones – require better building materials. They cannot be built out of simple logs – the wood has to be refined to blackwood by a wood hardener first. Always remember to build a wood hardener before you run out of blackwood, as without it you cannot expand.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_"Build a wood hardener")
-   ))
+   )
 }
 
 obj_better_material_2 = {
-   name="mission grindstone",
-   title=_"Build a lime kiln and coal economy",
+   name = "mission grout",
+   title = _"Build a lime kiln and coal economy",
    number = 3,
-   body=objective_text(_"Build a lime kiln, a well and a charcoal kiln, or a coal mine", _(
-[[Better buildings may also require other improved materials besides blackwood. ]] ..
-[[One of these is grout, which is produced out of raw stone, water and coal by a lime-burner.]]) .. paragraphdivider() ..
-_([[You can obtain water by building a well upon a water source, ]] ..
-[[which your geologists can discover when you send them to any flag that is not on a mountain. ]] ..
-[[Coal can be obtained by building a charcoal kiln or a coal mine.]] ..
+   body = objective_text(_"Build a lime kiln, a well and a charcoal kiln, or a coal mine",
+      _([[Better buildings may also require other improved materials besides blackwood. One of these is grout, which is produced out of raw stone, water and coal by a lime-burner.]]) ..
+      paragraphdivider() ..
+      _([[You can obtain water by building a well upon a water source, which your geologists can discover when you send them to any flag that is not on a mountain. ]]) ..
+      paragraphdivider() ..
+      _([[Coal can be obtained by building a charcoal kiln or a coal mine. Burning charcoal out of logs is slow. You should only build a charcoal kiln when no coal is available.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_"Build a lime kiln, a well and a charcoal kiln, or a coal mine")
-   ))
+   )
 }
 
 obj_better_material_3 = {
-   name="mission reed_yard",
-   title=_"Build a reed yard",
+   name = "mission reed_yard",
+   title = _"Build a reed yard",
    number = 1,
-   body= objective_text(_"Build a reed yard", _(
-[[The third material necessary for improved buildings is thatch reed, used to cover roofs. ]] ..
-[[Thatch reed is planted by a gardener around his building, the reed yard.]] ..
+   body = objective_text(_"Build a reed yard",
+      _([[The third material necessary for improved buildings is thatch reed, used to cover roofs. Thatch reed is planted by a gardener around his building, the reed yard.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_"Build a reed yard")
-   ))
+   )
 }
 
 obj_build_cattlefarm = {
    name = "mission cattlefarm",
-   title = _ "Build a cattle farm",
+   title = _"Build a cattle farm",
    number = 1,
-   body = objective_text(_"Build a cattle farm", _(
-[[When roads are under heavy load for a long time, one carrier is usually not enough to transport goods swiftly. ]] ..
-[[Traffic jams are the consequence. Such roads therefore employ a second carrier: ]] ..
-[[An ox that helps to carry the wares. This doubles the transport capacity.]]) .. paragraphdivider() ..
-_[[Oxen are bred in cattle farms out of wheat and water.]] ..
+   body = objective_text(_"Build a cattle farm",
+      _([[When roads are under heavy load for a long time, one carrier is usually not enough to transport goods swiftly. Traffic jams are the consequence. Such roads therefore employ a second carrier: An ox that helps to carry the wares. This doubles the transport capacity.]]) ..
+      paragraphdivider() ..
+      _([[Oxen are bred in cattle farms out of wheat and water.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_"Build a cattle farm")
    )
 }
@@ -143,59 +159,157 @@
 -- =======================================================================
 --                     Texts for the Main Mission Thread
 -- =======================================================================
-briefing_msg_1 = {
-   title =_ "The Story Continues",
+
+briefing_msg_01 = {
+   title = _"The Story Begins",
+   body = thron(_"Thron sighs...",
+      _[[It’s been months, and we are still hiding where the forests are old and dark.]] ..
+      paragraphdivider() ..
+      _[[My warriors hunt at day and lie awake at night – listening to the sounds of the cruel slaughter echoing from afar amongst the ancient trees.]]
+   )
+}
+
+
+briefing_msg_02 = {
+   title = _"The Story Begins",
+   body = thron(
+      _[[We can see the raging flames that swallow Al’thunran from here, miles away.]] ..
+      paragraphdivider() ..
+      _[[The red lights flash in the darkness and dance to the rhythm of the war drums that haunt me even in my nightmares.]]
+   ),
+   field = al_thunran,
+   position = "topleft",
+   scroll_back = true
+}
+
+
+briefing_msg_03 = {
+   title = _"The Story Begins",
+   body = thron(
+      _[[My father’s bones rest peacefully in the ground on which he once ended the senseless spilling of blood that had arisen amongst us. It pains me that his peace only endured for one generation.]] ..
+      paragraphdivider() ..
+      _[[Boldreth, my loyal companion and friend is a source of peace and comfort to me in these dark times. He keeps my spirits high and those of my warriors awake, preventing greed or despair from destroying the bonds between us as well.]]
+   ),
+   field = grave,
+   position = "topleft"
+}
+
+
+briefing_msg_04 = {
+   title = _"The Story Begins",
+   body = thron(
+      _[[As father told me, there are times to fight and times to lie and wait, trying not to fall asleep or die before the right time comes. And so I do... wait.]]
+   )
+}
+
+
+briefing_msg_05 = {
+   title = _"The Story Begins",
    body = thron(_"Thron is shaking his head...",
-_([[The war goes on. More and more of our brothers and sisters flee the brutal war raging ]] ..
-[[in the capital beneath the trees.]]) .. paragraphdivider() ..
-_([[The stories they tell about the deeds of our kin are sad to hear. ]] ..
-[[I’ve spent nights lying awake, restless, more tired than I ever believed one could be. ]] ..
-[[Yet whenever I close my eyes, I see the fortress my father built consumed by flames. ]] ..
-[[The Throne Among the Trees, the symbol of unity and peace among our kin, became the wedge that drives us apart.]])
-   )
-}
-
-briefing_msg_2 = {
-   title =_ "The Story Continues",
-   body = thron(
-_([[Today my hunters brought men, women and little children before me who had hidden out in the forests, ]] ..
-[[trying to escape the war, hate and revenge that rage among the tribes fighting each other like in olden times, ]] ..
-[[when we were no more but wild beasts driven and controlled by instincts. ]] ..
-[[None of my brothers will ever gain and hold control over the wooden throne, ]] ..
-[[none of the tribes will be strong enough to subdue the other. T]] ..
-[[here will be no end to this slaughter, unless... is this it? As father told me?]]) .. paragraphdivider() ..
-_([[To rise against whoever threatens our very existence, even tough it may be one of your own blood or mind?]])
-   )
-}
-
-
-briefing_msg_3 = {
-   title =_ "The Story Continues",
-   body = thron(
-_([[Boldreth seems more and more torn as the days go by. ]] ..
-[[The spirits of my fellows sink as the cold season approaches, and we are still living in no more than huts and barracks. ]] ..
-[[I never intended to stay out here in the wilderness for so long]] ..
-[[ – but I never thought my brothers would engage in this senseless battle for so long either.]]) .. paragraphdivider() ..
-_([[Perhaps it’s time to make ourselves feel a little more at ease here. ]] ..
-[[Perhaps it’s time to give those who still live and think united a new home, ]] ..
-[[replacing what is now lost to us? Until we can return to the place we once called our home...]])
+      _([[Yet the war goes on. More and more of our brothers and sisters flee the brutal war raging in the capital beneath the trees.]]) ..
+      paragraphdivider() ..
+      _([[The stories they tell about the deeds of our kin are sad to hear. I’ve spent nights lying awake, restless, more tired than I ever believed one could be. Yet whenever I close my eyes, I see the fortress my father built consumed by flames. The Throne Among the Trees, the symbol of unity and peace among our kin, became the wedge that drives us apart.]])
+   ),
+   field = sf -- scroll back when showing this and the next few message boxes
+}
+
+
+briefing_msg_06 = {
+   title = _"The Story Begins",
+   body = thron(
+      _([[Today my hunters brought men, women and little children before me who had hidden out in the forests, trying to escape the war, hate and revenge that rage among the tribes fighting each other like in olden times, when we were no more but wild beasts driven and controlled by instincts. None of my brothers will ever gain and hold control over the wooden throne, none of the tribes will be strong enough to subdue the other. There will be no end to this slaughter, unless... is this it? As father told me?]]) ..
+      paragraphdivider() ..
+      _([[To rise against whoever threatens our very existence, even tough it may be one of your own blood or mind?]])
+   )
+}
+
+
+briefing_msg_07 = {
+   title = _"The Story Begins",
+   body = thron(
+      _([[Boldreth seems more and more torn as the days go by. The spirits of my fellows sink as the cold season approaches, and we are still living in no more than huts and barracks. I never intended to stay out here in the wilderness for so long – but I never thought my brothers would engage in this senseless battle for so long either.]]) ..
+      paragraphdivider() ..
+      _([[Perhaps it’s time to make ourselves feel a little more at ease here. Perhaps it’s time to give those who still live and think united a new home, replacing what is now lost to us? Until we can return to the place we once called our home...]])
+   )
+}
+
+
+briefing_msg_08 = {
+   title = _"Somebody Comes up to You",
+   body = khantrukh(_"An old man says...",
+      _[[Hail, chieftain. I am Khantrukh and have seen many winters pass. Please allow me to aid you with my counsel through these darkened days.]] ..
+      paragraphdivider() ..
+      _[[Only the gods know how long we have to remain hidden here. The warriors hope we may march back gloriously any day now, but I strongly doubt that will happen soon. And the days are short and cold...]]
+   )
+}
+
+
+order_msg_ranger = {
+   title = _"The Advisor",
+   body = khantrukh(_"Khantrukh notes...",
+      _[[I see you have already built a quarry and two lumberjack's huts. That is a good beginning if we want to stay here longer.]] ..
+      paragraphdivider() ..
+      _[[But never forget – these forests are our heritage, entrusted upon us by our ancestors. We must always respect and care for them. What we take, we must give back again.]] ..
+      paragraphdivider() ..
+      _[[So, in order to replace the trees we chop down, we should build some ranger’s huts, preferably close to the lumberjack’s huts.]]) ..
+   new_objectives(obj_build_rangers)
+}
+
+
+story_msg1 = {
+   title = _"In the Night",
+   body = thron(_"Thron says...",
+      _[[During another sleepless night, I went up to the hill and gazed towards the north. The fires are still burning, satisfying their hunger upon my father’s legacy.]] ..
+      paragraphdivider() ..
+      _[[They are a constant reminder of why we have to hide here... and why we must return in the end!]]
+   ),
+   field = al_thunran,
+   position = "topleft"
+}
+
+
+story_msg2= {
+   title = _"At the Tomb",
+   body = thron(_"Thron says...",
+      _[[Once again, I went up to my father’s tomb, in a sacred grove at the foot of the great spire of Kal’mavrath. I just stood there and felt neither the hours pass nor the cold rain pouring down from the darkened sky...]] ..
+      paragraphdivider() ..
+      _[[Somehow, it felt like a farewell. For the first time, I wondered what the future might hold for me...]]
+   ),
+   field = grave,
+   position = "topleft"
+}
+
+
+story_msg3 = {
+  title = _"The Other Day",
+  body = thron(_"Thron says thoughtfully...",
+      _[[Some time ago, Boldreth came to me. His advice was to move to a place closer to home – to strike at the first sign of my brothers’ forces wavering.]] ..
+      paragraphdivider() ..
+      _[[But when I look over the forests I can still see black smoke rising to the sky. I know – it is too early yet, and what he hopes for will not happen any time soon. He might still be right, but I fear the bloodshed that returning too fast would cause both on our and the other side...]]
+   )
+}
+
+
+story_msg4 = {
+   title = _"The Oath",
+   body = thron(_"Thron looks furious...",
+      _[[Today, my warriors picked up an old man, wandering sick and wounded through the dark forest. We listened in horror as he told us of the atrocities taking place in Al’thunran.]] ..
+      paragraphdivider() ..
+      _[[I hereby renew my oath – I will stop this madness at any cost!]]
    )
 }
 
 
 order_msg_1 = {
-   title=_"Your Loyal Companion",
+   title = _"Your Loyal Companion",
    body = boldreth(_"Brave Boldreth steps to your side...",
-_([[So you want to prepare us for a longer stay in these forests, Thron? ]] ..
-[[Well, I see the wisdom in doing so, yet my heart is yearning for a glorious return to Al’thunran. ]] ..
-[[Too long have we waited while our brethren have fought on the battlefield, ]] ..
-[[and our axes and swords have turned rusty over time.]])
+_([[So you want to prepare us for a longer stay in these forests, Thron? Well, I see the wisdom in doing so, yet my heart is yearning for a glorious return to Al’thunran. Too long have we waited while our brethren have fought on the battlefield, and our axes and swords have turned rusty over time.]])
    )
 }
 
 
 order_msg_2 = {
-   title =_ "The Advisor",
+   title = _"The Advisor",
    body = khantrukh(_"Khantrukh joins in ...",
 _([[I beg your forgiveness, chieftain, but I have a grave concern to discuss with you. ]] ..
 [[The rocks close to our camp are shrinking fast under our workers’ tools, ]] ..
@@ -204,214 +318,189 @@
 }
 
 order_msg_3 = {
-   title=_"Your Loyal Companion",
-   posx = 0,
-   body = boldreth( _"Boldreth jumps up...",
-_([[While it is certainly no worthy task for a warrior, at least it is something to do! ]] ..
-[[Thron, what would you say about my taking a few of our most restless warriors ]] ..
-[[and venturing somewhat closer to the great mountain of Kal’mavrath]] ..
-[[ – maybe we will find some more big stones to please the old man?]])
-      ) .. new_objectives(obj_claim_northeastern_rocks),
+   title = _"Your Loyal Companion",
+   position = "left",
+   body = boldreth(_"Boldreth jumps up...",
+      _([[While it is certainly no worthy task for a warrior, at least it is something to do! Thron, what would you say about my taking a few of our most restless warriors and venturing somewhat closer to the great mountain of Kal’mavrath – maybe we will find some more big stones to please the old man?]])
+   ) ..
+   new_objectives(obj_claim_northeastern_rocks)
 }
 
 order_msg_4 = {
-   title =_ "The Advisor",
-   posx = 0,
-   body = khantrukh( _"Khantrukh grumbles...", _
-   [[Old man? Disrespectful youth!]]
-   )
+   title = _"The Advisor",
+   position = "left",
+   body = khantrukh(_"Khantrukh grumbles...",
+      _[[Old man? Disrespectful youth!]])
 }
 
 order_msg_5_quarry = {
-   title=_"The Advisor",
-   body= khantrukh( _"Khantrukh nods satisfied...", _
-[[At last! These rocks should last for a while.]]
-   )
+   title = _"The Advisor",
+   body = khantrukh(_"Khantrukh nods satisfied...",
+      _[[At last! These rocks should last for a while.]])
 }
 
 order_msg_6_geologist = {
-   title=_"Your Loyal Companion",
-   body=boldreth(_"Boldreth exclaims...",
-_([[Just look at that! In the east is the great mountain of Kal’mavrath! ]] ..
-[[I wonder what treasures nature might have hidden beneath its majestic flanks!]]) .. paragraphdivider() ..
-_([[Let’s expand to the east. There’s a chance for the elderly to become useful once in a while! ]] ..
-[[Let us send out some of those who understand the stone’s tongue to unravel the mountain’s secrets!]])
-   ) .. new_objectives(obj_build_mines)
+   title = _"Your Loyal Companion",
+   body = boldreth(_"Boldreth exclaims...",
+      _([[Just look at that! In the east is the great mountain of Kal’mavrath! I wonder what treasures nature might have hidden beneath its majestic flanks!]]) ..
+      paragraphdivider() ..
+      _([[Let’s expand to the east. There’s a chance for the elderly to become useful once in a while! Let us send out some of those who understand the stone’s tongue to unravel the mountain’s secrets!]])) ..
+      new_objectives(obj_build_mines)
 }
 
 order_msg_7_mines_up = {
-   title=_"Your Loyal Companion",
-   body=boldreth(_"Boldreth laughs...",
-_([[By Chat’Karuth’s beard, this is amazing! Just imagine what we can use this coal and iron ore for!]]) .. paragraphdivider() ..
-_([[It might even be enough to...]])
-   )
+   title = _"Your Loyal Companion",
+   body = boldreth(_"Boldreth laughs...",
+      _([[By Chat’Karuth’s beard, this is amazing! Just imagine what we can use this coal and iron ore for!]]) ..
+      paragraphdivider() ..
+      _([[It might even be enough to...]]))
 }
 
 order_msg_8_mines_up = {
-   title=_"The Advisor",
-   body =khantrukh(_"Khantrukh interrupts...",
-_([[While this is true, we should consider it later, for now other obstacles are at hand. ]] ..
-[[The miners will definitely demand greater rations for working high up on the mountain in this bitter cold, ]] ..
-[[and providing these supplies may not be easy.]])
-   )
+   title = _"The Advisor",
+   body = khantrukh(_"Khantrukh interrupts...",
+      _([[While this is true, we should consider it later, for now other obstacles are at hand. The miners will definitely demand greater rations for working high up on the mountain in this bitter cold, and providing these supplies may not be easy.]]))
 }
 
 
 order_msg_9_hunter = {
-   title=_"Your Loyal Companion",
-   body=boldreth(_"Boldreth nods...",
-_([[I have to hand it to you: you are right here, old man.]]) .. paragraphdivider() ..
-_([[There seem to be quite a lot of animals in the forests here – we might just hunt down more of them. ]] ..
-[[And, of course, the people would cheer a new tavern – hey, we might call it ‘Thron’s Pride’ or so if you want!]])
-   ) .. new_objectives(obj_basic_food)
+   title = _"Your Loyal Companion",
+   body = boldreth(_"Boldreth nods...",
+      _([[I have to hand it to you: you are right here, old man.]]) ..
+      paragraphdivider() ..
+      _([[There seem to be quite a lot of animals in the forests here – we might just hunt down more of them. And, of course, the people would cheer a new tavern – hey, we might call it ‘Thron’s Pride’ or so if you want!]])) ..
+      new_objectives(obj_basic_food)
 }
 
 order_msg_10_bread = {
-   title=_"The Advisor",
-   body=khantrukh(_"The elder jumps into the air...",
-_([[Wisdom commands to seek variety.]]) .. paragraphdivider() ..
-_([[North of the great mountain is a large plain – why don’t we use the space Mother Nature gave us and build a farm? ]] ..
-[[I sure would enjoy a freshly baked pitta bread for a change...]])
-   ) .. new_objectives(obj_begin_farming)
+   title = _"The Advisor",
+   body = khantrukh(_"The elder jumps into the air...",
+      _([[Wisdom commands to seek variety.]]) ..
+      paragraphdivider() ..
+      _([[North of the great mountain is a large plain – why don’t we use the space Mother Nature gave us and build a farm? I sure would enjoy a freshly baked pitta bread for a change...]])) ..
+      new_objectives(obj_begin_farming)
 }
 
 order_msg_11_basic_food_began = {
-   title=_"Your Loyal Companion",
-   body=boldreth(_"Boldreth cheers up...",
-_([[Our hunters are out in the forests, Thron.]]) .. paragraphdivider() ..
-_([[I promise you, before the sun sets today you will have a magnificent meal fit for the chieftain of all clans!]])
-   )
+   title = _"Your Loyal Companion",
+   body = boldreth(_"Boldreth cheers up...",
+      _([[Our hunters are out in the forests, Thron.]]) ..
+      paragraphdivider() ..
+      _([[I promise you, before the sun sets today you will have a magnificent meal fit for the chieftain of all clans!]]))
 }
 
 order_msg_12_farming_began = {
-   title=_"The Advisor",
-   body=khantrukh(_ "Khantrukh gazes over the plains...",
-_([[Isn’t it lovely, the view of golden fields, growing peacefully, dancing to the wind? ]] ..
-[[And I believe the baker is just on his way here, with his most delicious bread reserved for our chieftain alone!]])
-   )
+   title = _"The Advisor",
+   body = khantrukh(_"Khantrukh gazes over the plains...",
+      _([[Isn’t it lovely, the view of golden fields, growing peacefully, dancing to the wind? And I believe the baker is just on his way here, with his most delicious bread reserved for our chieftain alone!]]))
 }
 
 order_msg_13_tavern = {
-   title=_"A Beautiful Morning",
-   body=thron(_"Thron recognizes...",
-_([[A tavern opened for our people yesterday. While I am hardly in the mood for celebration, ]] ..
-[[I noticed how much this tiny bit of home means to my people. ]] ..
-[[Their songs filled the air until deep in the night, and they were in higher spirits still the day after.]])
-.. paragraphdivider() ..
-_([[Maybe we actually are slowly creating a place here which we can... call home.]])
-   )
+   title = _"A Beautiful Morning",
+   body = thron(_"Thron recognizes...",
+      _([[A tavern opened for our people yesterday. While I am hardly in the mood for celebration, I noticed how much this tiny bit of home means to my people. Their songs filled the air until deep in the night, and they were in higher spirits still the day after.]]) ..
+      paragraphdivider() ..
+      _([[Maybe we actually are slowly creating a place here which we can... call home.]]))
 }
 
 order_msg_14_refine_ore = {
-   title=_ "Your Loyal Companion",
-   body= boldreth(_"Boldreth remarks...",
-_([[So now that we have both the mines and the food to sustain them, ]] ..
-[[we should bring what our brave miners gain for us into a more useful state. ]] ..
-[[The iron ore has to be melted into iron so that it is ready to be forged into whatever we want. ]] ..
-[[And we need the coal to keep the smelter’s ovens burning.]])
-   ) .. new_objectives(obj_refine_ores)
+   title = _"Your Loyal Companion",
+   body = boldreth(_"Boldreth remarks...",
+      _([[So now that we have both the mines and the food to sustain them, we should bring what our brave miners gain for us into a more useful state. The iron ore has to be melted into iron so that it is ready to be forged into whatever we want. And we need the coal to keep the smelter’s ovens burning.]])) ..
+      new_objectives(obj_refine_ores)
 }
 
 order_msg_15_mines_exhausted = {
-   title=_ "The Advisor",
+   title = _"The Advisor",
    body = khantrukh(_"Khantrukh speaks...",
-_([[Our miners are digging up less and less by the day! We have to go deeper, closer to the mountain’s core, ]] ..
-[[if we want more of its treasures!]]) .. paragraphdivider() ..
-_([[Of course, it is dark and cold in such depths and only a few venture voluntarily into these places. ]] ..
-[[We should reward this bravery with greater rations for them. And a pint of beer or two will keep their spirits high.]])
-   ) .. new_objectives(obj_enhance_buildings)
+      _([[Our miners are digging up less and less by the day! We have to go deeper, closer to the mountain’s core, if we want more of its treasures!]]) ..
+      paragraphdivider() ..
+      _([[Of course, it is dark and cold in such depths and only a few venture voluntarily into these places. We should reward this bravery with greater rations for them. And a pint of beer or two will keep their spirits high.]])) ..
+      new_objectives(obj_enhance_buildings)
 }
 
 order_msg_16_blackwood = {
-   title=_"Your Loyal Companion",
-   body= boldreth(_"Boldreth seems concerned...",
-_([[As I just discovered, we are running short on blackwood! We cannot put our warriors into some crumbling huts, ]] ..
-[[and even less so in times as dangerous as ours!]]) .. paragraphdivider() ..
-_([[We need a wood hardener, and we need one now!]])
-   ) .. new_objectives(obj_better_material_1)
-}
-
-order_msg_17_grindstone = {
-   title=_"Your Loyal Companion",
-   body= boldreth(_"Boldreth smiles...",
-_([[Well, old friend, this should ensure that our fortifications do not break down with our foes’ first battle cry! ]] ..
-[[Now we can expand safely!]]) .. paragraphdivider() ..
-_([[Still, it would not hurt to accumulate some grout for our further campaign; ]] ..
-[[thus we could, in times of need, build a fortress such as the world has never seen before!]])
-   ) .. new_objectives(obj_better_material_2)
-}
-
-order_msg_18_reed_yard = {
-   title=_"The Advisor",
-   body= khantrukh(_"Khantrukh steps in...",
-_([[Chieftain, this is a disgrace! ]] ..
-[[It is well that we can produce grout for mighty fortifications and great buildings now]] ..
-[[ – only this does not prevent our roofs from becoming leaky! ]] ..
-[[Maybe the young ones like spending their nights in the rain, ]] ..
-[[but I just can’t find any sleep with these raindrops dripping on my face!]]) .. paragraphdivider() ..
-_([[Now this is a problem we should do something about!]])
-   ) .. new_objectives(obj_better_material_3)
+   title = _"Your Loyal Companion",
+   body = boldreth(_"Boldreth seems concerned...",
+      _([[As I just discovered, we are running short on blackwood! We cannot put our warriors into some crumbling huts, and even less so in times as dangerous as ours!]]) ..
+      paragraphdivider() ..
+      _([[We need a wood hardener, and we need one now!]])) ..
+      new_objectives(obj_better_material_1)
+}
+
+order_msg_17_grout = {
+   title = _"Your Loyal Companion",
+   body = boldreth(_"Boldreth smiles...",
+      _([[Well, old friend, this should ensure that our fortifications do not break down with our foes’ first battle cry! Now we can expand safely!]]) ..
+      paragraphdivider() ..
+      _([[Still, it would not hurt to accumulate some grout for our further campaign; thus we could, in times of need, build a fortress such as the world has never seen before!]])) ..
+      new_objectives(obj_better_material_2)
+}
+
+
+order_msg_18_reed = {
+   title = _"The Advisor",
+   body = khantrukh(_"Khantrukh steps in...",
+      _([[Chieftain, this is a disgrace! It is well that we can produce grout for mighty fortifications and great buildings now – only this does not prevent our roofs from becoming leaky! Maybe the young ones like spending their nights in the rain, but I just can’t find any sleep with these raindrops dripping on my face!]]) ..
+      paragraphdivider() ..
+      _([[Now this is a problem we should do something about!]])) ..
+      new_objectives(obj_better_material_3)
 }
 
 order_msg_19_all_material = {
-   title=_"The Advisor",
-   body=khantrukh(_"Khantrukh seems relieved...",
-_([[Wonderful! Our roofs are not dripping anymore, and we have all the material we need for, ]] ..
-[[well, whichever monumental building we see fit!]])
-   )
+   title = _"The Advisor",
+   body = khantrukh(_"Khantrukh seems relieved...",
+      _([[Wonderful! Our roofs are not dripping anymore, and we have all the material we need for, well, whichever monumental building we see fit!]]))
+}
+
+
+msg_cattlefarm_00 = {
+   title = _"We Need Oxen!",
+   body = khantrukh(_"Khantrukh speaks...",
+      _([[As our realm is getting bigger and bigger, the traffic on the roads is overwhelming. Our poor carriers are no longer able to transport the goods as fast as we need them to. I suggest we give them some support by breeding oxen.]]) ..
+      paragraphdivider() ..
+      _([[They are amazing animals: The ox is as swift as a human being while being much stronger and very frugal: all we need is wheat and water to breed them and they will do their work on the roads loyally and reliably.]])) ..
+      new_objectives(obj_build_cattlefarm)
 }
 
 msg_mission_complete = {
-   title=_"Mission Complete",
-   body= thron(
-_([[The other day Boldreth asked me to accompany him to the new inn. It would cheer me up, he said.]])
-.. paragraphdivider() ..
-_([[When I looked around, I saw faithful faces, trusting that I could guide them through these dark days. ]] ..
-[[Yet before I could speak any words of gratitude or encouragement, one of my warriors ran into the inn. ]] ..
-[[He had been far out in the forest for the past days and I could see how weary he was.]]) .. paragraphdivider() ..
-_([[The news he brought changed everything...]])
-   )..  objective_text(_"Victory",
-   _[[You have completed this mission. You may continue playing if you wish, otherwise move on to the next mission.]]
-   )
-}
-
-msg_cattlefarm_00 = {
-   title = _ "We Need Oxen!",
-   body = khantrukh(_ "Khantrukh speaks...",
-_([[As our realm is getting bigger and bigger, the traffic on the roads is overwhelming. ]] ..
-[[Our poor carriers are no longer able to transport the goods as fast as we need them to. ]] ..
-[[I suggest we give them some support by breeding oxen.]]) .. paragraphdivider() ..
-_([[They are amazing animals: The ox is as swift as a human being while being much stronger and very frugal: ]] ..
-[[all we need is wheat and water to breed them and they will do their work on the roads loyally and reliably.]])
-   ) .. new_objectives(obj_build_cattlefarm)
+   title = _"Mission Complete",
+   body = thron(_"Thron speaks...",
+      _([[The other day Boldreth asked me to accompany him to the new inn. It would cheer me up, he said.]]) ..
+      paragraphdivider() ..
+      _([[When I looked around, I saw faithful faces, trusting that I could guide them through these dark days. Yet before I could speak any words of gratitude or encouragement, one of my warriors ran into the inn. He had been far out in the forest for the past days and I could see how weary he was.]]) ..
+      paragraphdivider() ..
+      _([[The news he brought changed everything...]])) ..
+      objective_text(_"Victory",
+      _[[You have completed this mission. You may continue playing if you wish, otherwise move on to the next mission.]])
 }
 
 msg_story_1 = {
-   title=_"One Full Moon Night",
-   body=thron(_"Thron speaks...",
-_([[One night, when the moon shone brightly, I climbed to the peak of Kal’mavrath.]]) .. paragraphdivider() ..
-_([[When I gazed at the horizon, I still saw crimson lights flicker in the distance. ]] ..
-[[It is incredible with how much passion my brethren fight this war. ]] ..
-[[I fear the moment I will see Al’thunran again]] ..
-[[ – will there be anything but ashes and wasted ruins left of our once beautiful capital when we get there?]])
-   )
+   title = _"One Full Moon Night",
+   body = thron(_"Thron speaks...",
+      _([[One night, when the moon shone brightly, I climbed to the peak of Kal’mavrath.]]) ..
+      paragraphdivider() ..
+      _([[When I gazed at the horizon, I still saw crimson lights flicker in the distance. It is incredible with how much passion my brethren fight this war. I fear the moment I will see Al’thunran again – will there be anything but ashes and wasted ruins left of our once beautiful capital when we get there?]]))
 }
 
 msg_story_2 = {
-    title= _"Another Cold Day",
-    body=thron(_"Thron looks worried...",
-_([[The winter is upon us. Many of us are suffering from the cold, yet we must endure. ]] ..
-[[The day we may return cannot be far anymore – it must not be far anymore.]]) .. paragraphdivider() ..
-_([[I prayed that it might get warmer again, as I prayed that the war would finally come to an end.]])
-.. paragraphdivider() ..
-_([[So far, it seems that neither prayer was fulfilled.]])
-   )
+    title = _"Another Cold Day",
+    body = thron(_"Thron looks worried...",
+      _([[The winter is upon us. Many of us are suffering from the cold, yet we must endure. The day we may return cannot be far anymore – it must not be far anymore.]]) ..
+      paragraphdivider() ..
+      _([[I prayed that it might get warmer again, as I prayed that the war would finally come to an end.]]) ..
+      paragraphdivider() ..
+      _([[So far, it seems that neither prayer was fulfilled.]]))
 }
 
 msg_village = {
-   title=_"A friendly village has joined us!",
-   body= thron(_"Thron speaks...",
-_([[We have found a village with friendly and productive people, impressed by our wealth, technology and strength.]]) .. paragraphdivider() ..
-_([[They have decided to join us!]])
+   title = _"A friendly village has joined us!",
+   body = thron(_"Thron speaks...",
+      _([[We have found a village with friendly and productive people, impressed by our wealth, technology and strength.]]) ..
+      paragraphdivider() ..
+      _([[They have lived simply, yet blithely, from hunting and farming. They have not been involved in any conflict so far, and are not ready for fighting.]]) ..
+      paragraphdivider() ..
+      _([[But they fear that the war around Al'thunran will set an end to this life. Therefore, they have decided to join us, hoping that we can help each other.]])
    )
 }
+

=== renamed directory 'campaigns/t03.wmf' => 'campaigns/bar02.wmf'
=== modified file 'campaigns/bar02.wmf/elemental'
--- campaigns/t03.wmf/elemental	2014-02-25 10:47:47 +0000
+++ campaigns/bar02.wmf/elemental	2014-10-17 09:40:17 +0000
@@ -4,7 +4,7 @@
 map_h="112"
 nr_players="4"
 world="winterland"
-name=_"03 – This Land is Our Land"
-author="Wolfpac & Nasenbaer"
+name=_"02 – This Land is Our Land"
+author="Wolfpac,Nasenbaer"
 descr=_"This tutorial explains the handling of military and training site buildings and will introduce fighting."
-background="tribes/barbarians/pics/campmap-tut3.jpg"
+background="campaigns/bar02.wmf/pics/background.jpg"

=== renamed file 'tribes/barbarians/pics/campmap-tut3.jpg' => 'campaigns/bar02.wmf/pics/background.jpg'
=== modified file 'campaigns/bar02.wmf/scripting/init.lua'
--- campaigns/t03.wmf/scripting/init.lua	2014-03-25 06:18:48 +0000
+++ campaigns/bar02.wmf/scripting/init.lua	2014-10-17 09:40:17 +0000
@@ -1,8 +1,8 @@
 -- =======================================================================
---                       Barbarians Campaign Mission 3
+--                       Barbarians Campaign Mission 2
 -- =======================================================================
 
-set_textdomain("scenario_t03.wmf")
+set_textdomain("scenario_bar02.wmf")
 
 include "scripting/coroutine.lua"
 include "scripting/objective_utils.lua"

=== modified file 'campaigns/cconfig'
--- campaigns/cconfig	2014-02-25 10:47:47 +0000
+++ campaigns/cconfig	2014-10-17 09:40:17 +0000
@@ -22,6 +22,7 @@
 #####
 
 [global]
+# TODO(codereview): Do I have to increase this?
 version = 6
 # Barbarians Introduction
 campname0=_"Barbarians – The Second Empire"
@@ -53,28 +54,24 @@
 # Naming MUST be the name of the campaign-section + "??" where ?? is an increasing number.
 #
 # name      = name of the map.
+# TODO(codereview): Is this description correct? Does campsect1 reveal barbarians01 or does barbarians01 reveal campsect01?
 # * newvisi = the name of a campaign or a scenario that must be visible, to show
 #             this entry as well - this string unhides the map, if the player
-#             completed the requierements with an older cconfig version.
+#             completed the requirements with an older cconfig version.
 # visible   = is this map visible(1), or does it need another map to be played first(0).
 # path      = path to the map.
 #####
 
 [barbariantut00]
-name=_"01 – Eyes in the Dark"
+name=_"01 – A Place to Call Home"
 visible=1
-path="campaigns/t01.wmf"
+path="campaigns/bar01.wmf"
 
 [barbariantut01]
-name=_"02 – A Place to Call Home"
-visible=0
-path="campaigns/t02.wmf"
-
-[barbariantut02]
-name=_"03 – This Land is Our Land"
+name=_"02 – This Land is Our Land"
 newvisi="campsect1"
 visible=0
-path="campaigns/t03.wmf"
+path="campaigns/bar02.wmf"
 
 
 [empiretut00]

=== modified file 'campaigns/emp01.wmf/scripting/mission_thread.lua'
--- campaigns/emp01.wmf/scripting/mission_thread.lua	2010-09-19 11:19:40 +0000
+++ campaigns/emp01.wmf/scripting/mission_thread.lua	2014-10-17 09:40:17 +0000
@@ -1,7 +1,7 @@
 
 function mission_thread()
    sleep(100) -- This is needed for yet unknown reasons
-   
+
    -- Initial messages
    local sea = wl.Game().map:get_field(47,25)
    local pts = scroll_smoothly_to(sea)
@@ -22,7 +22,7 @@
 
 
    sleep(400)
-   
+
    send_msg(saledus_1)
    p1:allow_buildings{"barracks"}
    local o = add_obj(obj_build_barracks)

=== modified file 'campaigns/emp01.wmf/scripting/starting_conditions.lua'
--- campaigns/emp01.wmf/scripting/starting_conditions.lua	2014-08-26 17:25:00 +0000
+++ campaigns/emp01.wmf/scripting/starting_conditions.lua	2014-10-17 09:40:17 +0000
@@ -1,5 +1,5 @@
 -- =======================================================================
---                                 Player 1                                 
+--                                 Player 1
 -- =======================================================================
 p1:forbid_buildings("all")
 

=== modified file 'campaigns/emp01.wmf/scripting/texts.lua'
--- campaigns/emp01.wmf/scripting/texts.lua	2014-07-14 10:45:44 +0000
+++ campaigns/emp01.wmf/scripting/texts.lua	2014-10-17 09:40:17 +0000
@@ -37,8 +37,7 @@
    title=_"Build a lumberjack’s house",
    number = 1,
    body = objective_text(_"Lumberjack’s House",
-      listitem_bullet(_[[Build a lumberjack’s house at the red house symbol, south of your provisional headquarters.]]) ..
-      listitem_arrow(_[[Cutting down enough trees for more buildings will take a while. You can speed the game up by using PAGE UP and slow it down again with PAGE DOWN.]])
+      listitem_bullet(_[[Build a lumberjack’s house at the red house symbol, south of your provisional headquarters.]])
    ),
 }
 

=== modified file 'campaigns/emp02.wmf/scripting/mission_thread.lua'
--- campaigns/emp02.wmf/scripting/mission_thread.lua	2014-08-26 17:25:00 +0000
+++ campaigns/emp02.wmf/scripting/mission_thread.lua	2014-10-17 09:40:17 +0000
@@ -1,5 +1,5 @@
 -- =======================================================================
---                              Mission Threads                             
+--                              Mission Threads
 -- =======================================================================
 function building_materials()
    sleep(200)
@@ -10,7 +10,7 @@
    p1:reveal_fields(forests:region(6))
    -- Hide again in 5 seconds
    run(function() sleep(5000) p1:hide_fields(forests:region(6)) end)
-   
+
    -- Show the trees
    scroll_smoothly_to(forests)
 
@@ -57,7 +57,7 @@
       if s > 0 then break end
       sleep(2344)
    end
-   
+
    send_msg(amalea_1)
    p1:allow_buildings{
       "well",
@@ -76,7 +76,7 @@
    local o = add_obj(obj_build_Food_infrastructure)
 
    -- Run easter egg: Amalea says something when Tavern is done
-   run(function() 
+   run(function()
       while #p1:get_buildings("tavern") < 1 do sleep(2349) end
       send_msg(amalea_2)
    end)
@@ -110,7 +110,7 @@
    local iron_mountain = wl.Game().map:get_field(38,37)
    p1:reveal_fields(coal_mountain:region(6))
    p1:reveal_fields(iron_mountain:region(6))
-   run(function() sleep(5000) 
+   run(function() sleep(5000)
       p1:hide_fields(coal_mountain:region(6))
       p1:hide_fields(iron_mountain:region(6))
    end)
@@ -133,7 +133,7 @@
    }
 
    local o = add_obj(obj_build_mining_infrastructure)
-   -- Wait for the infrastructure to come up 
+   -- Wait for the infrastructure to come up
    while true do
       local rv = p1:get_buildings{
          "coalmine",
@@ -180,7 +180,7 @@
    -- sleep while not owning 26, 21
    while wl.Game().map:get_field(26,21).owner ~= p1 do sleep(3243) end
    o.done = true
-   
+
    -- Marble Mountains
    local marblemountains = wl.Game().map:get_field(35,19)
    p1:reveal_fields(marblemountains:region(5))

=== modified file 'campaigns/emp02.wmf/scripting/starting_conditions.lua'
--- campaigns/emp02.wmf/scripting/starting_conditions.lua	2014-08-26 17:25:00 +0000
+++ campaigns/emp02.wmf/scripting/starting_conditions.lua	2014-10-17 09:40:17 +0000
@@ -1,5 +1,5 @@
 -- =======================================================================
---                                 Player 1                                 
+--                                 Player 1
 -- =======================================================================
 p1:forbid_buildings("all")
 p1:allow_buildings{
@@ -8,7 +8,7 @@
    "quarry",
    "sawmill",
 }
-prefilled_buildings(p1, 
+prefilled_buildings(p1,
    {"headquarters", 16, 21,
       wares = {
          helm = 4,
@@ -46,7 +46,7 @@
          wine = 8,
          wood = 45,
          wool = 2,
-      }, 
+      },
       workers = {
          armorsmith = 1,
          brewer = 1,
@@ -68,7 +68,7 @@
 )
 
 -- =======================================================================
---                                 Player 2                                 
+--                                 Player 2
 -- =======================================================================
 p2:forbid_buildings("all")
 p2:allow_buildings{
@@ -89,7 +89,7 @@
 }
 
 prefilled_buildings(p2,
-   {"headquarters", 60, 65, 
+   {"headquarters", 60, 65,
    wares = {
       ax = 6,
       bread_paddle = 2,

=== removed directory 'campaigns/t01.wmf'
=== removed directory 'campaigns/t01.wmf/binary'
=== removed file 'campaigns/t01.wmf/binary/bob'
Binary files campaigns/t01.wmf/binary/bob	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/bob	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/binary/building'
Binary files campaigns/t01.wmf/binary/building	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/building	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/binary/flag'
Binary files campaigns/t01.wmf/binary/flag	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/flag	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/binary/heights'
Binary files campaigns/t01.wmf/binary/heights	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/heights	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/binary/mapobjects'
Binary files campaigns/t01.wmf/binary/mapobjects	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/mapobjects	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/binary/owned_fields'
Binary files campaigns/t01.wmf/binary/owned_fields	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/owned_fields	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/binary/resource'
Binary files campaigns/t01.wmf/binary/resource	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/resource	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/binary/road'
Binary files campaigns/t01.wmf/binary/road	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/road	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/binary/seen_fields'
Binary files campaigns/t01.wmf/binary/seen_fields	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/seen_fields	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/binary/terrain'
Binary files campaigns/t01.wmf/binary/terrain	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/binary/terrain	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/elemental'
--- campaigns/t01.wmf/elemental	2014-10-04 18:23:52 +0000
+++ campaigns/t01.wmf/elemental	1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
-[global]
-packet_version=1
-map_w=64
-map_h=64
-nr_players=1
-world=greenland
-name=_"01 – Eyes in the Dark"
-author=Winterwind
-descr=_"In this tutorial, the basic gameplay and control as well as basic production buildings of the Barbarians are introduced."
-background="campaigns/t01.wmf/pics/background.jpg"

=== removed file 'campaigns/t01.wmf/extra_data'
--- campaigns/t01.wmf/extra_data	2010-02-03 13:42:07 +0000
+++ campaigns/t01.wmf/extra_data	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-[global]
-packet_version=1

=== removed directory 'campaigns/t01.wmf/pics'
=== removed file 'campaigns/t01.wmf/pics/background.jpg'
Binary files campaigns/t01.wmf/pics/background.jpg	2014-10-04 18:23:52 +0000 and campaigns/t01.wmf/pics/background.jpg	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/pics/chieftain.png'
Binary files campaigns/t01.wmf/pics/chieftain.png	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/pics/chieftain.png	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/pics/khantrukh.png'
Binary files campaigns/t01.wmf/pics/khantrukh.png	2010-02-03 13:42:07 +0000 and campaigns/t01.wmf/pics/khantrukh.png	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/t01.wmf/player_names'
--- campaigns/t01.wmf/player_names	2010-02-03 13:42:07 +0000
+++ campaigns/t01.wmf/player_names	1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-[global]
-packet_version=1
-
-[player_1]
-name=Player 1
-tribe=barbarians

=== removed file 'campaigns/t01.wmf/player_position'
--- campaigns/t01.wmf/player_position	2010-02-03 13:42:07 +0000
+++ campaigns/t01.wmf/player_position	1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-[global]
-packet_version=2
-player_1=12 10

=== removed directory 'campaigns/t01.wmf/scripting'
=== removed file 'campaigns/t01.wmf/scripting/init.lua'
--- campaigns/t01.wmf/scripting/init.lua	2014-03-25 06:18:48 +0000
+++ campaigns/t01.wmf/scripting/init.lua	1970-01-01 00:00:00 +0000
@@ -1,71 +0,0 @@
--- =======================================================================
---                       Barbarians campaign mission 1
--- =======================================================================
-
-set_textdomain("scenario_t01.wmf")
-
--- ===============
--- Initialization
--- ===============
-
-p = wl.Game().players[1]
-
--- Only lumberjack buildings are allowed
-p:forbid_buildings("all")
-p:allow_buildings{"lumberjacks_hut"}
-
--- Place the headquarters & fill it with wares
-hq = p:place_building("headquarters_interim", wl.Game().map:get_field(12,10),
-   false, true)
-hq:set_wares{
-   log = 80
-}
-hq:set_workers{
-   builder=10,
-   carrier=40,
-   lumberjack=3,
-   miner=4,
-   ranger=1,
-   stonemason=2
-}
-
--- ==========
--- Constants
--- ==========
-home = wl.Game().map:get_field(12,10)
-al_thunran = wl.Game().map:get_field(53, 43)
-grave = wl.Game().map:get_field(25,22)
-
--- This function can move to a place, display a modal message box and return
-function show_story_box(t, m, pos, gposx, gposy)
-   plr = wl.Game().players[1]
-   posx = gposx
-   posy = gposy
-   local pts = nil
-   if pos ~= nil then
-      plr:reveal_fields(pos:region(8))
-      pts = scroll_smoothly_to(pos)
-
-      posx = gposx or 0
-      posy = gposy or 80
-   end
-   plr:message_box(t, m, { posx = posx, posy = posy, h = 400 })
-   if pts then
-      timed_scroll(array_reverse(pts))
-   end
-   sleep(500)
-end
-
--- Add an objective
-function add_obj(objective, player)
-   return player:add_objective(objective.name, objective.title, objective.body)
-end
-
-include "scripting/coroutine.lua"
-include "scripting/ui.lua"
-include "scripting/table.lua"
-
-include "map:scripting/texts.lua"
-
-include "map:scripting/initial_messages.lua"
-include "map:scripting/story_messages.lua"

=== removed file 'campaigns/t01.wmf/scripting/initial_messages.lua'
--- campaigns/t01.wmf/scripting/initial_messages.lua	2014-04-03 12:46:12 +0000
+++ campaigns/t01.wmf/scripting/initial_messages.lua	1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
--- ===============================
--- Send a bunch of story messages
--- ===============================
-
-include "scripting/formatting.lua"
-include "scripting/format_scenario.lua"
-
-function thron(title, text)
-   return speech("map:chieftain.png", "2F9131", title, text)
-end
-
-
-function briefing_messages()
--- Briefing message
-title = _"The Story Begins"
-msg = thron(_"Thron sighs...",
-_[[It’s been months, and we are still hiding where the forests are old and dark.]] .. paragraphdivider() ..
-_[[My warriors hunt at day and lie awake at night – listening to the sounds of the cruel slaughter echoing from afar amongst the ancient trees.]])
-show_story_box(title, msg)
-
-msg =
-thron(
-_[[We can see the raging flames that swallow Al’thunran from here, miles away.]] .. paragraphdivider() ..
-_[[The red lights flash in the darkness and dance to the rhythm of the war drums that haunt me even in my nightmares.]])
-show_story_box(title, msg, al_thunran)
-
-msg = thron(
-_[[My father’s bones rest peacefully in the ground on which he once ended the senseless spilling of blood that had arisen amongst us. It pains me that his peace only endured for one generation.]] .. paragraphdivider() ..
-_[[Boldreth, my loyal companion and friend is a source of peace and comfort to me in these dark times. He keeps my spirits high and those of my warriors awake, preventing greed or despair from destroying the bonds between us as well.]])
-show_story_box(title, msg, grave)
-
-msg = thron(
-_[[As father told me, there are times to fight and times to lie and wait, trying not to fall asleep or die before the right time comes. And so I do... wait.]])
-show_story_box(title, msg)
-sleep(2000)
-
-include "map:scripting/khantrukhs_talking.lua"
-end
-
-
-run(briefing_messages)

=== removed file 'campaigns/t01.wmf/scripting/khantrukhs_talking.lua'
--- campaigns/t01.wmf/scripting/khantrukhs_talking.lua	2014-03-25 06:18:48 +0000
+++ campaigns/t01.wmf/scripting/khantrukhs_talking.lua	1970-01-01 00:00:00 +0000
@@ -1,63 +0,0 @@
--- ======================
--- Messages by Khantrukh
--- ======================
-
-include "map:scripting/texts.lua"
-include "scripting/coroutine.lua"
-include "scripting/objective_utils.lua"
-
-function check_quarries()
-   while not check_for_buildings(p, {quarry = 2},
-      wl.Game().map:get_field(8,13):region(3)) do sleep(5000) end
-   objq.done = true
-end
-
-function check_ranger()
-   while not check_for_buildings(p, {rangers_hut = 1},
-      wl.Game().map:get_field(17,11):region(3)) do sleep(5000) end
-   objr.done = true
-end
-
-function tutorial_thread()
-   p = wl.Game().players[1]
-   show_story_box(_"Somebody Comes up to You", khantrukh_1)
-   show_story_box(_"The Advisor", khantrukh_2, nil, 80, 80)
-   local o = add_obj(start_lumberjack_01, p)
-
-   -- Wait till the hut is build.
-   while not check_for_buildings(p, {constructionsite = 1},
-      wl.Game().map:get_field(15,11):region(2)) do sleep(5000) end
-
-   show_story_box(_"The Advisor", khantrukh_3, nil, 80, 80)
-
-   -- Wait till the hut is build.
-   while not check_for_buildings(p, {lumberjacks_hut = 1},
-      wl.Game().map:get_field(15,11):region(2)) do sleep(5000) end
-   o.done = true
-
-   p:message_box(_"The Advisor", khantrukh_4, { h = 400 })
-   p:message_box(_"The Advisor", khantrukh_5, { h = 400 })
-   local o = add_obj(start_lumberjack_02, p)
-
-   -- Wait till the hut is build.
-   while not check_for_buildings(p, {lumberjacks_hut = 1},
-         wl.Game().map:get_field(12,13):region(2)) do sleep(5000) end
-   o.done = true
-
-   p:message_box(_"The Advisor", khantrukh_6, { h = 400 })
-   p:allow_buildings{"rangers_hut", "quarry"}
-   objq = add_obj(start_quarries, p)
-   objr = add_obj(start_ranger, p)
-   run(check_ranger)
-   run(check_quarries)
-
-   p:message_box(_"The Advisor", khantrukh_7, { h = 400 })
-   while not (objr.done and objq.done) do
-      sleep(5000)
-   end
-
-   p:reveal_scenario("barbariantut01")
-   p:message_box(_"Mission Complete", khantrukh_8, { h = 400 })
-end
-
-run(tutorial_thread)

=== removed file 'campaigns/t01.wmf/scripting/story_messages.lua'
--- campaigns/t01.wmf/scripting/story_messages.lua	2010-03-23 10:28:12 +0000
+++ campaigns/t01.wmf/scripting/story_messages.lua	1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
-
-function story_messages()
-   function _story_box(msg)
-      show_story_box(msg.title, msg.msg, msg.field)
-   end
-
-   wake_me(75 * 1000)
-   _story_box(story_msg1)
-   
-   wake_me(160 * 1000)
-   _story_box(story_msg2)
-   
-   wake_me(260 * 1000)
-   _story_box(story_msg3)
-   
-   wake_me(365 * 1000)
-   _story_box(story_msg4)
-end
-
-run(story_messages)

=== removed file 'campaigns/t01.wmf/scripting/texts.lua'
--- campaigns/t01.wmf/scripting/texts.lua	2014-07-14 10:45:44 +0000
+++ campaigns/t01.wmf/scripting/texts.lua	1970-01-01 00:00:00 +0000
@@ -1,173 +0,0 @@
-include "scripting/formatting.lua"
-include "scripting/format_scenario.lua"
-
-function thron(title, text)
-   return speech("map:chieftain.png", "2F9131", title, text)
-end
-function khantrukh(title, text)
-   return speech("map:khantrukh.png", "8080FF", title, text)
-end
-
--- =======================================================================
---                            Mission objectives
--- =======================================================================
-
-start_lumberjack_01 = {
-   name = "start_lumberjack_01",
-   title = _ "Build a lumberjack’s hut",
-   number = 2,
-   body = objective_text(_"Build a lumberjack’s hut",
-      listitem_bullet(_"Press SPACE to see where you can build. The red house symbols show you where a small building – like a lumberjack’s hut – may be built.") ..
-      listitem_bullet(_"Build a lumberjack’s hut at the red house symbol just right of your headquarters by clicking on it and selecting a lumberjack’s hut.") ..
-      listitem_bullet(_"Build a road between your headquarters and the construction site of the lumberjack’s hut.") ..
-      listitem_arrow(_"When you place the lumberjack’s hut, a flag is created for it. You need to connect it to another flag by building a road between them. If you click on a flag and select to build a road, little symbols will appear around it to show you in which directions you can build it.") ..
-      listitem_arrow(_"The colors of these symbols indicate how steep this part of the road will be. Green is for flat, yellow means steep and red stands for very steep. The steeper the road is, the harder it will be for your people to walk on it (and your wares will be transported more slowly).") ..
-      listitem_arrow(_"You can click on any of the symbols to build the first part of the road there. New symbols will appear to show you where the next part of the road can go, and so on. However, you can also click farther away from the flag to build several steps at once. Click on the flag at the headquarters to finish the road.")
-   ),
-}
-
-start_lumberjack_01_01 = {
-   name = "start_lumberjack_01_01",
-   title = _ "Build a lumberjack’s hut",
-   number = 1,
-   body = objective_text(_"Build a lumberjack’s hut",
-      listitem_bullet(_"Press SPACE to see where you can build. The red house symbols show you where a small building – like a lumberjack’s hut – may be built.") ..
-      listitem_bullet(_"Build a lumberjack’s hut at the red house symbol just right of your headquarters by clicking on it and selecting a lumberjack’s hut.")
-   ),
-}
-
-start_lumberjack_01_02 = {
-   name = "start_lumberjack_01_02",
-   title = _ "Build a road to the lumberjack’s hut",
-   number = 1,
-   body = objective_text(_"Road to the lumberjack’ hut",
-      listitem_bullet(_"Build a road between your headquarters and the construction site of the lumberjack’s hut.") ..
-      listitem_arrow(_"When you place the lumberjack’s hut, a flag is created for it. You need to connect it to another flag by building a road between them. If you click on a flag and select to build a road, little symbols will appear around it to show you in which directions you can build it.") ..
-      listitem_arrow(_"The colors of these symbols indicate how steep this part of the road will be. Green is for flat, yellow means steep and red stands for very steep. The steeper the road is, the harder it will be for your people to walk on it (and your wares will be transported more slowly).") ..
-      listitem_arrow(_"You can click on any of the symbols to build the first part of the road there. New symbols will appear to show you where the next part of the road can go, and so on. However, you can also click farther away from the flag to build several steps at once. Click on the flag at the headquarters to finish the road.")
-   ),
-}
-
-start_lumberjack_02 = {
-   name = "start_lumberjack_02",
-   title = _ "Build a second lumberjack’s hut",
-   number = 2,
-   body = objective_text(_"Build a second lumberjack’s hut",
-      listitem_bullet(_"Place a flag in the middle of the road. There is a flag symbol in the middle of the road you just built. You create a flag there by clicking on the symbol and then choosing the flag button in the menu that opens up. This will divide the road the wood is transported into two parts with one carrier each.") ..
-      listitem_bullet(_"Place a lumberjack’s hut just south of the flag you just placed on the road. Connect the flag you just raised with the flag of the new lumberjack’s hut construction site afterwards. Note that instead of building a road step by step, you may also click directly at its destination to build the entire road at once.") ..
-      listitem_arrow(_"When many wares are being transported between two points, additional flags in between make them arrive at their destination faster, thus improving your infrastructure.")
-   ),
-}
-
-start_lumberjack_02_01 = {
-   name = "start_lumberjack_02_01",
-   title = _ "Build a second lumberjack’s hut",
-   number = 1,
-   body = objective_text(_"Build a second lumberjack’s hut",
-      listitem_bullet(_"Place a flag in the middle of the road. There is a flag symbol in the middle of the road you just built. You create a flag there by clicking on the symbol and then choosing the flag button in the menu that opens up. This will divide the road the wood is transported into two parts with one carrier each.") ..
-      listitem_arrow(_"When many wares are being transported between two points, additional flags in between make them arrive at their destination faster, thus improving your infrastructure.")
-   ),
-}
-
-start_lumberjack_02_02 = {
-   name = "start_lumberjack_02_02",
-   title = _ "Build a second lumberjack’s hut",
-   number = 1,
-   body = objective_text(_"Build a second lumberjack’s hut",
-      listitem_bullet(_"Place a lumberjack’s hut just south of the flag you just placed on the road. Connect the flag you just raised with the flag of the new lumberjack’s hut construction site afterwards. Note that instead of building a road step by step, you may also click directly at its destination to build the entire road at once.")
-   ),
-}
-
-start_ranger = {
-   name = "start_ranger",
-   title = _ "Build a ranger’s hut",
-   number = 1,
-   body = objective_text(_"Build a ranger’s hut",
-      listitem_bullet(_"Build a ranger’s hut to the east of the first lumberjack’s hut.")
-   ),
-}
-
-start_quarries = {
-   name = "start_quarries",
-   title = _ "Build two quarries",
-   number = 1,
-   body = objective_text(_"Build two quarries",
-      listitem_bullet(_"Build two quarries south-west of your headquarters.")
-   ),
-}
-
--- =======================================================================
---                              Kankruth's texts
--- =======================================================================
-
-khantrukh_1= khantrukh(_"An old man says...",
-_[[Hail, chieftain. I am Khantrukh and have seen many winters pass. Please allow me to aid you with my counsel through these darkened days.]])
-
-khantrukh_2= khantrukh(_"Khantrukh continues...",
-_[[Only the gods know how long we have to remain hidden here. The warriors hope we may march back gloriously any day now, but I strongly doubt that will happen soon. And the days are already getting shorter and colder...]] .. paragraphdivider() ..
-_[[We should prepare, in case we have to face the winter in these harsh lands. I believe to the east of our campsite are a few places where we could raise a lumberjack’s hut.]])
-.. new_objectives(start_lumberjack_01_01)
-
-khantrukh_3 = khantrukh(_"The elder remarks...",
-_[[Obviously, it would be too exhausting for our people to walk all the way to the lumberjack’s hut through the wilderness. We will have to build a road between our hall and the lumberjack’s hut. It’s not a hard guess that the men would appreciate a way as short and plain as possible – the wood will surely be heavy enough, nevertheless.]])
-.. new_objectives(start_lumberjack_01_02)
-
-khantrukh_4 = khantrukh(_"Khantrukh remembers...",
-_[[There is an old saying:]] .. paragraphdivider() ..
-_[[‘A burden divided is easier to endure.’]] .. paragraphdivider() ..
-_[[A crossroads on the road between our headquarters and the lumberjack’s hut would ease the work of our carriers.]])
-.. new_objectives(start_lumberjack_02_01)
-
-khantrukh_5 = khantrukh(_"The old man looks to the sky...",
-_[[The northern winds tell us that the coming winter will be a long and cruel one. One lumberjack’s hut will not be enough to serve the needs of our people. More trees await our axes just south of our new crossroads – let us raise a second lumberjack’s hut there!]])
-.. new_objectives(start_lumberjack_02_02)
-
-khantrukh_6 = khantrukh(_"Khantrukh nods...",
-_[[Of course, if we intended to build a bigger settlement, many more lumberjack’s huts would be advisable, but this should suffice for now.]] .. paragraphdivider() ..
-_[[But never forget – these forests are our heritage, entrusted upon us by our ancestors. We must always respect and care for them. What we take, we must give back again.]] .. paragraphdivider() ..
-_[[So, in order to replace the trees we chop down, we should build a ranger’s hut, preferably close to the lumberjack’s hut.]])
-.. new_objectives(start_ranger)
-
-khantrukh_7 = khantrukh(_"The elder speaks...",
-_[[I am well aware, chieftain, that neither you nor your warriors have the desire to stay in this forsaken place for long. But even so, our war to reconquer our home might take a long time and it would seem wise to make preparations.]]
-.. paragraphdivider() ..
-_[[I would advise that we obtain stones for the future – who knows what fortifications we might be forced to build very soon. And – like a gift of destiny – there are indeed great rocks just nearby...]])
-.. new_objectives(start_quarries)
-
-khantrukh_8 = khantrukh(_[[Very well done, chieftain. We now have all we need to face the winter and may prepare ourselves for the battles ahead.]])
-..  objective_text(_"Victory",
-   _[[You may continue to play this map if you wish. Otherwise, move on to the next mission.]]
-)
-
--- =======================================================================
---                  General story texts by the chieftain
--- =======================================================================
-story_msg1 = {
-   title = _"In the Night",
-   msg = thron(_"Thron says...",
-_[[During another sleepless night, I went up to the hill and gazed towards the north. The fires are still burning, satisfying their hunger upon my father’s legacy.]] .. paragraphdivider() ..
-_[[They are a constant reminder of why we have to hide here... and why we must return in the end!]]),
-field = al_thunran,
-}
-
-story_msg2= {
-   title = _"At the Tomb",
-   msg = thron(_"Thron says...",
-_[[Once again, I went up to my father’s tomb, in a sacred grove at the foot of the great spire of Kal’mavrath. I just stood there and felt neither the hours pass nor the cold rain pouring down from the darkened sky...]] .. paragraphdivider() ..
-_[[Somehow, it felt like a farewell. For the first time, I wondered what the future might hold for me...]]),
-field = grave,
-}
-
-story_msg3 = {
-  title=_ "The Other Day",
-  msg = thron(_"Thron says thoughtfully...",
-_[[Some time ago, Boldreth came to me. His advice was to move to a place closer to home – to strike at the first sign of my brothers’ forces wavering.]] .. paragraphdivider() ..
-_[[But when I look over the forests I can still see black smoke rising to the sky. I know – it is too early yet, and what he hopes for will not happen any time soon. He might still be right, but I fear the bloodshed that returning too fast would cause both on our and the other side...]])
-}
-
-story_msg4 = {
-title =_ "The Oath",
-msg = thron(_"Thron looks furious...",
-_[[Today, my warriors picked up an old man, wandering sick and wounded through the dark forest. We listened in horror as he told us of the atrocities taking place in Al’thunran.]] .. paragraphdivider() ..
-_[[I hereby renew my oath – I will stop this madness at any cost!]])
-}

=== removed file 'campaigns/t02.wmf/pics/background.jpg'
Binary files campaigns/t02.wmf/pics/background.jpg	2014-10-04 18:23:52 +0000 and campaigns/t02.wmf/pics/background.jpg	1970-01-01 00:00:00 +0000 differ
=== removed file 'campaigns/tutorial01.wmf/binary/bob'
Binary files campaigns/tutorial01.wmf/binary/bob	2010-04-17 11:18:54 +0000 and campaigns/tutorial01.wmf/binary/bob	1970-01-01 00:00:00 +0000 differ
=== removed directory 'campaigns/tutorial01.wmf/pics'
=== added directory 'maps/Tutorials'
=== renamed directory 'campaigns/tutorial01.wmf' => 'maps/Tutorials/01_Basic_control.wmf'
=== modified file 'maps/Tutorials/01_Basic_control.wmf/binary/building'
Binary files campaigns/tutorial01.wmf/binary/building	2010-04-13 19:19:45 +0000 and maps/Tutorials/01_Basic_control.wmf/binary/building	2014-10-17 09:40:17 +0000 differ
=== modified file 'maps/Tutorials/01_Basic_control.wmf/binary/heights'
Binary files campaigns/tutorial01.wmf/binary/heights	2010-04-27 07:47:43 +0000 and maps/Tutorials/01_Basic_control.wmf/binary/heights	2014-10-17 09:40:17 +0000 differ
=== modified file 'maps/Tutorials/01_Basic_control.wmf/binary/mapobjects'
Binary files campaigns/tutorial01.wmf/binary/mapobjects	2010-04-27 07:47:43 +0000 and maps/Tutorials/01_Basic_control.wmf/binary/mapobjects	2014-10-17 09:40:17 +0000 differ
=== modified file 'maps/Tutorials/01_Basic_control.wmf/binary/resource'
Binary files campaigns/tutorial01.wmf/binary/resource	2010-04-17 11:18:54 +0000 and maps/Tutorials/01_Basic_control.wmf/binary/resource	2014-10-17 09:40:17 +0000 differ
=== modified file 'maps/Tutorials/01_Basic_control.wmf/binary/terrain'
Binary files campaigns/tutorial01.wmf/binary/terrain	2010-04-17 11:18:54 +0000 and maps/Tutorials/01_Basic_control.wmf/binary/terrain	2014-10-17 09:40:17 +0000 differ
=== modified file 'maps/Tutorials/01_Basic_control.wmf/elemental'
--- campaigns/tutorial01.wmf/elemental	2014-10-04 18:23:52 +0000
+++ maps/Tutorials/01_Basic_control.wmf/elemental	2014-10-17 09:40:17 +0000
@@ -1,10 +1,10 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
 [global]
-packet_version=1
-map_w=64
-map_h=64
-nr_players=2
-world=greenland
-name=_"Tutorial 1"
-author="Winterwind, SirVer, Nasenbaer"
-descr=_"Basic Tutorial – a map based on Winterwind’s tutorial 1 for the Barbarians"
-background="campaigns/tutorial01.wmf/pics/background.jpg"
+packet_version="1"
+map_w="64"
+map_h="64"
+nr_players="1"
+name=_"Basic Control"
+author="Winterwind,SirVer,Nasenbaer,wl-zocker"
+descr=_"In this tutorial, you will learn how to navigate in Widelands and how to build buildings and roads."

=== modified file 'maps/Tutorials/01_Basic_control.wmf/extra_data'
--- campaigns/tutorial01.wmf/extra_data	2010-04-13 19:19:45 +0000
+++ maps/Tutorials/01_Basic_control.wmf/extra_data	2014-10-17 09:40:17 +0000
@@ -1,2 +1,4 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
 [global]
-packet_version=1
+packet_version="1"

=== modified file 'maps/Tutorials/01_Basic_control.wmf/player_names'
--- campaigns/tutorial01.wmf/player_names	2011-01-19 19:22:53 +0000
+++ maps/Tutorials/01_Basic_control.wmf/player_names	2014-10-17 09:40:17 +0000
@@ -1,12 +1,10 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
 [global]
-packet_version=1
+packet_version="2"
 
 [player_1]
-name=Player 1
-tribe=barbarians
-
-[player_2]
-name=Sparing Partner
-tribe=empire
-ai="None"
-
+name="Player 1"
+tribe="barbarians"
+ai=
+closeable="false"

=== modified file 'maps/Tutorials/01_Basic_control.wmf/player_position'
--- campaigns/tutorial01.wmf/player_position	2010-04-29 15:48:50 +0000
+++ maps/Tutorials/01_Basic_control.wmf/player_position	2014-10-17 09:40:17 +0000
@@ -1,5 +1,5 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
 [global]
-packet_version=2
-player_1=12 10
-player_2=50 10
-
+packet_version="2"
+player_1="12 10"

=== added file 'maps/Tutorials/01_Basic_control.wmf/scripting/helper_functions.lua'
--- maps/Tutorials/01_Basic_control.wmf/scripting/helper_functions.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/01_Basic_control.wmf/scripting/helper_functions.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,32 @@
+-- =================
+-- Helper functions
+-- =================
+
+-- Remove all rocks in a given environment. This is done
+-- in a loop for a nice optical effect
+function remove_all_rocks(fields, g_sleeptime)
+   local sleeptime = g_sleeptime or 150
+   while #fields > 0 do
+      local idx = math.random(#fields)
+      local f = fields[idx]
+      local remove_field = true
+
+      if f.immovable then
+         local n = f.immovable.descr.name:match("greenland_stones(%d*)")
+         if n then
+            n = tonumber(n)
+            f.immovable:remove()
+            if n > 1 then
+               remove_field = false
+               map:place_immovable("greenland_stones" .. n-1, f)
+            end
+            sleep(sleeptime)
+         end
+      end
+
+      if remove_field then
+         table.remove(fields, idx)
+      end
+   end
+end
+

=== added file 'maps/Tutorials/01_Basic_control.wmf/scripting/helper_functions_demonstration.lua'
--- maps/Tutorials/01_Basic_control.wmf/scripting/helper_functions_demonstration.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/01_Basic_control.wmf/scripting/helper_functions_demonstration.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,156 @@
+-- =====================================================
+-- Helper functions that are only used in this tutorial
+-- =====================================================
+
+-- These are very special functions that simplify demonstrations to the user.
+-- This includes the UserInputDisabler, some functions for mouse movement and
+-- the Sentry Thread, which forbids the player to build stuff he shouldn't.
+
+
+-- A small helper class to disable/enable autosaving and user interaction
+UserInputDisabler = {}
+function UserInputDisabler:new()
+   local rv = {}
+   setmetatable(rv, self)
+   self.__index = self
+
+   rv:establish_blocks()
+
+   return rv
+end
+function UserInputDisabler:establish_blocks()
+   self._ui_state = wl.ui.get_user_input_allowed()
+   self._as_state = wl.Game().allow_saving
+   self._game_speed = wl.Game().desired_speed
+
+   wl.ui.set_user_input_allowed(false)
+   wl.Game().allow_saving = false
+   -- whatever we do, we want it to happen slowly
+   wl.Game().desired_speed = 1000
+end
+function UserInputDisabler:lift_blocks()
+   wl.ui.set_user_input_allowed(self._ui_state)
+   wl.Game().allow_saving = self._as_state
+   wl.Game().desired_speed = self._game_speed
+end
+
+function click_on_field(f, g_T, g_sleeptime)
+   local sleeptime = g_sleeptime or 500
+
+   local blocker = UserInputDisabler:new()
+
+   mouse_smoothly_to(f, g_T)
+   sleep(sleeptime)
+
+   wl.ui.MapView():click(f)
+   sleep(sleeptime)
+
+   blocker:lift_blocks()
+end
+
+function click_on_panel(panel, g_T, g_sleeptime)
+   local sleeptime = g_sleeptime or 500
+
+   local blocker = UserInputDisabler:new()
+
+   sleep(sleeptime)
+   if not panel.active then -- If this is a tab and already on, do nothing
+      mouse_smoothly_to_panel(panel, g_T)
+      sleep(sleeptime)
+      if panel.press then panel:press() sleep(250) end
+      if panel.click then panel:click() end
+      sleep(sleeptime)
+   end
+
+   blocker:lift_blocks()
+end
+
+-- Make sure the user is in road building mode starting from the given flag
+function enter_road_building_mode(flag)
+   local mv = wl.ui.MapView()
+
+   if mv.is_building_road then
+      mv:abort_road_building()
+   end
+
+   mv:start_road_building(flag)
+end
+
+
+-- ==============
+-- Sentry Thread
+-- ==============
+-- This thread makes sure that the player does not build stuff where he
+-- is not supposed to. He gets a message box when he tries and what he built
+-- gets immediately ripped. This thread can be disabled temporarily.
+function _fmt(f) return ("%i_%i"):format(f.x, f.y) end
+function register_immovable_as_allowed(i)
+   for idx, f in ipairs(i.fields) do
+      registered_player_immovables[_fmt(f)] = true
+   end
+
+    -- buildings and constructionsite have a flag
+   if is_building(i) or i.descr.type_name == "constructionsite" then
+      registered_player_immovables[_fmt(i.fields[1].brn)] = true
+   end
+end
+register_immovable_as_allowed(sf.immovable)
+
+-- This function removes the field from the list of allowed immovables. This is
+-- needed when the player destroys a flag, for example.
+function unregister_field(f)
+   if registered_player_immovables[_fmt(f)] then
+      registered_player_immovables[_fmt(f)] = false
+   end
+end
+
+function bad_boy_sentry()
+   while not terminate_bad_boy_sentinel do
+      -- Check all fields.
+      local sent_msg = false
+      for idx,f in ipairs(sf:region(8)) do
+         if f.immovable and f.immovable.owner == plr then
+            if not registered_player_immovables[_fmt(f)] then
+
+               -- Give the callback a chance to veto the deletion. Maybe
+               -- we expect the player to build something at the moment
+               if not immovable_is_legal(f.immovable) then
+                  -- scould the player
+                  if not sent_msg then
+                     message_box_objective(plr, scould_player)
+                     sent_msg = true
+                  end
+
+                  -- Remove the object again
+                  f.immovable:remove()
+
+                  -- Make sure that the user is not building a road at the moment.
+                  wl.ui.MapView():abort_road_building()
+               end
+            end
+         else
+            unregister_field(f)
+         end
+      end
+      sleep(1000)
+   end
+end
+
+-- Allows constructionsites for the given buildings, all others are invalid
+-- as is any other immovable build by the player
+function allow_constructionsite(i, buildings)
+   if i.descr.type_name == "constructionsite" then
+      if not buildings then return i end
+      for idx,n in ipairs(buildings) do
+         if i.building == n then return i end
+      end
+      return false
+   elseif i.descr.type_name == "flag" then
+      local tr = i.fields[1].tln.immovable
+      if tr and tr.descr.type_name == "constructionsite" then
+         return allow_constructionsite(tr, buildings)
+      end
+   end
+
+   return false
+end

=== added file 'maps/Tutorials/01_Basic_control.wmf/scripting/init.lua'
--- maps/Tutorials/01_Basic_control.wmf/scripting/init.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/01_Basic_control.wmf/scripting/init.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,34 @@
+-- =======================================================================
+--                       Tutorial 01: Basic Control
+-- =======================================================================
+
+plr = wl.Game().players[1]
+map = wl.Game().map
+
+set_textdomain("Basic_control.wmf")
+
+include "scripting/coroutine.lua"
+include "scripting/infrastructure.lua"
+include "scripting/messages.lua"
+include "scripting/table.lua"
+include "scripting/ui.lua"
+
+-- Constants
+sf = map.player_slots[1].starting_field
+first_lumberjack_field = map:get_field(16,10)
+first_quarry_field = map:get_field(8,12)
+second_quarry_field = map:get_field(5,10)
+
+-- Global variables
+registered_player_immovables = {}
+terminate_bad_boy_sentinel = false
+immovable_is_legal = function(i) return false end
+
+include "map:scripting/starting_conditions.lua"
+
+include "map:scripting/texts.lua"
+include "map:scripting/helper_functions.lua"
+include "map:scripting/helper_functions_demonstration.lua"
+
+include "map:scripting/mission_thread.lua"
+

=== renamed file 'campaigns/tutorial01.wmf/scripting/init.lua' => 'maps/Tutorials/01_Basic_control.wmf/scripting/mission_thread.lua'
--- campaigns/tutorial01.wmf/scripting/init.lua	2014-07-27 16:17:04 +0000
+++ maps/Tutorials/01_Basic_control.wmf/scripting/mission_thread.lua	2014-10-17 09:40:17 +0000
@@ -1,382 +1,17 @@
--- =======================================================================
---                            Tutorial Mission
--- =======================================================================
-
--- ===============
--- Initialization
--- ===============
-plr = wl.Game().players[1]
-plr:allow_buildings("all")
-
--- A default headquarters
-include "tribes/barbarians/scripting/sc00_headquarters.lua"
-init.func(plr) -- defined in sc00_headquarters
-
-set_textdomain("scenario_tutorial01.wmf")
-
-include "scripting/coroutine.lua"
-include "scripting/infrastructure.lua"
-include "scripting/ui.lua"
-include "scripting/table.lua"
-
--- Constants
-first_lumberjack_field = wl.Game().map:get_field(16,10)
-first_quarry_field = wl.Game().map:get_field(8,12)
-conquer_field = wl.Game().map:get_field(6,18)
-trainings_ground = wl.Game().map:get_field(33,57)
-
--- Global variables
-registered_player_immovables = {}
-terminate_bad_boy_sentinel = false
-illegal_immovable_found = function(i) return false end
-
-include "map:scripting/texts.lua"
-
--- =================
--- Helper functions
--- =================
-
--- A small helper class to disable/enable autosaving and user interaction
-UserInputDisabler = {}
-function UserInputDisabler:new()
-   local rv = {}
-   setmetatable(rv, self)
-   self.__index = self
-
-   rv:establish_blocks()
-
-   return rv
-end
-function UserInputDisabler:establish_blocks()
-   self._ui_state = wl.ui.get_user_input_allowed()
-   local game = wl.Game()
-   self._as_state = game.allow_saving
-
-   wl.ui.set_user_input_allowed(false)
-   wl.Game().allow_saving = false
-end
-function UserInputDisabler:lift_blocks()
-   wl.ui.set_user_input_allowed(self._ui_state)
-   wl.Game().allow_saving = self._as_state
-end
-
-function _try_add_objective(i)
-   -- Add an objective that is defined in the table i to the players objectives.
-   -- Returns the new objective or nil. Does nothing if i does not specify an
-   -- objective.
-   local o = nil
-   if i.obj_name then
-      o = plr:add_objective(i.obj_name, i.obj_title, i.obj_body)
-   end
-   return o
-end
-
-function msg_box(i)
-   wl.Game().desired_speed = 1000
-
-   local blocker = UserInputDisabler:new()
-
-   if i.field then
-      scroll_smoothly_to(i.field.trn.trn.trn.trn)
-
-      i.field = nil -- Otherwise message box jumps back
-   end
-
-   if i.pos == "topleft" then
-      i.posx = 0
-      i.posy = 0
-   elseif i.pos == "topright" then
-      i.posx = 10000
-      i.posy = 0
-   end
-
-   wl.ui.set_user_input_allowed(true)
-   plr:message_box(i.title, i.body, i)
-
-   blocker:lift_blocks()
-
-   local o = _try_add_objective(i)
-
-   sleep(130)
-
-   return o
-end
-
-function send_message(i)
-   plr:send_message(i.title, i.body, i)
-
-   local o = _try_add_objective(i)
-   sleep(130)
-   return o
-end
-
-function click_on_field(f, g_T, g_sleeptime)
-   local sleeptime = g_sleeptime or 500
-
-   local blocker = UserInputDisabler:new()
-
-   mouse_smoothly_to(f, g_T)
-   sleep(sleeptime)
-
-   wl.ui.MapView():click(f)
-   sleep(sleeptime)
-
-   blocker:lift_blocks()
-end
-
-function click_on_panel(panel, g_T, g_sleeptime)
-   local sleeptime = g_sleeptime or 500
-
-   local blocker = UserInputDisabler:new()
-
-   sleep(sleeptime)
-   if not panel.active then -- If this is a tab and already on, do nothing
-      mouse_smoothly_to_panel(panel, g_T)
-      sleep(sleeptime)
-      if panel.press then panel:press() sleep(250) end
-      if panel.click then panel:click() end
-      sleep(sleeptime)
-   end
-
-   blocker:lift_blocks()
-end
-
-function warp_houses(descriptions)
-   local blocker = UserInputDisabler:new()
-
-   for idx, d in ipairs(descriptions) do
-      local name, x, y = d[1], d[2], d[3]
-      mouse_smoothly_to(wl.Game().map:get_field(x, y))
-      sleep(300)
-      prefilled_buildings(plr, d)
-      sleep(300)
-   end
-
-   blocker:lift_blocks()
-end
-
--- Make sure the user is in road building mode starting from the given flag
-function enter_road_building_mode(flag)
-   local mv = wl.ui.MapView()
-
-   if mv.is_building_road then
-      mv:abort_road_building()
-   end
-
-   mv:start_road_building(flag)
-end
-
-function build_road(field, ...)
-   -- Build a road by clicking the UI. A little faster than before
-
-   -- Make sure that there is room for the road: Rip all immovables
-   local cf = field
-   for idx, d in ipairs{...} do
-      if not (d == '|' or d == '.') then
-         if cf.immovable and cf.immovable.owner ~= plr then
-            cf.immovable:remove()
-         end
-         cf = cf[d .. 'n']
-      end
-   end
-
-   mouse_smoothly_to(field, 400, 200)
-
-   local function _start_road(field)
-      wl.ui.MapView():click(field)
-      click_on_panel(
-         wl.ui.MapView().windows.field_action.buttons.build_road, 100, 200
-      )
-   end
-
-   _start_road(field)
-
-   for idx, d in ipairs{...} do
-      if d == '|' or d == '.' then
-         mouse_smoothly_to(field, 400, 200)
-         wl.ui.MapView():click(field)
-         if d == '|' then
-            wl.ui.MapView():click(field)
-            click_on_panel(
-               wl.ui.MapView().windows.field_action.buttons.build_flag, 100, 200
-            )
-            _start_road(field)
-         end
-      else
-         field = field[d .. 'n']
-      end
-   end
-end
-
-function build_eastern_trainings_area(citadel_field)
-   -- Build some infrastructure as another example
-   local blocker = UserInputDisabler:new()
-
-   plr:reveal_fields(citadel_field:region(8))
-   scroll_smoothly_to(wl.Game().map:get_field(21,9))
-   scroll_smoothly_to(citadel_field)
-
-   warp_houses{
-      {"fortress", 31, 63, soldiers = {[{3,5,0,2}] = 8 }},
-      {"warehouse", 33, 57,
-         soldiers = {
-            [{0,0,0,0}] = 1,
-            [{1,0,0,0}] = 1,
-            [{2,0,0,0}] = 1,
-            [{3,0,0,0}] = 1,
-            [{0,1,0,0}] = 1,
-            [{0,2,0,0}] = 1,
-            [{0,3,0,0}] = 1,
-            [{0,4,0,0}] = 1,
-            [{0,5,0,0}] = 1,
-            [{0,0,0,1}] = 1,
-            [{0,0,0,2}] = 1,
-            [{3,5,0,2}] = 30,
-         },
-         workers = {
-            builder = 1
-         },
-         wares = {
-            log = 40,
-            blackwood = 40,
-            cloth = 10,
-            gold = 10,
-            grout = 30,
-            raw_stone = 30,
-            thatchreed = 40,
-         }
-      },
-      {"trainingcamp", 31, 56, soldiers = {} },
-      {"sentry", 28, 57, soldiers = {[{3,5,0,2}] = 2 }},
-      {"sentry", 37, 61, soldiers = {[{3,5,0,2}] = 2 }},
-   }
-   -- Build the roads
-   local map = wl.Game().map
-   build_road(map:get_field(31,57), "bl", "bl", "|", "br", "br", "|",
-      "r", "r", "|", "tr", "tr", "tl", ".")
-   build_road(map:get_field(29,58), "r", "br", ".")
-   build_road(map:get_field(38,62), "l", "l", "|", "l", "bl",
-      "|", "tl", "tl", ".")
-   build_road(map:get_field(32, 0), "tr", "tr", "tr", '.')
-
-   -- Add wares to the trainingssite so that it does something. Also
-   -- add buildwares to the warehouse
-   local ts = map:get_field(31,56).immovable
-   ts:set_wares(ts.valid_wares)
-
-   scroll_smoothly_to(citadel_field)
-
-   blocker:lift_blocks()
-end
-
--- Remove all stones in a given environment. This is done
--- in a loop for a nice optical effect
-function remove_all_stones(fields, g_sleeptime)
-   local sleeptime = g_sleeptime or 150
-   local map = wl.Game().map
-   while #fields > 0 do
-      local idx = math.random(#fields)
-      local f = fields[idx]
-      local remove_field = true
-
-      if f.immovable then
-         local n = f.immovable.descr.name:match("greenland_stones(%d*)")
-         if n then
-            n = tonumber(n)
-            f.immovable:remove()
-            if n > 1 then
-               remove_field = false
-               map:place_immovable("greenland_stones" .. n-1, f)
-            end
-            sleep(sleeptime)
-         end
-      end
-
-      if remove_field then
-         table.remove(fields, idx)
-      end
-   end
-end
-
--- ==============
--- Sentry Thread
--- ==============
--- This thread makes sure that the player does not build stuff where he
--- is not supposed to. He gets a message box when he tries and what he build
--- gets immediately ripped. This thread can be disabled temporarily.
-function _fmt(f) return ("%i_%i"):format(f.x, f.y) end
-function register_immovable_as_allowed(i)
-   for idx, f in ipairs(i.fields) do
-      registered_player_immovables[_fmt(f)] = true
-   end
-
-    -- buildings and constructionsite have a flag
-   if is_building(i) or i.descr.type_name == "constructionsite" then
-      registered_player_immovables[_fmt(i.fields[1].brn)] = true
-   end
-end
-register_immovable_as_allowed(wl.Game().map.player_slots[1].starting_field.immovable)
-
-function bad_boy_sentry()
-   local sf = wl.Game().map.player_slots[1].starting_field
-   while not terminate_bad_boy_sentinel do
-      -- Check all fields.
-      local sent_msg = false
-      for idx,f in ipairs(sf:region(8)) do
-         if f.immovable and f.immovable.owner == plr and
-               not registered_player_immovables[_fmt(f)] then
-
-            -- Give the callback a chance to veto the deletion. Maybe
-            -- we expect the player to build something at the moment
-            if not illegal_immovable_found(f.immovable) then
-               -- scould the player
-               if not sent_msg then
-                  msg_box(scould_player)
-                  sent_msg = true
-               end
-
-               -- Remove the object again
-               f.immovable:remove()
-
-               -- Make sure that the user is not building a road at the moment.
-               wl.ui.MapView():abort_road_building()
-            end
-         end
-      end
-      sleep(1000)
-   end
-end
-
--- Allows constructionsites for the given buildings, all others are invalid
--- as is any other immovable build by the player
-function allow_constructionsite(i, buildings)
-   if i.descr.type_name == "constructionsite" then
-      if not buildings then return i end
-      for idx,n in ipairs(buildings) do
-         if i.building == n then return i end
-      end
-      return false
-   elseif i.descr.type_name == "flag" then
-      local tr = i.fields[1].tln.immovable
-      if tr and tr.descr.type_name == "constructionsite" then
-         return allow_constructionsite(tr, buildings)
-      end
-   end
-
-   return false
-end
-
--- ================
--- Message threads
--- ================
+-- ================
+-- Mission thread
+-- ================
+
 function starting_infos()
+   map:place_immovable("debris00",second_quarry_field)
+   -- so that the player cannot build anything here
+
    sleep(100)
 
-   msg_box(initial_message_01)
+   message_box_objective(plr, initial_message_01)
    sleep(500)
 
-   local o = msg_box(initial_message_02)
-
+   local o = message_box_objective(plr, initial_message_02)
 
    -- Wait for buildhelp to come on
    while not wl.ui.MapView().buildhelp do
@@ -394,71 +29,86 @@
    sleep(100)
 
    -- We take control, everything that we build is legal
-   illegal_immovable_found = function(i) return true end
+   immovable_is_legal = function(i) return true end
 
-   msg_box(lumberjack_message_01)
+   message_box_objective(plr, lumberjack_message_01)
 
    local blocker = UserInputDisabler:new()
+   close_windows()
 
    scroll_smoothly_to(first_lumberjack_field)
    mouse_smoothly_to(first_lumberjack_field)
    sleep(500)
-   msg_box(lumberjack_message_02)
+   message_box_objective(plr, lumberjack_message_02)
    sleep(500)
 
    click_on_field(first_lumberjack_field)
    click_on_panel(wl.ui.MapView().windows.field_action.tabs.small)
    click_on_panel(wl.ui.MapView().windows.field_action.buttons.lumberjacks_hut)
 
-   enter_road_building_mode(first_lumberjack_field.brn.immovable)
-
-   sleep(500)
-   msg_box(lumberjack_message_03)
-   sleep(500)
-
-   click_on_field(wl.Game().map.player_slots[1].starting_field.brn)
-
-   msg_box(lumberjack_message_04)
+   sleep(500)
+
+   if wl.ui.MapView().is_building_road then
+      message_box_objective(plr, lumberjack_message_03a)
+   else
+      enter_road_building_mode(first_lumberjack_field.brn.immovable)
+      message_box_objective(plr, lumberjack_message_03b)
+   end
+   sleep(500)
+
+   click_on_field(map.player_slots[1].starting_field.brn)
+
+   message_box_objective(plr, lumberjack_message_04)
 
    register_immovable_as_allowed(first_lumberjack_field.immovable) -- hut + flag
 
-   local f = wl.Game().map:get_field(14,11)
+   local f = map:get_field(14,11)
    register_immovable_as_allowed(f.immovable) -- road + everything on it
 
-   illegal_immovable_found = function(i) return false end
+   immovable_is_legal = function(i) return false end
 
    blocker:lift_blocks()
 
    sleep(15000)
 
-   local o = msg_box(lumberjack_message_05)
-
-   local blocker = UserInputDisabler:new()
-
-   local f = wl.Game().map:get_field(14,11)
-   scroll_smoothly_to(f)
-   mouse_smoothly_to(f)
-
-   blocker:lift_blocks()
-
-   -- Wait for flag
-   while not (f.immovable and f.immovable.descr.type_name == "flag") do sleep(300) end
-   o.done = true
-
-   sleep(300)
-
-   msg_box(lumberjack_message_06)
+   if not (f.immovable and f.immovable.descr.type_name == "flag") then
+      -- only show this if the user has not already built a flag
+      local o = message_box_objective(plr, lumberjack_message_05)
+
+      local blocker = UserInputDisabler:new()
+      close_windows()
+
+      local f = map:get_field(14,11)
+      scroll_smoothly_to(f)
+      mouse_smoothly_to(f)
+
+      blocker:lift_blocks()
+
+      -- Wait for flag
+      while not (f.immovable and f.immovable.descr.type_name == "flag") do sleep(300) end
+      o.done = true
+
+      sleep(300)
+
+      message_box_objective(plr, lumberjack_message_06)
+   else
+      -- if the flag is already built, show the player a different message box
+      message_box_objective(plr, flag_built)
+   end
+
+   sleep(30*1000) -- let the player experiment a bit with the speed
+   message_box_objective(plr, construction_site_window)
 
    while #plr:get_buildings("lumberjacks_hut") < 1 do sleep(300) end
 
-   msg_box(lumberjack_message_07)
+   message_box_objective(plr, lumberjack_message_07)
 
    learn_to_move()
 end
 
 function learn_to_move()
    -- Teaching the user how to scroll on the map
-   local o = msg_box(inform_about_stones)
+   local o = message_box_objective(plr, inform_about_rocks)
 
    function _wait_for_move()
       local cx = wl.ui.MapView().viewpoint_x
@@ -473,13 +123,22 @@
    o.done = true
    sleep(3000) -- Give the player a chance to try this some more
 
-   o = msg_box(tell_about_right_drag_move)
+   o = message_box_objective(plr, tell_about_right_drag_move)
 
    _wait_for_move()
    o.done = true
    sleep(3000) -- Give the player a chance to try this some more
 
-   msg_box(congratulate_and_on_to_quarry)
+   o = message_box_objective(plr, tell_about_minimap)
+
+   -- Wait until the minimap has been opened and closed again
+   while not wl.ui.MapView().windows.minimap do sleep(100) end
+   while wl.ui.MapView().windows.minimap do sleep(100) end
+
+   o.done = true
+   sleep(500)
+
+   message_box_objective(plr, congratulate_and_on_to_quarry)
 
    build_a_quarry()
 end
@@ -488,22 +147,23 @@
    sleep(200)
 
    -- Teaching how to build a quarry and the nits and knacks of road building.
-   local o = msg_box(order_quarry_recap_how_to_build)
+   local o = message_box_objective(plr, order_quarry_recap_how_to_build)
 
    local cs = nil
-   -- Wait for the constructionsite to come up.
-   illegal_immovable_found = function(i)
-      cs = allow_constructionsite(i, {"quarry"})
-      return cs
+   immovable_is_legal = function(i)
+      -- only allow quarry and flag at this position because the road building below relies on this
+      if (i.fields[1] == first_quarry_field) or (i.fields[1] == first_quarry_field.brn) then
+         cs = allow_constructionsite(i, {"quarry"})
+         return cs
+      else return false end
    end
 
    -- Wait for the constructionsite to be placed
    while not cs do sleep(200) end
+
    o.done = true
    register_immovable_as_allowed(cs)
 
-   enter_road_building_mode(cs.fields[1].brn.immovable)
-
    local function _rip_road()
       for idx,f in ipairs(cs.fields[1].brn:region(2)) do
          if f.immovable and f.immovable.descr.type_name == "road" then
@@ -517,12 +177,20 @@
    end
 
    local blocker = UserInputDisabler:new()
-
-   illegal_immovable_found = function() return true end
-
-   msg_box(talk_about_roadbuilding_00)
+   close_windows()
+
+   immovable_is_legal = function() return true end
+
+   if wl.ui.MapView().is_building_road then
+      message_box_objective(plr, talk_about_roadbuilding_00a)
+   else
+      message_box_objective(plr, talk_about_roadbuilding_00b)
+      click_on_field(cs.fields[1].brn)
+      click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_road, 300)
+      -- show the user how to enter road building mode manually
+   end
+
    -- Showoff one-by-one roadbuilding
-   local map = wl.Game().map
    click_on_field(map:get_field(9,12))
    click_on_field(map:get_field(10,12))
    click_on_field(map:get_field(11,12))
@@ -533,7 +201,7 @@
 
    _rip_road()
 
-   msg_box(talk_about_roadbuilding_01)
+   message_box_objective(plr, talk_about_roadbuilding_01)
    -- Showoff direct roadbuilding
    click_on_field(cs.fields[1].brn)
    click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_road, 300)
@@ -545,34 +213,74 @@
 
    blocker:lift_blocks()
 
-   local o = msg_box(talk_about_roadbuilding_02)
-
-   -- From now on, the player can build whatever he wants
-   terminate_bad_boy_sentinel = true
+   local o = message_box_objective(plr, talk_about_roadbuilding_02)
+
+   -- The player is allowed to build roads and flags at will
+   immovable_is_legal = function(i)
+      if (i.descr.type_name == "flag") or (i.descr.type_name == "road") then
+         register_immovable_as_allowed(i)
+         return true
+      else return false end
+   end
+
+   -- Give the player some time to build the road
+   -- It is not possible to check for the road. See https://bugs.launchpad.net/widelands/+bug/1380286
+   sleep(20*1000)
+
+   second_quarry()
 
    -- Wait a while
-   sleep( 100*1000 )
+   sleep(60*1000)
+   -- When the said bug is fixed, check every 30 seconds if the second quarry is connected. Inform the player if not.
+   -- When that is finally done (and 30 seconds have passed), go on
 
    -- Interludium: talk about census and statistics
    census_and_statistics(cs.fields[1])
 
-   while #plr:get_buildings("quarry") < 1 do sleep(1400) end
+   while #plr:get_buildings("quarry") < 2 do sleep(1400) end
    o.done = true
 
    messages()
 end
 
+function second_quarry()
+   sleep(200)
+
+   local o = message_box_objective(plr, build_second_quarry)
+   second_quarry_field.immovable:remove()
+   -- remove this immovable (debris)
+
+   local cs = nil
+   immovable_is_legal = function(i)
+      if (i.fields[1] == second_quarry_field) or (i.fields[1] == second_quarry_field.brn) then
+         cs = allow_constructionsite(i, {"quarry"})
+         return cs
+      elseif(i.descr.type_name == "flag") or (i.descr.type_name == "road") then
+         register_immovable_as_allowed(i)
+         return true
+      else return false end
+   end
+
+   -- Wait for the constructionsite to be placed
+   while not cs do sleep(200) end
+
+   o.done = true
+   register_immovable_as_allowed(cs)
+end
+
+
 function census_and_statistics(field)
    sleep(15000)
 
    local blocker = UserInputDisabler:new()
+   close_windows()
 
    wl.ui.MapView().census = false
    wl.ui.MapView().statistics = false
 
    wl.ui.MapView():abort_road_building()
 
-   msg_box(census_and_statistics_00)
+   message_box_objective(plr, census_and_statistics_00)
    -- Pick any empty field
    local function _pick_empty_field()
       local reg = field:region(2)
@@ -591,7 +299,7 @@
    click_on_panel(wl.ui.MapView().windows.field_action.tabs.watch)
    click_on_panel(wl.ui.MapView().windows.field_action.buttons.statistics)
 
-   msg_box(census_and_statistics_01)
+   message_box_objective(plr, census_and_statistics_01)
 
    blocker:lift_blocks()
 end
@@ -600,190 +308,80 @@
    -- Teach the player about receiving messages
    sleep(10)
 
-   local o = send_message(teaching_about_messages)
+   send_message(plr, teaching_about_messages.title, teaching_about_messages.body, teaching_about_messages)
+   local o = add_campaign_objective(teaching_about_messages)
 
    while #plr.inbox > 0 do sleep(200) end
    o.done = true
 
    sleep(500)
 
-   local o = msg_box(closing_msg_window_00)
+   local o = message_box_objective(plr, closing_msg_window_00)
 
    -- Wait for messages window to close
    while wl.ui.MapView().windows.messages do sleep(300) end
    o.done = true
 
-   msg_box(closing_msg_window_01)
-
-   -- Remove all stones
-   remove_all_stones(first_quarry_field:region(6))
-
-   -- Wait for message to arrive
-   while #plr.inbox < 1 do sleep(300) end
+   message_box_objective(plr, closing_msg_window_01)
 
    sleep(800)
-   msg_box(conclude_messages)
+
+   destroy_quarries()
+end
+
+function destroy_quarries()
+   sleep(200)
+   -- Remove all rocks
+   remove_all_rocks(first_quarry_field:region(6))
+
+   -- Wait for messages to arrive
+   while #plr.inbox < 2 do sleep(300) end
+
+   local o = message_box_objective(plr, destroy_quarries_message)
+
+   -- From now on, the player can build whatever he wants
+   terminate_bad_boy_sentinel = true
+
+   while #plr:get_buildings("quarry") > 0 do sleep(200) end
+   o.done = true
 
    sleep(3000)
+
    expansion()
 end
 
 function expansion()
-   -- Teach about expanding your territory.
-   sleep(10)
-
-   -- This is not really needed since the stones are already removed, but if
-   -- we're debugging and we start with this function it is most useful to have
-   -- the stones away already
-   remove_all_stones(first_quarry_field:region(6), 20)
-
-   local o = msg_box(introduce_expansion)
-
-   while not conquer_field.owner do sleep(100) end
-   o.done = true
-
-   mining()
-end
-
-function mining()
-   -- Teach about geologist and resources
-   sleep(10)
-
-   msg_box(mining_00)
-
-   local function _find_good_flag_position()
-      fields = conquer_field:region(8)
-      while #fields > 0 do
-         local idx = math.random(#fields)
-         local f = fields[idx]
-
-         if f.terr:match("berg%d+") and f.terd:match("berg%d+") then
-            if pcall(function() plr:place_flag(f) end) then
-               f.immovable:remove()
-               return f
-            end
-         end
-
-         table.remove(fields, idx)
-      end
-   end
-
-   local function _find_nearby_flag()
-      for i=2,8 do
-         for idx, f in ipairs(conquer_field:region(i)) do
-            if f.immovable and f.immovable.descr.type_name == "flag" then
-               return f
-            end
-         end
-      end
-   end
-
-   scroll_smoothly_to(conquer_field)
-
-   local dest = _find_good_flag_position()
-   local start = _find_nearby_flag()
-
-   -- Build a road, call a geologist
-   click_on_field(start)
-   click_on_panel(wl.ui.MapView().windows.field_action.tabs.roads)
-   click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_road)
-   click_on_field(dest)
-   click_on_field(dest) -- second click
-   click_on_panel(wl.ui.MapView().windows.field_action.buttons.build_flag)
-   click_on_field(dest)
-   click_on_panel(wl.ui.MapView().windows.field_action.buttons.geologist)
-
-   sleep(6000)
-
-   msg_box(mining_01)
-
-   local function _wait_for_some_resi(wanted)
-      while 1 do
-         local cnt = 0
-         for idx, f in ipairs(dest:region(6)) do
-            if f.immovable and f.immovable.descr.name:sub(1,4) == "resi" then
-               cnt = cnt + 1
-               if cnt >= wanted then return end
-            end
-         end
-         sleep(500)
-      end
-   end
-   _wait_for_some_resi(8)
-
-   scroll_smoothly_to(dest)
-
-   msg_box(mining_02)
-
-   training()
-end
-
-function training()
-   -- Teach about trainingsites and soldiers
-   sleep(300)
-
-   msg_box(warfare_and_training_00)
-
-   local citadel_field = wl.Game().map:get_field(31, 63)
-
-   build_eastern_trainings_area(citadel_field)
-   sleep(8000)
-
-   msg_box(warfare_and_training_01)
-
-   sleep(5000)
-   scroll_smoothly_to(citadel_field)
-
-   local o = msg_box(enhance_fortress)
-   while not (citadel_field.immovable and
-      citadel_field.immovable.descr.name == "citadel") do sleep(800) end
-   o.done = true
-
-   -- Wait for soldiers to move in
-   local citadel = citadel_field.immovable
-   local break_out = false
-   while not break_out do
-      for k,v in pairs(citadel:get_soldiers("all")) do
-         break_out = true
-         break -- Break out if there is at least one soldier here
-      end
-
+   -- Teach about expanding the territory
+   sleep(10)
+
+   local o = message_box_objective(plr, introduce_expansion)
+
+   -- wait until there are soldiers inside so that the player sees the expansion
+   local soldier_inside = false
+   while not soldier_inside do
+      local military_buildings = array_combine(plr:get_buildings("sentry"), plr:get_buildings("donjon"), plr:get_buildings("barrier"), plr:get_buildings("fortress"), plr:get_buildings("citadel"))
+      for i = 1,#military_buildings do
+         for k,v in pairs(military_buildings[i]:get_soldiers("all")) do
+            soldier_inside = true
+            break
+         end
+      end
       sleep(500)
    end
 
-   -- Create enemy tribe
-   prefilled_buildings(wl.Game().players[2],
-      {"barrier", 25, 6},
-      {"sentry", 29, 16},
-      {"tower", 30, 21},
-      {"headquarters", 30, 27,
-         workers = {
-            carrier = 50,
-         },
-         soldiers = {
-            [{0,0,0,0}] = 15,
-         }
-      }
-   )
-
-   scroll_smoothly_to(citadel_field)
-   local o = msg_box(attack_enemey)
-
-   local plr2 = wl.Game().players[2]
-   while #plr2:get_buildings("headquarters") > 0 or not plr2.defeated do
-      sleep(3000)
-   end
    o.done = true
+   sleep(4000)
+   message_box_objective(plr, military_building_finished)
 
    conclusion()
 end
 
 function conclusion()
+   sleep(10000) -- to give the player time to see his expanded area
+
    -- Conclude the tutorial with final words and information
    -- on how to quit
-
-   sleep(4000)
-   msg_box(conclude_tutorial)
+   message_box_objective(plr, conclude_tutorial)
 
 end
 

=== added file 'maps/Tutorials/01_Basic_control.wmf/scripting/starting_conditions.lua'
--- maps/Tutorials/01_Basic_control.wmf/scripting/starting_conditions.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/01_Basic_control.wmf/scripting/starting_conditions.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,10 @@
+-- ===============
+-- Initialization
+-- ===============
+
+plr:allow_buildings("all")
+
+-- A default headquarters
+include "tribes/barbarians/scripting/sc00_headquarters.lua"
+init.func(plr) -- defined in sc00_headquarters
+

=== modified file 'maps/Tutorials/01_Basic_control.wmf/scripting/texts.lua'
--- campaigns/tutorial01.wmf/scripting/texts.lua	2014-07-21 14:07:27 +0000
+++ maps/Tutorials/01_Basic_control.wmf/scripting/texts.lua	2014-10-17 09:40:17 +0000
@@ -13,150 +13,240 @@
 -- Texts below
 -- =============
 scould_player = {
-   title = _ "Nice And Easy Does It All the Time",
+   title = _"Nice And Easy Does It All the Time",
    body = rt(
       p(_[[I am sorry, but will I have to tear this down again. We might need the space here later on. If I am too slow for you, you might want to play a real game and just find everything out for yourself. Otherwise, please bear with me, I am not the youngest and quickest anymore.]]
       )
-   )
+   ),
+   h = 300,
+   show_instantly = true
 }
 
 initial_message_01 = {
-   title = _ "Welcome to the Widelands Tutorial!",
+   title = _"Welcome to the Widelands Tutorial!",
    body = rt(
       h1(_"Welcome to Widelands!") ..
       p(_[[Widelands is a slow-paced build-up strategy game with an emphasis on construction, not destruction. This tutorial will guide you through the basics of the game.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Dismiss this box by left-clicking on the button below.]])
    ),
+   h = 300,
+   w = 400
 }
 initial_message_02 = {
-   title = _ "Diving In",
-   pos = "topright",
-   field = wl.Game().map.player_slots[1].starting_field,
+   title = _"Diving In",
+   position = "topright",
+   field = sf,
    body = rt(
       h1(_"Let’s dive right in!") ..
       p(_[[There are three different tribes in Widelands: the Barbarians, the Empire and the Atlanteans. All tribes have a different economy, strength and weaknesses, but the general gameplay is the same for all. We will play the barbarians for now.]]) ..
       p(_[[You will usually start the game with one headquarters. This is the big building with the blue flag in front of it. The headquarters is a warehouse that stores wares, workers and soldiers. Some wares are needed for building houses, others for making other wares. Obviously, the wares in the headquarters will not last forever, so you must make sure to replace them. The most important wares in the early game are the basic construction wares: logs and raw stone. Let’s make sure that we do not run out of logs. For this, we need a lumberjack and a hut for him to stay in.]]) ..
       p(_[[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show Building Spaces’. There are two ways you can do this, either by clicking on the ‘Show Building Spaces’ button at the bottom of the screen, which is the fourth one from the left. Or you can use the SPACE key to toggle it.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Left-click the ‘OK’ button to close this box and then try it.]])
    ),
    obj_name = "enable_buildhelp",
-   obj_title = _ "Enable the showing of building spaces",
+   obj_title = _"Enable the showing of building spaces",
    obj_body = rt(
       h1(_"Show Building Spaces") ..
       p(_[[It is easier to understand what type of buildings can be built on which field when the symbols for the building spaces are enabled.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Do so now either by pressing SPACE or by clicking the fourth button from the left at the very bottom of the screen. Right-click on this window and then give it a try.]])
    )
 }
 
 lumberjack_message_01 = {
-   title = _ "Lumberjack’s Spot",
-   pos = "topright",
+   title = _"Lumberjack’s Spot",
+   position = "topright",
    field = first_lumberjack_field,
    body = rt(
       p(_[[There you go. I will explain about all those symbols in a minute. First, let me show you how to make a lumberjack’s hut and how to connect it with a road. There is a sweet spot for a lumberjack right next to those trees. I’ll describe the steps I will take and then ask you to click on the ‘OK’ button for me to demonstrate.]])
-   )
+   ),
+   h = 300,
+   w = 350
 }
 
 lumberjack_message_02 = {
-   title = _ "Building the Lumberjack",
-   pos = "topright",
+   title = _"Building the Lumberjack",
+   position = "topright",
    body = rt(
       p(_[[First, I’ll left-click on the symbol where I want the lumberjack’s hut to be built. A window will appear where I can choose between buildings. Because I’ll click a yellow house symbol – which means that its field can house medium and small buildings – I am presented with all the medium buildings that I can build. The lumberjack’s hut is a small building, so I will go on to select the small buildings tab. Then I’ll choose the lumberjack’s hut.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Click the ‘OK’ button to watch me. I’ll go really slowly: I will click – then select the tab – and finally I’ll choose the building.]])
-   )
+   ),
+   h = 300
 }
 
-lumberjack_message_03 = {
-   title = _ "Building a Connecting Road",
-   pos = "topright",
+lumberjack_message_03a = {
+   title = _"Building a Connecting Road",
+   position = "topright",
    body = rt(
       p(_[[That won’t do yet. I still need to connect the lumberjack’s hut to the rest of my road network. After ordering the construction site, I was automatically put into road building mode, so all I have to do is click on the blue flag in front of my headquarters.]])
-   )
+   ),
+   show_instantly = true,
+   h = 300,
+   w = 350
+}
+
+lumberjack_message_03b = {
+   title = _"Building a Connecting Road",
+   position = "topright",
+   body = rt(
+      p(_[[That won’t do yet. I still need to connect the lumberjack’s hut to the rest of my road network. You have disabled the option "Start building road after placing a flag" (to change that, choose "Options" in the Widelands main menu). Therefore, I have entered the road building mode manually. I will tell you later how to do that. To build the road, all I have to do now is click on the blue flag in front of my headquarters.]])
+   ),
+   show_instantly = true,
+   h = 300,
+   w = 350
 }
 
 lumberjack_message_04 = {
-   title = _ "Waiting for the Lumberjack to Go Up",
-   pos = "topright",
+   title = _"Waiting for the Lumberjack to Go Up",
+   position = "topright",
    body = rt(
       p(_[[Now watch closely while a builder leaves the headquarters and goes to the construction site. Also, a carrier will take position in between the two blue flags and carry wares from one blue flag to the other.]])
-   )
+   ),
+   h = 300,
+   w = 350
 }
 
 lumberjack_message_05 = {
-   title = _ "Placing Another Flag",
-   pos = "topright",
+   title = _"Placing Another Flag",
+   position = "topright",
    body = rt(
       p(_[[Nice how they are working, isn’t it? But the poor carrier has a very long way to go. We can make it easier for him (and more efficient for us) when we place another blue flag on the road.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[You try it this time: click on the yellow flag symbol in between the two blue flags we just placed and then click on the]])
    ) ..
-   rt("image=pics/menu_build_flag.png", p(_ "build flag symbol.")
+   rt("image=pics/menu_build_flag.png", p(_"build flag symbol.")
    ),
+   h = 300,
    obj_name = "build_flag_on_road_to_lumberjack",
-   obj_title = _ "Build a flag to divide the road to the lumberjack",
+   obj_title = _"Build a flag to divide the road to the lumberjack",
    obj_body = rt(
       h1(_"Build a Flag on the Road") ..
       p(_[[The shorter your road segments are, the faster your wares will be transported. You should therefore make sure that your roads have as many flags as possible.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Build a blue flag now in the middle of the road that connects your headquarters to your lumberjack’s hut.]])
    )
 }
 
 lumberjack_message_06 = {
-   title = _ "Waiting For the Hut to be Finished",
-   pos = "topright",
+   title = _"Waiting For the Hut to be Finished",
+   position = "topright",
    body = rt(
       p(_[[Well done! Let’s wait till the hut is finished.]]) ..
       p(_[[If you want things to go faster, simply use the PAGE UP key on your keyboard to increase the game speed. You can use PAGE DOWN to make the game slower again.]])
-   )
+   ),
+   h = 300,
+   w = 350
+}
+
+flag_built = {
+   title = _"Waiting for the Hut to be Finished",
+   position = "topright",
+   body = rt(
+      p(_[[I wanted to teach you how to build new flags, but it seems you have already found out on your own. Well done!]]) ..
+      p(_[[Now you have split the road in two parts with a carrier each. This means less work for him and a higher efficiency for us. You should therefore always place as many flags as possible on your roads.]]) ..
+      p(_[[Now we only have to wait till the hut is finished.]]) ..
+      p(_[[If you want things to go faster, simply use the PAGE UP key on your keyboard to increase the game speed. You can use PAGE DOWN to make the game slower again.]])
+   ),
+   h = 350
+}
+
+construction_site_window = {
+   title = _"The Construction Site",
+   body = rt(
+      h1(_"Let's see the progress") ..
+      p(_[[If you click on the construction site, a window opens. You can see the wares that are still missing greyed out. You can also see the progress of this construction site.]]) ..
+      -- The player doesn't know about the statistics yet. First things first.
+      p(_[[To close the window, simply right-click on it. All windows in Widelands can be closed that way, except the ones with instructions, like this one. Try it out!]])
+   ),
+   h = 300,
+   w = 350
 }
 
 lumberjack_message_07 = {
-   title = _ "Lumberjack is Done",
-   pos = "topright",
+   title = _"Lumberjack is Done",
+   position = "topright",
    body = rt(
-      p(_[[Excellent. The lumberjack’s hut is done. A lumberjack will now move in and start chopping down trees, so our logs income is secured for now. Now on to the raw stone.]])
-   )
+      p(_[[Excellent. The lumberjack’s hut is done. A lumberjack will now move in and start chopping down trees, so our log income is secured for now. Now on to the raw stone.]])
+   ),
+   h = 300,
+   w = 350
 }
 
-inform_about_stones = {
-   title = _ "Some Stones Were Found",
+inform_about_rocks = {
+   title = _"Some Rocks Were Found",
    body = rt(h1(_"Getting a Quarry Up.")) ..
    rt(
-      p(_[[Stones can be mined in granite mines, but the easier way is to build a quarry next to some stones lying around. As it happens, there is a pile of them just to the west (left) of your headquarters. I will teach you now how to move your view over there.]]) ..
-      listitem_arrow(_[[There are two ways to move your view. The first one is using the cursor keys on your keyboard. Go ahead and try this out.]]) ..
+      p(_[[Stones can be mined in granite mines, but the easier way is to build a quarry next to some rocks lying around. As it happens, there is a pile of them just to the west (left) of your headquarters. I will teach you now how to move your view over there.]]) ..
+      paragraphdivider() ..
+      listitem_arrow(_[[There are three ways to move your view. The first one is using the cursor keys on your keyboard. Go ahead and try this out.]]) ..
       listitem_bullet(_[[Click the ‘OK’ button and then move the view using the cursor keys]])
    ),
+   h = 350,
    obj_name = "move_view_with_cursor_keys",
-   obj_title = _ "Move your view with the cursor keys",
+   obj_title = _"Move your view with the cursor keys",
    obj_body = rt(
       h1(_"Moving Your View") ..
-      p(_[[Moving your view is essential to get a complete overview of your whole economy. There are two ways to move your view in Widelands.]]) ..
+      p(_[[Moving your view is essential to get a complete overview of your whole economy. There are three ways to move your view in Widelands.]]) ..
+      paragraphdivider() ..
       listitem_arrow(_[[The first one is to use the cursor keys on your keyboard.]]) ..
-      listitem_arrow(_[[The second one is the more common and faster one: press-and-hold the right mouse button anywhere on the map, then move your mouse around and you’ll see the view scroll.]])
+      listitem_arrow(_[[The second one is the more common and faster one: press-and-hold the right mouse button anywhere on the map, then move your mouse around and you’ll see the view scroll.]]) ..
+      listitem_arrow(_[[The third one is to use the minimap. It is especially useful for travelling big distances.]])
    )
 }
 
 tell_about_right_drag_move = {
-   title = _ "Other Ways to Move the View",
+   title = _"Other Ways to Move the View",
    body = rt(
       p(_[[Excellent. Now there is a faster way to move, using the mouse instead:]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Simply right-click-and-hold anywhere on the map, then drag the mouse and instead of the cursor, the view will be moved. Try it.]])
    ),
+   h = 300,
+   w = 350,
    obj_name = "move_view_with_mouse",
-   obj_title = _ "Move your view with the mouse",
-   obj_body = inform_about_stones.obj_body,
+   obj_title = _"Move your view with the mouse",
+   obj_body = inform_about_rocks.obj_body,
+}
+
+tell_about_minimap = {
+   title = _"Use the minimap",
+   body = rt(
+      p(_[[Very good. And now about the minimap. You can open it by clicking on the]])
+   ) ..
+   rt("image=pics/menu_toggle_minimap.png", p(_[[minimap button at the bottom of the screen or simply by using the keyboard shortcut 'm'.]])
+   ) ..
+   rt(
+      p(_[[The minimap shows the complete map in miniature. You can directly jump to any field by left-clicking on it. You can also toggle buildings, roads, flags and player indicators on and off inside the minimap.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Try it out. Open the minimap, click on a few buttons and try to move. Close it when you have have experimented enough.]])
+   ),
+   h = 300,
+   obj_name = "use_minimap",
+   obj_title = _"Learn to use the minimap",
+   obj_body = rt(
+      paragraphdivider() ..
+      listitem_bullet(_[[Open the minimap by using the third button from the left on the bottom of your screen or the 'm' key.]]) ..
+      listitem_bullet(_[[Play around a bit with the different overlays (roads, flags, etc.)]]) ..
+      listitem_bullet(_[[Close the minimap when you are ready to continue by using the same button or 'm' again. Of course, a right-click also works.]])
+   )
 }
 
 congratulate_and_on_to_quarry = {
-   title = _ "Onward to the Quarry",
-   body = rt(p(_[[Great. Now about that quarry...]]))
+   title = _"Onward to the Quarry",
+   body = rt(p(_[[Great. Now about that quarry...]])),
+   h = 200,
+   w = 250
 }
 
 order_quarry_recap_how_to_build = {
    field = first_quarry_field,
-   pos = "topright",
-   title = _ "How to Build a Quarry",
+   position = "topright",
+   title = _"How to Build a Quarry",
    body = rt(
-      p(_[[Build a quarry next to those stones here. Remember how I did it earlier?]]) ..
+      p(_[[Build a quarry next to those rocks here. Remember how I did it earlier?]]) ..
       p(_[[Make sure that you are showing the building spaces, then just click on the space were you want the building to be, choose it from the window that appears and it is placed. Maybe this is a good time to explain about all those building space symbols we activated earlier.]]) ..
       p(_[[You can build four things on fields in Widelands: Flags, small houses, medium houses and big houses. But not every field can hold everything. The build space symbols ease recognition:]])
    ) ..
@@ -165,25 +255,25 @@
    rt("image=pics/small.png", p(_[[Red building symbols can only hold small buildings and flags.]])) ..
    rt("image=pics/set_flag.png", p(_[[And finally the yellow flag symbol only allows for flags.]])) ..
    rt(
-      p(_[[If you place something on a field, the surrounding fields might have less space for holding buildings, so choose your fields wisely.]])
-   ) ..
-   rt(
+      p(_[[If you place something on a field, the surrounding fields might have less space for holding buildings, so choose your fields wisely.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Now go ahead, try it. The quarry is a small building, so if you click on a medium or big building symbol, you will have to select the small buildings tab first to find it. Go on, check it out!]])
    ),
    obj_name = "build_a_quarry",
-   obj_title = _ "Build a quarry next to the stones",
+   obj_title = _"Build a quarry next to the rocks",
    obj_body = rt(
-      h1(_ "Build a Quarry") ..
-      listitem_bullet(_[[There are some stones to the west of your headquarters. Build a quarry right next to them.]]) ..
+      h1(_"Build a Quarry") ..
+      paragraphdivider() ..
+      listitem_bullet(_[[There are some rocks to the west of your headquarters. Build a quarry right next to them.]]) ..
       listitem_arrow(_[[The quarry is a small building like the lumberjack’s hut. You can therefore build it on any field that shows a red, yellow or green house when the building spaces symbols are enabled (Press SPACE for that).]]) ..
-      listitem_arrow(_[[Just click on any house symbol next to the stones, select the small buildings tab in the window that opens up, then click on the quarry symbol.]])
+      listitem_arrow(_[[Just click on any house symbol next to the rocks, select the small buildings tab in the window that opens up, then click on the quarry symbol.]])
    )
 }
 
-talk_about_roadbuilding_00 = {
-   pos = "topright",
+talk_about_roadbuilding_00a = {
+   position = "topright",
    field = wl.Game().map:get_field(9,12),
-   title = _ "Road Building",
+   title = _"Road Building",
    body = rt(
       p(_[[Excellent! Directly after placing the building, you have been switched into road building mode. The new road will start at the flag in front of your newly placed construction site. You can enter road building mode for any flag by left-clicking on a flag and selecting]])
       ) ..
@@ -193,19 +283,39 @@
    rt("image=pics/menu_abort.png", p(_[[the abort symbol.]])) ..
    rt(
       p(_[[Now, about this road. Remember: we are already in road building mode since you just ordered the quarry. You can either make it longer by one field at a time by left-clicking multiple times on neighboring fields for perfect control over the route the road takes like so:]])
-   )
+   ),
+   show_instantly = true
+}
+
+talk_about_roadbuilding_00b = {
+   position = "topright",
+   field = wl.Game().map:get_field(9,12),
+   title = _"Road Building",
+   body = rt(
+      p(_[[Excellent! To enter road building mode for any flag left-click on a flag and select]])
+      ) ..
+   rt("image=pics/menu_build_way.png", p(_[[the road building symbol.]])) ..
+   rt(
+      p(_[[If you decide you do not want to build a road at this time, you can cancel road building by clicking on the starting flag of the road and selecting]])) ..
+   rt("image=pics/menu_abort.png", p(_[[the abort symbol.]])) ..
+   rt(
+      p(_[[Now, about this road. Remember: we are already in road building mode since you just ordered the quarry. You can either make it longer by one field at a time by left-clicking multiple times on neighboring fields for perfect control over the route the road takes like so:]])
+   ),
+   show_instantly = true
 }
 
 talk_about_roadbuilding_01 = {
-   pos = "topright",
+   position = "topright",
    field = wl.Game().map:get_field(9,12),
-   title = _ "Road Building",
-   body = rt(p(_[[Or, you can directly click the flag where the road should end like so:]]))
+   title = _"Road Building",
+   body = rt(p(_[[Or, you can directly click the flag where the road should end like so:]])),
+   h = 200,
+   w = 250
 }
 
 talk_about_roadbuilding_02 = {
-   pos = "topright",
-   title = _ "Road Building",
+   position = "topright",
+   title = _"Road Building",
    body = rt(
       p(_[[One more thing: around the field where your road would end, you can see different markers. They have the following meaning:]])
    ) ..
@@ -213,20 +323,43 @@
    rt("image=pics/roadb_yellow.png", p(_[[There is a small slope to climb to reach this field. This means that your workers will be faster walking downhill than they will be walking uphill.]])) ..
    rt("image=pics/roadb_red.png", p(_[[The connection between the fields is extremely steep. The speed increase in one direction is huge while the slowdown in the other is also substantial.]])) ..
    rt(
-      p(_[[Keep the slopes in mind while placing roads and use them to your advantage. Also, try to keep roads as short as possible and always remember to place as many flags as you can on road segments to share the load better.]]) ..
+      p(_[[Keep the slopes in mind while placing roads and use them to your advantage. Also, try to keep roads as short as possible and always remember to place as many flags as you can on road segments to share the load better. If you hold Ctrl or Shift+Ctrl while you finish the road, flags are placed automatically.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Now please rebuild the road between your quarry and your headquarters. We’ll wait until the quarry is completed.]])
    ),
+   h = 450,
    obj_name = "build_road_to_quarry",
-   obj_title = _ "Connect the quarry to the headquarters",
+   obj_title = _"Connect the quarry to the headquarters",
    obj_body = rt(
       h1(_"Connect Your Construction Site") ..
       p(_[[Connect your quarry construction site to your headquarters with a road. You would have been put directly into road building mode after ordering a new site. But now, you aren’t.]]) ..
+      paragraphdivider() ..
       listitem_arrow(_[[To build a completely new road, just click on the flag in front of your construction site, click on the build road icon and then click on the flag in front of your headquarters. Wait for the completion of the quarry.]])
    )
 }
 
+build_second_quarry = {
+   position = "topright",
+   title = _"Build a second quarry",
+   body = rt(
+      p(_[[When there are many rocks, you can consider building another quarry. This will make the stone production faster.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Build a second quarry near the rocks and connect it to your road network.]])
+   ),
+   obj_name = "build_the_second_quarry",
+   obj_title = _"Build another quarry",
+   obj_body = rt(
+      h1(_"Build another quarry") ..
+      p(_[[Build a second quarry next to the rocks. Do not forget to connect it to another flag.]]) ..
+      paragraphdivider() ..
+      listitem_arrow(_[[You can connect the new road to any flag of your existing road network. You can create junctions everywhere, not only in front of buildings.]])
+   ),
+   h = 300,
+   w = 350
+}
+
 census_and_statistics_00 = {
-   title = _ "Census and Statistics",
+   title = _"Census and Statistics",
    body = rt(
       p(_[[While we wait, I’ll quickly show you another useful feature. All construction sites look the same, and some buildings look alike. It is sometimes hard to tell them apart. Widelands offers a feature to show label texts over the buildings. They are called the ‘census’ and you can toggle them via the ‘c’ key or via the button on the ‘Watch’ tab of any field.]]) ..
       p(_[[Similar to this are the building statistics, which are also toggled via a button on the ‘Watch’ tab of any field. The hotkey for it is ‘s’. This will display information about the productivity of buildings or the progress of construction sites.]]) ..
@@ -235,13 +368,15 @@
 }
 
 census_and_statistics_01 = {
-   title = _ "Census and Statistics",
-   body = rt(p(_[[Now we know what’s going on. Let’s wait for this quarry to finish.]]))
+   title = _"Census and Statistics",
+   body = rt(p(_[[Now we know what’s going on. Let’s wait for the quarries to finish.]])),
+   h = 200,
+   w = 250
 }
 
 teaching_about_messages = {
    popup = true,
-   title = _ "Introducing Messages",
+   title = _"Introducing Messages",
    body = rt(
       h1(_"Messages") ..
       p(_[[Hi, it’s me again! This time, I have sent you a message. Messages are sent to you by Widelands to inform you about important events: empty mines, attacks on your tribe, won or lost military buildings, resources found...]]) ..
@@ -250,6 +385,7 @@
    ) ..
    rt("image=pics/message_archive.png", p(_[[archive message button to move them into your archive.]])) ..
    rt(
+      paragraphdivider() ..
       listitem_bullet(_[[Archive all messages that you currently have in your inbox, including this one.]])
    ),
    obj_name = "archive_all_messages",
@@ -257,186 +393,108 @@
    obj_body = rt(
       h1(_"Archive Your Inbox Messages") ..
       p(_[[The message window is central to fully controlling your tribe’s fortune. However, you will get a lot of messages in a real game. To keep your head straight, you should try to keep the inbox empty. ]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Archive all your messages in your inbox now.]]) ..
       listitem_arrow(_[[To do so, open the message window by pressing ‘n’ or clicking the rightmost button at the very bottom of the screen. Then mark all messages by checking the check box in front of them. Then, click the ‘Archive All’ button.]])
    )
 }
 
 closing_msg_window_00 = {
-   pos = "topright",
+   position = "topright",
    field = first_quarry_field,
    title = _"Closing Windows",
    body = rt(
-      p(_[[Excellent. By the way: closing windows in Widelands is as easy as right-clicking on them. This will work with all windows except for story message windows like this one. Go ahead and try it.]]) ..
+      p(_[[Excellent. Do you remember how to close windows? You simply have to right-click on them. This will work with all windows except for story message windows like this one. Go ahead and try it.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[First, close this window by pressing the button below, then right-click into the messages window to close it.]])
    ),
+   h = 300,
+   w = 350,
    obj_name = "close_message_window",
-   obj_title = _ "Close the messages window",
+   obj_title = _"Close the messages window",
    obj_body = rt(
       h1(_"Close the Messages Window") ..
       p(_[[All windows in Widelands can be closed by right-clicking into them. Some windows can also be toggled with the buttons at the very bottom of the screen.]]) ..
+      paragraphdivider() ..
       listitem_bullet(_[[Close the messages window now by right-clicking into it.]])
    )
 }
 
 closing_msg_window_01 = {
-   pos = "topright",
+   position = "topright",
    field = first_quarry_field,
-   title = _ "Closing Windows",
+   title = _"Closing Windows",
    body = rt(
-      p(_[[Well done! Let’s see how messages work in a real game, shall we? For this, I’ll take all stones away from the poor stonemason in the quarry. He will then send a message that he can’t find any in his working area the next time he tries to do some work.]])
-   )
+      p(_[[Well done! Let’s see how messages work in a real game, shall we? For this, I’ll take all rocks away from the poor stonemasons in the quarries. They will then send a message each that they can’t find any in their working areas the next time they try to do some work.]])
+   ),
+   h = 300,
+   w = 350
 }
 
-conclude_messages = {
-   pos = "topright",
-   title = _ "Message Arrived!",
+destroy_quarries_message = {
+   position = "topright",
+   title = _"Messages Arrived!",
    body = rt(
-      p(_[[A message has been sent to you. See how the button at the bottom of the screen has changed appearance? You can burn this quarry down now as it is no longer of any use and just blocking space.]]) ..
-      listitem_bullet(_[[To do that, click on the quarry and select the destroy button.]])
+      p(_[[You received some messages. See how the button at the bottom of the screen has changed appearance? You can destroy the quarries now as they are no longer of any use and just blocking space. To do so, there are two possibilities:]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Burning down the quarry: This is the fastest way of cleaning the space. While the worker abandons the building, the wares are lost.]]) ..
+      listitem_bullet(_[[Dismantling the quarry: A builder will walk from the headquarters to dismantle the quarry piece by piece. Thereby, you regain some of the resources you used for the construction.]])
+   ),
+   h = 300,
+   obj_name = "destroy_quarries",
+   obj_title = "Destroy the two quarries",
+   obj_body = rt(
+      p(_[[Since our quarries are useless now, you can destroy them and reuse the space later on.]]) ..
+      paragraphdivider() ..
+      listitem_arrow(_[[There are two different ways of destroying a building: burning down and dismantling. Try them both out on your quarries.]]) ..
+      listitem_arrow(_[[Burning down the quarry: This is the fastest way of cleaning the space. While the worker abandons the building, the wares are lost.]]) ..
+      listitem_arrow(_[[Dismantling the quarry: A builder will walk from the headquarters to dismantle the quarry piece by piece. Thereby, you regain some of the resources you used for the construction.]])
    )
 }
 
 introduce_expansion = {
-   title = _ "Expanding Your Territory!",
+   title = _"Expanding Your Territory!",
    body = rt(
       p(_[[There is one more thing I’d like to teach you now: Expanding your territory. The place that we started with around our headquarters is barely enough for a basic building infrastructure, and we do not have access to mountains, which we need to mine minerals and coal. So, we have to expand our territory.]]) ..
       p(_[[Expanding is as simple as building a military building at the edge of your territory. The barbarians have a selection of different military buildings: sentries, barriers, donjons, fortresses and citadels. The bigger the building, the more expensive it is to build, but the more land it will conquer around itself and the more soldiers can be stationed there. The buildings also vary in their vision range: buildings with a tower see farther than others.]]) ..
-      p(_[[As soon as a military building is manned, it will extend your land. You can then burn it down again if you need the space. But note that your land is then vulnerable: any military site from another player could conquer the land. You therefore need military sites to keep military influence over your land.]]) ..
-      listitem_bullet(_[[Let’s try it out now: build a few military buildings on your south-western border.]]) ..
-      listitem_arrow(_[[We want to capture some of this mountain so we can search for resources there. Bigger buildings will conquer more land, which can be beneficial close to mountains, because you can’t build houses on mountains.]])
-   ),
-   obj_name = "conquer_mountain",
-   obj_title = _ "Conquer an area were we can build mines",
-   obj_body = rt(
-      h1(_"Conquer the Mountain to the South-West") ..
-      p(_[[For a full-fledged economy, we need coal, iron and gold. These can be found in mountains. Conquer some area on the mountains to the south-west of your headquarters by building some military buildings close to your border.]]) ..
-      listitem_arrow(_[[You can choose from the following military buildings: sentry, donjon, barrier and fortress. The bigger the building, the more expensive it is to build it, but it will also conquer a bigger region. Sometimes, it is useful to build a big military building next to a mountain so that you can reach building sites farther up.]])
-   )
-}
-
-mining_00 = {
-   pos = "topright",
-   title = _ "Searching for Resources",
-   body = rt(
-      p(_[[Okay, now we own some of the area on this mountain. Mountains are very important, because they contain resources: coal, iron ore, gold ore and granite. Each tribe uses the resources differently, but all need mines to extract the resources from the ground.]]) ..
-      p(_[[Let’s search for resources in this mountain. First, we’ll build a road onto the mountain and place a flag. Then, we will click on the flag and call a geologist to it. I’ll show you how it’s done.]])
-   )
-}
-
-mining_01 = {
-   pos = "topright",
-   title = _"Waiting for the Geologist",
-   body = rt(
-      p(_[[The geologist will arrive at the flag shortly and start investigating the area in his surroundings. He will place the following markers for the various resources:]])
-   ) ..
-   rt("image=tribes/barbarians/resi_coal1/resi_00.png", p(_ "a bit of coal")) ..
-   rt("image=tribes/barbarians/resi_coal2/resi_00.png", p(_ "a lot of coal")) ..
-   rt("image=tribes/barbarians/resi_iron1/resi_00.png", p(_ "a bit of iron")) ..
-   rt("image=tribes/barbarians/resi_iron2/resi_00.png", p(_ "a lot of iron")) ..
-   rt("image=tribes/barbarians/resi_gold1/resi_00.png", p(_ "a bit of gold")) ..
-   rt("image=tribes/barbarians/resi_gold2/resi_00.png", p(_ "a lot of gold")) ..
-   rt("image=tribes/barbarians/resi_granite1/resi_00.png", p(_ "a bit of granite")) ..
-   rt("image=tribes/barbarians/resi_granite2/resi_00.png", p(_ "a lot of granite")) ..
-   rt("image=tribes/barbarians/resi_water1/resi_00.png", p(_ "water")) ..
-   rt("image=tribes/barbarians/resi_none/resi_00.png", p(_ "nothing was found here")) ..
-   rt(p(_[[Let’s wait and see what the geologist finds on the mountain.]]))
-}
-
-mining_02 = {
-   pos = "topright",
-   title = _ "Mining Conclusion",
-   body = rt(
-      p(_[[So our geologist found a lot of coal on this mountain. You should therefore build a coal mine here. Building a mine is like building a house. The building space symbol for where a mine can be built is]])
-   ) ..
-   rt("image=pics/mine.png", p(_"this one.")) ..
-   rt(
-      p(_[[Note that a mine needs rations to work. Rations are produced in taverns, and taverns need meat, pitta bread, and fish to produce them. You will need a lot more infrastructure to get your mines working well. This infrastructure also varies from tribe to tribe. We will explain them to you in the introduction campaigns for the three tribes.]])
-   )
-}
-
-warfare_and_training_00 = {
-   title = _ "Warfare and Training",
-   body = rt(
-      h1(_ "Soldiers and Warfare") ..
-      p(_[[On to the last topic now. We are going to talk about soldiers, their training and their profession: warfare. As I mentioned, Widelands is about building up, not burning down: therefore, warfare is also more focused on economics than on military strategies.]]) ..
-      p(_[[Nevertheless, warfare offers one way of challenging other players, and it has some game mechanics that deserve explanation. The economies of the tribes are explained in their individual tutorial campaigns.]]) ..
-      p(_[[Ok, I am going to create a little training ground for us with a training camp and a warehouse to the north east of here.]]) ..
-      p(_[[If you want to come back to this south-western part of your realm, just scroll here via right-button scrolling or open the minimap by clicking on the]])
-   ) ..
-   rt("image=pics/menu_toggle_minimap.png", p(_[[minimap button at the bottom of the screen.]]) ..
-      p(_[[Alternatively, you could also press ‘m’ on your keyboard.]])
-   ) ..
-   rt(
-      p(_[[The minimap shows the complete map in miniature. You can directly jump to any field by left-clicking on it. You can also toggle buildings, roads, flags and player indicators on and off inside the minimap.]]) ..
-      p(_[[But I digress. Back to soldiers. What was I about to do? Oh yes, I wanted to build a small training scenario for you. Let’s do that now.]])
-   )
-}
-
-warfare_and_training_01 = {
-   pos = "topright",
-   title = _ "Trainings Camp and Soldier Stats",
-   body = rt(
-      p(_[[Here we go. Take a look at the soldiers that are on their way into our training camp. They look different from normal workers: they have a health bar over their head that displays their remaining health, and they have four symbols, which symbolize the individual soldier’s current levels in the four different categories health, attack, defense and evade.]]) ..
-      p(_[[A soldier is created like any normal worker: a carrier grabs a tool in a warehouse as soon as a request for a certain profession is not fulfilled. The tool to create a barbarian soldier is an ax. Newly created soldiers are of level 0. To make soldiers better in any of the four categories, training is needed.]]) ..
-      p(_[[Training happens in training sites like the training camp or the battle arena: soldiers go there (as our little fellows are currently doing), consume some wares and advance a level in one category. If a barbarian soldier is fully trained, he has level 3 health, level 5 attack, level 0 defense and level 2 evade. This is one fearsome warrior then! The individual statistics have the following meaning:]]) ..
-      h2(_"Health:") ..
-      p(_[[The total life of a soldier. A barbarian soldier starts with ~130 health, and with each health level he gains 28 health.]]) ..
-      h2(_"Attack:") ..
-      p(_[[The amount of damage a soldier will inflict on the enemy when an attack is successful. A barbarian soldier with attack level 0 inflicts ~14 points of health damage when he succeeds in hitting an enemy. For each attack level, he gains 7 damage points.]]) ..
-      h2(_"Defense:") ..
-      p(_[[Defense is the value that is subtracted from the attack value. The barbarians cannot train in this skill and therefore have always defense level 0, which means that they always get 3 points subtracted from the damage inflicted. If an attacker with an attack value of 15 points hits a barbarian soldier, the barbarian will lose 15 - 3 = 12 health. The 3 points are subtracted because of the defense ability.]]) ..
-      h2(_"Evade:") ..
-      p(_[[Evade is the chance that the soldier is able to dodge an attack. It is 25% for a level 0 evade barbarian and increases in steps of 15% for each level.]])
-   )
-}
-
-enhance_fortress = {
-   pos = "topright",
-   title = _ "Enhance This Fortress",
-   body = rt(
-      h1(_ "Enhancing Buildings") ..
-      p(_[[I will create an enemy for you soon, but first let’s make sure you are prepared. This fortress is already quite strong and conquers a lot of space. But there is an even bigger building: the citadel.]]) ..
-      p(_[[Citadels cannot be built directly. Instead, you will have to construct a fortress first and then enhance it to a citadel. To do so, click on the fortress, then choose the ‘Enhance to Citadel’ button. Your soldiers will leave the fortress while the construction is going on. This means that your fortress will lose its military influence. If an enemy occupies a military building nearby, your construction site will burn down. No sweat, that won’t happen here.]]) ..
-      listitem_bullet(_[[Enhance your fortress to a citadel now.]]) ..
-      listitem_arrow(_[[Remember that you can speed time up by using PAGE_UP. Building a citadel takes a while.]])
-   ),
-   obj_name = "enhance_fortress",
-   obj_title = _"Enhance your fortress to a citadel",
-   obj_body = rt(
-      h1(_ "Enhance Your Fortress") ..
-      listitem_bullet(_[[Enhance your fortress to a mighty citadel.]]) ..
-      listitem_arrow(_[[The citadel can house 12 soldiers and is the biggest military building the barbarians can build. It also costs a lot of resources and takes a long time to build. It is most suited to guard strategically important points like constricted points or mountains.]])
-   )
-}
-
-attack_enemey = {
-   pos = "topright",
-   title = _ "Defeat your enemy",
-   body = rt(
-      h1(_ "Defeat the Enemy") ..
-      p(_[[I have created a sparring partner for you: It is an empire tribe close to your citadel. To attack its buildings, click on the door of a target building, choose the number of soldiers that you wish to send and click on the attack button. Your soldiers will come from all nearby military buildings. Likewise, the defenders will come from all nearby military buildings of the enemy and intercept your forces.]]) ..
-      listitem_bullet(_[[Attack and conquer all military buildings of the enemy and destroy their headquarters.]])
-   ),
-   obj_name = "defeated_the_empire",
-   obj_title = _ "Defeat the enemy tribe",
-   obj_body = rt(
-      h1(_"Defeat Your Enemy") ..
-      listitem_bullet(_[[Defeat the nearby enemy.]]) ..
-      listitem_arrow(_[[To attack a building, click on its doors, choose the number of attacking soldiers, then send them via the ‘Attack’ button.]])
-   )
+      p(_[[As soon as a military building is manned, it will extend your land. I will tell your more about military buildings in another tutorial.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Let’s try it out now: build a military building on your border.]])
+   ),
+   obj_name = "expand_territory",
+   obj_title = _"Expand your territory",
+   obj_body = rt(
+      h1(_"Make your territory grow") ..
+      p(_[[In Widelands, it is necessary to build many buildings, which take a lot of space. To expand your territory, you have to build military buildings next to your border. Every tribe has several military buildings.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[The Barbarians have four different military buildings you can build: the sentry (small), the barrier and the donjon (both medium) and the fortress (big). Just choose the one you like most.]]) ..
+      listitem_arrow(_[[Remember that big buildings (green icon) cannot be built on small (red) or medium (yellow) building plots, but buildings can be built on a building spot that provides more space than they need. You should always keep that in mind when you search a suitable place.]])
+   )
+}
+
+
+military_building_finished = {
+   title = _"Militarysite occupied",
+   body = rt(
+      h1(_"Your territory has just grown!") ..
+      p(_[[Great. Do you see how your territory has grown since your soldiers entered the military building?]]) ..
+      p(_[[Every military building has a certain conquer area - the more expensive the building, the more land it conquers.]])
+   ),
+   h = 300,
+   w = 350
 }
 
 conclude_tutorial = {
-   title = _ "Conclusion",
+   title = _"Conclusion",
    body = rt(
       h1(_"Conclusion") ..
-      p(_[[This concludes the tutorial. There is some stuff we have not covered here – we have not even built a single production building even though producing wares is the most important thing in Widelands – but you’ve learned the ropes.]]) ..
-      p(_[[You can learn about the remaining stuff while you go through the individual tribes’ introduction campaigns. Each consists of some scenarios explaining the tribe and its economy while introducing the background story of Widelands. Have fun playing!]]) ..
-      p(_[[You can continue playing this map or you can end this game whenever you like. To leave this game and return to the main menu, click on the]])
+      p(_[[This concludes the first tutorial. In order to learn more about the game, I suggest to play one of the other tutorials. Each of them covers a different topic.]]) ..
+      p(_[[However, since you now know how to control Widelands, you can also start a game (or continue this one) and discover yourself more by.]]) ..
+      p(_[[To leave this game and return to the main menu, click on the]])
    ) ..
    rt("image=pics/menu_options_menu.png", p(_[[‘Options’ menu button on the very left at the bottom of the screen. Then click the]])) ..
    rt("image=pics/menu_exit_game.png", p(_[[‘Exit Game’ button.]])) ..
    rt(p(_[[Thanks for playing this tutorial. Enjoy Widelands and remember to visit us at]])) ..
-   rt("text-align=center", "<p font-size=24 font-decoration=underline>http://www.widelands.org</p>")
+   rt("text-align=center", "<p font-size=24 font-decoration=underline>http://www.widelands.org</p>"),
+   h = 450
 }

=== added directory 'maps/Tutorials/02_Warfare.wmf'
=== added directory 'maps/Tutorials/02_Warfare.wmf/binary'
=== added file 'maps/Tutorials/02_Warfare.wmf/binary/building'
Binary files maps/Tutorials/02_Warfare.wmf/binary/building	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/binary/building	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/binary/exploration'
Binary files maps/Tutorials/02_Warfare.wmf/binary/exploration	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/binary/exploration	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/binary/flag'
Binary files maps/Tutorials/02_Warfare.wmf/binary/flag	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/binary/flag	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/binary/heights'
Binary files maps/Tutorials/02_Warfare.wmf/binary/heights	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/binary/heights	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/binary/mapobjects'
Binary files maps/Tutorials/02_Warfare.wmf/binary/mapobjects	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/binary/mapobjects	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/binary/node_ownership'
Binary files maps/Tutorials/02_Warfare.wmf/binary/node_ownership	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/binary/node_ownership	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/binary/resource'
Binary files maps/Tutorials/02_Warfare.wmf/binary/resource	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/binary/resource	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/binary/road'
Binary files maps/Tutorials/02_Warfare.wmf/binary/road	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/binary/road	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/binary/terrain'
Binary files maps/Tutorials/02_Warfare.wmf/binary/terrain	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/binary/terrain	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/elemental'
--- maps/Tutorials/02_Warfare.wmf/elemental	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/elemental	2014-10-17 09:40:17 +0000
@@ -0,0 +1,10 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
+[global]
+packet_version="1"
+map_w="64"
+map_h="64"
+nr_players="2"
+name=_"Warfare"
+author="Winterwind,SirVer,Nasenbaer,wl-zocker"
+descr=_"In this tutorial, you will be taught the secrets of warfare: How to create soldiers, how to train them and how to lead them in battle."

=== added file 'maps/Tutorials/02_Warfare.wmf/extra_data'
--- maps/Tutorials/02_Warfare.wmf/extra_data	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/extra_data	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
+[global]
+packet_version="1"

=== added file 'maps/Tutorials/02_Warfare.wmf/objective'
--- maps/Tutorials/02_Warfare.wmf/objective	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/objective	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
+[global]
+packet_version="2"

=== added directory 'maps/Tutorials/02_Warfare.wmf/player'
=== added directory 'maps/Tutorials/02_Warfare.wmf/player/1'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/messages'
--- maps/Tutorials/02_Warfare.wmf/player/1/messages	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/player/1/messages	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
+[global]
+packet_version="1"

=== added directory 'maps/Tutorials/02_Warfare.wmf/player/1/view'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/border_1'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/node_immovable_kinds_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/node_immovables_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/owners_0'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/roads_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/survey_amounts_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/survey_times_1'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/surveys_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/terrains_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/triangle_immovable_kinds_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/triangle_immovables_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/unseen_times_1'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/1/view/vision_1'
Binary files maps/Tutorials/02_Warfare.wmf/player/1/view/vision_1	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/player/1/view/vision_1	2014-10-17 09:40:17 +0000 differ
=== added directory 'maps/Tutorials/02_Warfare.wmf/player/2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/messages'
--- maps/Tutorials/02_Warfare.wmf/player/2/messages	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/player/2/messages	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
+[global]
+packet_version="1"

=== added directory 'maps/Tutorials/02_Warfare.wmf/player/2/view'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/border_1'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/node_immovable_kinds_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/node_immovables_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/owners_0'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/roads_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/survey_amounts_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/survey_times_1'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/surveys_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/terrains_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/triangle_immovable_kinds_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/triangle_immovables_2'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/unseen_times_1'
=== added file 'maps/Tutorials/02_Warfare.wmf/player/2/view/vision_1'
Binary files maps/Tutorials/02_Warfare.wmf/player/2/view/vision_1	1970-01-01 00:00:00 +0000 and maps/Tutorials/02_Warfare.wmf/player/2/view/vision_1	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/02_Warfare.wmf/player_names'
--- maps/Tutorials/02_Warfare.wmf/player_names	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/player_names	2014-10-17 09:40:17 +0000
@@ -0,0 +1,16 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
+[global]
+packet_version="2"
+
+[player_1]
+name="Player 1"
+tribe="barbarians"
+ai=
+closeable="false"
+
+[player_2]
+name="Sparing Partner"
+tribe="empire"
+ai=
+closeable="false"

=== added file 'maps/Tutorials/02_Warfare.wmf/player_position'
--- maps/Tutorials/02_Warfare.wmf/player_position	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/player_position	2014-10-17 09:40:17 +0000
@@ -0,0 +1,6 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
+[global]
+packet_version="2"
+player_1="33 57"
+player_2="50 10"

=== added file 'maps/Tutorials/02_Warfare.wmf/port_spaces'
--- maps/Tutorials/02_Warfare.wmf/port_spaces	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/port_spaces	2014-10-17 09:40:17 +0000
@@ -0,0 +1,7 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
+[global]
+packet_version="1"
+number_of_port_spaces="0"
+
+[port_spaces]

=== added directory 'maps/Tutorials/02_Warfare.wmf/scripting'
=== added file 'maps/Tutorials/02_Warfare.wmf/scripting/init.lua'
--- maps/Tutorials/02_Warfare.wmf/scripting/init.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/scripting/init.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,20 @@
+-- ================================================
+--           Tutorial 02: Warfare
+-- ================================================
+
+plr = wl.Game().players[1]
+
+set_textdomain("Warfare.wmf")
+
+include "scripting/coroutine.lua"
+include "scripting/infrastructure.lua"
+include "scripting/messages.lua"
+include "scripting/table.lua"
+include "scripting/ui.lua"
+
+include "map:scripting/starting_conditions.lua"
+
+include "map:scripting/texts.lua"
+
+include "map:scripting/mission_thread.lua"
+

=== added file 'maps/Tutorials/02_Warfare.wmf/scripting/mission_thread.lua'
--- maps/Tutorials/02_Warfare.wmf/scripting/mission_thread.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/scripting/mission_thread.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,105 @@
+-- ================
+-- Mission thread
+-- ================
+
+function intro()
+   sleep(200)
+   message_box_objective(plr, introduction)
+
+   training()
+end
+
+function training()
+   -- Teach about trainingsites and soldiers' abilities
+   sleep(5000) -- to let soldiers walk
+
+   message_box_objective(plr, abilities)
+   local o = message_box_objective(plr, battlearena1)
+   while #plr:get_buildings("battlearena") == 0 do sleep(500) end
+   o.done = true
+   message_box_objective(plr, battlearena2)
+
+   o = message_box_objective(plr, trainingcamp1)
+   while #plr:get_buildings("trainingcamp") == 0 do sleep(500) end
+   o.done = true
+   message_box_objective(plr, trainingcamp2)
+
+   sleep(300)
+
+   military_buildings()
+end
+
+function military_buildings()
+   message_box_objective(plr, heroes_rookies)
+   message_box_objective(plr, soldier_capacity)
+   local o = message_box_objective(plr, dismantle)
+
+   while #plr:get_buildings("sentry") > 1 do sleep(200) end
+   o.done = true
+
+   sleep(2000)
+
+   enhance_fortress()
+end
+
+function enhance_fortress()
+   sleep(5000)
+
+   local citadel_field = wl.Game().map:get_field(32, 62)
+   local o = message_box_objective(plr, fortress_enhancement)
+   while not (citadel_field.immovable and
+      citadel_field.immovable.descr.name == "citadel") do sleep(800) end
+   o.done = true
+
+   create_enemy()
+
+   -- Wait for soldiers to move in
+   local citadel = citadel_field.immovable
+   local break_out = false
+   while not break_out do
+      for k,v in pairs(citadel:get_soldiers("all")) do
+         break_out = true
+         break -- Break out if there is at least one soldier here
+      end
+
+      sleep(500)
+   end
+
+   sleep(300)
+
+   attack()
+end
+
+function create_enemy()
+   prefilled_buildings(wl.Game().players[2],
+      {"barrier", 24, 7},
+      {"sentry", 29, 16},
+      {"tower", 30, 21},
+      {"headquarters", 30, 27,
+         soldiers = {
+            [{0,0,0,0}] = 15,
+         }
+      }
+   )
+   wl.Game().players[2]:forbid_buildings("all")
+end
+
+function attack()
+   local o = message_box_objective(plr, attack_enemy)
+
+   local plr2 = wl.Game().players[2]
+   while #plr2:get_buildings("headquarters") > 0 do
+      sleep(3000)
+   end
+   o.done = true
+
+   conclusion()
+end
+
+function conclusion()
+   sleep(4000)
+   message_box_objective(plr, conclude_tutorial)
+end
+
+run(intro)
+

=== added file 'maps/Tutorials/02_Warfare.wmf/scripting/starting_conditions.lua'
--- maps/Tutorials/02_Warfare.wmf/scripting/starting_conditions.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/scripting/starting_conditions.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,69 @@
+-- ===============
+-- Initialization
+-- ===============
+
+function init_player()
+
+   plr:allow_buildings("all")
+
+   prefilled_buildings(plr,
+      {"fortress", 32, 62, soldiers = {[{3,5,0,2}] = 8 }},
+      {"warehouse", 33, 57,
+         soldiers = {
+            [{0,0,0,0}] = 20, -- needed for training
+            [{1,0,0,0}] = 1,
+            [{2,0,0,0}] = 1,
+            [{3,0,0,0}] = 1,
+            [{0,1,0,0}] = 1,
+            [{0,2,0,0}] = 1,
+            [{0,3,0,0}] = 1,
+            [{0,4,0,0}] = 1,
+            [{0,5,0,0}] = 1,
+            [{0,0,0,1}] = 1,
+            [{0,0,0,2}] = 1,
+            [{3,5,0,2}] = 30,
+         },
+         workers = {
+            builder = 3,
+            ox = 15,
+            trainer = 2
+         },
+         wares = {
+            log = 40,
+            blackwood = 40,
+            cloth = 10,
+            gold = 10,
+            grout = 30,
+            raw_stone = 30,
+            thatchreed = 40,
+
+            -- wares for training
+            sharpax = 20,
+            broadax = 20,
+            bronzeax = 20,
+            battleax = 20,
+            warriorsax = 20,
+            helm = 20,
+            mask = 20,
+            warhelm = 20,
+            strongbeer = 50,
+            pittabread = 200,
+            meat = 200
+         }
+      },
+      {"sentry", 28, 57, soldiers = {[{3,5,0,2}] = 2 }},
+      {"sentry", 37, 61, soldiers = {[{3,5,0,2}] = 2 }},
+      {"barrier", 30, 58, soldiers = {[{0,0,0,0}] = 1 }}, -- to make sure some soldiers walk out
+      {"lumberjacks_hut", 24, 1}
+   )
+
+   -- Build the roads
+   local map = wl.Game().map
+   connected_road(plr,map:get_field(29,58).immovable,"br,r|r,r|r,tr")
+   connected_road(plr,map:get_field(38,62).immovable,"l,l|l,bl|tl,tl|tl,tl")
+   connected_road(plr,map:get_field(32,63).immovable,"tr,tr|")
+   connected_road(plr,map:get_field(25,2).immovable,"tr,tr|tr,tr|tr,tr|tr,tr")
+end
+
+run(init_player)
+

=== added file 'maps/Tutorials/02_Warfare.wmf/scripting/texts.lua'
--- maps/Tutorials/02_Warfare.wmf/scripting/texts.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/scripting/texts.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,213 @@
+-- =======================================================================
+--                      Texts for the tutorial mission
+-- =======================================================================
+
+-- =========================
+-- Some formating functions
+-- =========================
+
+include "scripting/formatting.lua"
+include "scripting/format_scenario.lua"
+
+-- =============
+-- Texts below
+-- =============
+
+introduction = {
+   title = _"Introduction",
+   body = rt(
+      h1(_"Soldiers, Training and Warfare") ..
+      p(_[[In this scenario, I'm going to tell you about soldiers, their training and their profession: warfare. Although Widelands is about building up, not burning down, there is an enemy you sometimes have to defeat. Yet warfare is mainly focused on economics, not on military strategies, and its mechanics deserve explanation.]]) ..
+      p(_[[I've set up a small village that contains the most important things. You also have enough wares so you do not have to take care of your weapon production. In a real game, you will not have this luxury.]])
+   ),
+   h = 300
+}
+
+abilities = {
+   position = "topright",
+   title = _"Soldiers' abilities",
+   body = rt(
+      p(_[[A new soldier is created like a worker: When a military building needs a soldier, a carrier grabs the needed weapons and armor from a warehouse (or your headquarters) and walks up the road to your new building. Basic Barbarian soldiers do not use an armor, they only need an ax.]]) ..
+      p(_[[Take a look at the soldiers that are on their way into our military buildings. They look different from normal workers: they have a health bar over their head that displays their remaining health, and they have four symbols, which symbolize the individual soldier’s current levels in the four different categories health, attack, defense and evade.]]) ..
+      p(_[[If a barbarian soldier is fully trained, he has level 3 health, level 5 attack, level 0 defense and level 2 evade. This is one fearsome warrior then! The individual abilities have the following meaning:]])
+   ) ..
+   rt("image=tribes/barbarians/soldier/hp_level0.png", h2(_"Health:"))..
+   rt(p(_[[The total life of a soldier. A barbarian soldier starts with 130 health, and with each health level he gains 28 health.]])) ..
+   rt("image=tribes/barbarians/soldier/attack_level0.png", h2(_"Attack:")) ..
+   rt(p(_[[The amount of damage a soldier will inflict on the enemy when an attack is successful. A barbarian soldier with attack level 0 inflicts ~14 points of health damage when he succeeds in hitting an enemy. For each attack level, he gains 7 damage points.]])) ..
+   -- The Atlanteans' image, because the Barbarian one has a white background
+   rt("image=tribes/atlanteans/soldier/defense_level0.png", h2(_"Defense:")) ..
+   rt(p(_[[The defense is the percentage that is subtracted from the attack value. The barbarians cannot train in this skill and therefore have always defense level 0, which means that the damage is always reduced by 3%. If an attacker with an attack value of 35 points hits a barbarian soldier, the barbarian will lose 35·0.97 = 34 health.]])) ..
+   rt("image=tribes/barbarians/soldier/evade_level0.png", h2(_"Evade:")) ..
+   rt(p(_[[Evade is the chance that the soldier is able to dodge an attack. It is 25% for a level 0 evade barbarian and increases in steps of 15% for each level.]]))
+}
+
+battlearena1 = {
+   position = "topright",
+   title = _"The Battle Arena",
+   body = rt(
+      p(_[[Now I have talked about training and levels. Let me elaborate that.]]) ..
+      p(_[[A newly created soldier has no experience and is not very good at fighting. To make him stronger, you can build trainingsites.]]) ..
+      p(_[[One trainingsite is the battle arena. It is a big and expensive building and it trains the soldiers in evade. Since soldiers get very hungry during their workout, this building needs a lot of food and strongbeer. In a real game, you should have a good infrastucture before you build it.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[To see this in action, build a battle arena.]])
+   ),
+   h = 350,
+   obj_name = "build_battlearena",
+   obj_title = _"Build a battle arena",
+   obj_body = rt(
+      paragraphdivider() ..
+      listitem_bullet(_[[Build a battle arena. It is a big building.]]) ..
+      listitem_arrow(_[[Since the construction takes some time, you can change the game speed using PG_UP and PG_DOWN]])
+   )
+}
+
+battlearena2 = {
+   position = "topright",
+   title = _"The Battle Arena",
+   body = rt(
+      h1(_"The Battle Arena Has Been Constructed") ..
+      p(_[[Very good. Our battle arena is finished, and the soldiers are already walking towards it.]]) ..
+      -- Not perfectly correct (some training steps need either bread or meat), but we do not want to confuse new players
+      p(_[[The needed wares are also delivered there. For successful training, you need bread and strongbeer. Most steps additionally require either fish or meat. For more information, you can have a look at the building's help window, accessible via the questionmark in every building's window.]]) ..
+      p(_[[To understand how far your soldiers are trained, you can have a look at the icon. They are modified by red dots:]])
+   ) ..
+   rt("image=tribes/barbarians/soldier/evade_level0.png", p(_[[No red dots means that the soldier is not trained, so he has level 0. All your new recruits have this.]])) ..
+   rt("image=tribes/barbarians/soldier/evade_level1.png", p(_[[With every successful training step, your soldier becomes stronger. This is indicated by a red dot. This soldier is on level 1 in evade training.]])) ..
+   rt("image=tribes/barbarians/soldier/evade_level2.png", p(_[[When your soldier has reached the highest possible level (in this case level 2), this is indicated by a white blackground color.]])),
+   h = 450
+}
+
+trainingcamp1 = {
+   position = "topright",
+   title = _"The Training Camp",
+   body = rt(
+      h1(_"The Training Camp") ..
+      p(_[[There is a second trainingsite: the training camp. It is a big building, too, but in opposition to the battle arena, it trains attack and health (remember, the Barbarian soldiers cannot be trained in defense).]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Build a training camp.]])
+   ),
+   h = 300,
+   obj_name = "build_trainingcamp",
+   obj_title = _"Build a training camp",
+   obj_body = rt(
+      p(_[[The battle arena only trains the soldiers in evade. To get the strongest possible soldier, you also need to build a training camp, which trains them in attack and health.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Build a training camp.]])
+   )
+}
+
+trainingcamp2 = {
+   position = "topright",
+   title = _"The Training Camp",
+   body = rt(
+      p(_[[Great, our training camp is now finished, too. Now nothing hinders us from getting the strongest warriors the world has ever seen.]]) ..
+      p(_[[To train in the training camp, our soldiers need food like in the battle arena, but no strongbeer. Instead, they need different axes for attack training and helmets for the health training.]]) ..
+      p(_[[This equipment is produced in smithies out of coal, iron, and sometimes gold. To explain this in detail would lead too far. You learn more about this in the second Barbarian campaign.]]) ..
+      p(_[[You should also keep in mind that each of the three tribes in Widelands has its own way of training, so the buildings and wares are different. Also, the ability levels cannot be compared: An Imperial soldier with evade level 0 has a 30% chance of evading, while the Barbarian one only has 25%.]])
+   )
+}
+
+heroes_rookies = {
+   position = "topright",
+   title = _"Heroes and Rookies",
+   body = rt(
+      h1(_"Heroes and Rookies") ..
+      p(_[[While our soldiers are training, let me tell you what we can do with them.]]) ..
+      p(_[[In every military building, you can set the preference for heroes (trained soldiers) or rookies. From time to time, a soldier walks out of the building and is replaced by a stronger/weaker one automatically.]]) ..
+      p(_[[The initial setting depends on the type of the building. Concerning the Barbarians, the sentry is the only building that prefers rookies by default. You should change this setting to fit your current needs.]]) ..
+      p(_[[When you are expanding into no man's land, you can make your buildings prefer rookies. When you are planning to attack, send heroes into that region. Conquered buildings always prefer heroes.]])
+   )
+}
+
+soldier_capacity = {
+   position = "topright",
+   title = _"Soldier capacity",
+   body = rt(
+      h1(_"Adjusting the number of soldiers") ..
+      p(_[[There is another way how you can control the strength of a military buildings: By the number of soldiers stationed there. Just click on the arrow buttons to decrease or increase the desired number of soldiers. Every buildings has a maximum capacity. In case of the barrier, it is five, for example.]]) ..
+      p(_[[If you wish to send a certain soldier away, you can simply click on it. It will then be replaced by another soldier.]]) ..
+      -- TODO(codereview): Is there a possibility to create non-breaking spaces?
+      p(_[[Let me also describe what the numbers in the statistic string mean. It can contain up to three numbers, e.g. '1 (+5) soldier (+2)'.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[The first number describes how many soldiers are currently in this building. In this example, only one soldier is left behind (one soldier always has to guard a military building).]]) ..
+      listitem_bullet(_[[The second number tells you how many additional soldiers reside in this building, but are currently outside. The five soldiers are maybe attacking an enemy. They will return when they have been successful.]]) ..
+      listitem_bullet(_[[The third number indicates the missing soldiers. >From the eight soldiers (1 + 5 + 2) you wish to have here, two have maybe died. They will be replaced by soldiers from your warehouse, if possible.]])
+   )
+}
+
+dismantle = {
+   position = "topright",
+   title = _"Dismantle your sentry",
+   body = rt(
+      h1(_"Dismantling military buildings") ..
+      p(_[[You can only reduce the number of soldiers to one. The last soldier of a building will never come out (unless this building is attacked). If you want to have your soldier elsewhere, you have to dismantle the building (buildings of an alien tribe cannot be dismantled, only be burnt down).]]) ..
+      p(_[[But destroying a military building is always linked with a risk: The land is still yours, but it is no longer protected. Any enemy that builds his own military sites can take away that land without a fight, causing your building to burst into flames. Furthermore, some parts of the land can now be hidden under the fog of war. You should therefore only dismantle military buildings inside your territory, where you are safe from enemies.]]) ..
+      p(_[[Have you seen your sentry? Since it cannot contain many soldiers and is next to a stronger barrier, it is rather useless.]]) ..
+      paragraphdivider() ..
+      -- TRANSLATORS: 'it' refers to the Barbarian sentry
+      listitem_bullet(_[[Dismantle it.]])
+   ) ..
+   rt(p(_[[You can also use this opportunity to get familiar with the other options: The heroes/rookies preference and the capacity.]])),
+   obj_name = "dismantle_sentry",
+   obj_title = _"Dismantle your north-western sentry",
+   obj_body = rt(
+      p(_[[You can control the number of soldiers in military sites with the arrow buttons. If you even want to get your last soldier out it, you have to destroy it. But it will no longer protect your territory, which makes it vulnerable for hostile attacks.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Dismantle your sentry in the north-west, next to the barrier.]])
+   )
+}
+
+fortress_enhancement = {
+   position = "topright",
+   title = _"Enhance This Fortress",
+   body = rt(
+      h1(_"Enhancing Buildings") ..
+      p(_[[Well done. Now you know how to draw back your soldiers from the places where you don't need them. Now I'll tell you how to reinforce your front line.]]) ..
+      p(_[[This fortress is already quite strong and conquers a lot of space. But there is an even bigger building: the citadel.]]) ..
+      p(_[[Citadels can't be built directly. Instead, you'll have to construct a fortress first and then enhance it to a citadel. To do so, click on the fortress, then choose the ‘Enhance to Citadel’ button.]]) ..
+      p(_[[Your soldiers will leave the fortress while the construction is going on. This means that your fortress will lose its military influence, as I described above.]]) ..
+      listitem_bullet(_[[Enhance your fortress to a citadel now.]])
+   ),
+   obj_name = "enhance_fortress",
+   obj_title = _"Enhance your fortress to a citadel",
+   obj_body = rt(
+      h1(_"Enhance Your Fortress") ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Enhance your fortress to a mighty citadel.]]) ..
+      listitem_arrow(_[[The citadel can house 12 soldiers and is the biggest military building the barbarians can build. It also costs a lot of resources and takes a long time to build. It is most suited to guard strategically important points like constricted points or mountains.]])
+   )
+}
+
+attack_enemy = {
+   position = "topright",
+   field = wl.Game().map:get_field(29,4), -- show the lost territory
+   title = _"Defeat your Enemy",
+   body = rt(
+      h1(_"Defeat the Enemy") ..
+      p(_[[Great work, the citadel is finished. But what is that: A hostile tribe has settled next to us while the citadel was under construction! Do you see how it took away a part of our land? And our lumberjack has no lost his working place. That is what I talked about. Let's take our land back and defeat the enemy.]]) ..
+      p(_[[To attack a building, click on the door, choose the number of soldiers that you wish to send and click on the attack button. Your soldiers will come from all nearby military buildings. Likewise, the defenders will come from all nearby military buildings of the enemy and intercept your forces.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Attack and conquer all military buildings of the enemy and destroy their headquarters.]])
+   ),
+   h = 350,
+   obj_name = "defeated_the_empire",
+   obj_title = _"Defeat the enemy tribe",
+   obj_body = rt(
+      h1(_"Defeat Your Enemy") ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Defeat the nearby enemy.]]) ..
+      listitem_arrow(_[[To attack a building, click on its doors, choose the number of attacking soldiers, then send them via the ‘Attack’ button.]])
+   )
+}
+
+conclude_tutorial = {
+   title = _"Conclusion",
+   body = rt(
+      h1(_"Conclusion") ..
+      p(_[[Thank you for playing this tutorial. I hope you enjoyed it and you learned how to create and train soldiers, how to control where they go and how to defeat an enemy. Did you see how easy you could overwhelm your enemy? Having trained soldiers is a huge advantage.]]) ..
+      p(_[[But a war is expensive, and not always the path leading to the goal. When you play a game (no campaign), there are also peaceful win conditions. You should definitely try them out, they're worth it.]]) ..
+      p(_[[You are now ready to play the campaigns. They will teach you about the different economies of the tribes. You can also play the remaining tutorials, but they are not crucial for succeeding in the campaigns.]])
+   )
+}
+

=== added file 'maps/Tutorials/02_Warfare.wmf/version'
--- maps/Tutorials/02_Warfare.wmf/version	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/02_Warfare.wmf/version	2014-10-17 09:40:17 +0000
@@ -0,0 +1,11 @@
+# Automatically created by Widelands bzr7181[trunk] (Release)
+
+[global]
+map_source_url=
+map_release=
+map_creator_version="unknown"
+map_version_major="0"
+map_version_minor="2"
+map_version_timestamp="1411489095"
+packet_version="1"
+packet_compatibility="1"

=== added directory 'maps/Tutorials/03_Seafaring.wmf'
=== added directory 'maps/Tutorials/03_Seafaring.wmf/binary'
=== added file 'maps/Tutorials/03_Seafaring.wmf/binary/building'
Binary files maps/Tutorials/03_Seafaring.wmf/binary/building	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/binary/building	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/binary/exploration'
Binary files maps/Tutorials/03_Seafaring.wmf/binary/exploration	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/binary/exploration	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/binary/flag'
Binary files maps/Tutorials/03_Seafaring.wmf/binary/flag	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/binary/flag	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/binary/heights'
Binary files maps/Tutorials/03_Seafaring.wmf/binary/heights	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/binary/heights	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/binary/mapobjects'
Binary files maps/Tutorials/03_Seafaring.wmf/binary/mapobjects	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/binary/mapobjects	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/binary/node_ownership'
Binary files maps/Tutorials/03_Seafaring.wmf/binary/node_ownership	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/binary/node_ownership	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/binary/resource'
Binary files maps/Tutorials/03_Seafaring.wmf/binary/resource	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/binary/resource	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/binary/road'
Binary files maps/Tutorials/03_Seafaring.wmf/binary/road	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/binary/road	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/binary/terrain'
Binary files maps/Tutorials/03_Seafaring.wmf/binary/terrain	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/binary/terrain	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/elemental'
--- maps/Tutorials/03_Seafaring.wmf/elemental	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/elemental	2014-10-17 09:40:17 +0000
@@ -0,0 +1,10 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
+[global]
+packet_version="1"
+map_w="112"
+map_h="80"
+nr_players="1"
+name=_"Seafaring"
+author="wl-zocker"
+descr=_"In this tutorial, you get to know seafaring, that is how to handle ships and ports."

=== added file 'maps/Tutorials/03_Seafaring.wmf/extra_data'
--- maps/Tutorials/03_Seafaring.wmf/extra_data	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/extra_data	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
+[global]
+packet_version="1"

=== added file 'maps/Tutorials/03_Seafaring.wmf/objective'
--- maps/Tutorials/03_Seafaring.wmf/objective	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/objective	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
+[global]
+packet_version="2"

=== added directory 'maps/Tutorials/03_Seafaring.wmf/player'
=== added directory 'maps/Tutorials/03_Seafaring.wmf/player/1'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/messages'
--- maps/Tutorials/03_Seafaring.wmf/player/1/messages	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/player/1/messages	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
+[global]
+packet_version="1"

=== added directory 'maps/Tutorials/03_Seafaring.wmf/player/1/view'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/border_1'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/node_immovable_kinds_2'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/node_immovables_2'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/owners_0'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/roads_2'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/survey_amounts_2'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/survey_times_1'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/surveys_2'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/terrains_2'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/triangle_immovable_kinds_2'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/triangle_immovables_2'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/unseen_times_1'
=== added file 'maps/Tutorials/03_Seafaring.wmf/player/1/view/vision_1'
Binary files maps/Tutorials/03_Seafaring.wmf/player/1/view/vision_1	1970-01-01 00:00:00 +0000 and maps/Tutorials/03_Seafaring.wmf/player/1/view/vision_1	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/03_Seafaring.wmf/player_names'
--- maps/Tutorials/03_Seafaring.wmf/player_names	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/player_names	2014-10-17 09:40:17 +0000
@@ -0,0 +1,10 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
+[global]
+packet_version="2"
+
+[player_1]
+name="Spieler 1"
+tribe="atlanteans"
+ai=
+closeable="false"

=== added file 'maps/Tutorials/03_Seafaring.wmf/player_position'
--- maps/Tutorials/03_Seafaring.wmf/player_position	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/player_position	2014-10-17 09:40:17 +0000
@@ -0,0 +1,5 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
+[global]
+packet_version="2"
+player_1="41 43"

=== added file 'maps/Tutorials/03_Seafaring.wmf/port_spaces'
--- maps/Tutorials/03_Seafaring.wmf/port_spaces	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/port_spaces	2014-10-17 09:40:17 +0000
@@ -0,0 +1,11 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
+[global]
+packet_version="1"
+number_of_port_spaces="4"
+
+[port_spaces]
+0="85 5"
+1="37 27"
+2="102 36"
+3="41 43"

=== added directory 'maps/Tutorials/03_Seafaring.wmf/scripting'
=== added file 'maps/Tutorials/03_Seafaring.wmf/scripting/helper_functions.lua'
--- maps/Tutorials/03_Seafaring.wmf/scripting/helper_functions.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/scripting/helper_functions.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,28 @@
+-- =================
+-- Helper functions
+-- =================
+
+-- A copy of prefilled_buildings from scripting/infrastructure.lua, but with
+-- as much wares as possible, if not indicated otherwise
+function filled_buildings(p, ...)
+   for idx,bdescr in ipairs({...}) do
+      b = p:place_building(bdescr[1], wl.Game().map:get_field(bdescr[2],bdescr[3]), false, true)
+      -- Fill with workers
+      if b.valid_workers then b:set_workers(b.valid_workers) end
+      if bdescr.workers then b:set_workers(bdescr.workers) end
+      -- Fill with soldiers
+      if b.max_soldiers and b.set_soldiers then
+         if bdescr.soldiers then
+            b:set_soldiers(bdescr.soldiers)
+         else
+            b:set_soldiers({0,0,0,0}, b.max_soldiers)
+         end
+      elseif bdescr.soldiers then -- Must be a warehouse
+         b:set_soldiers(bdescr.soldiers)
+      end
+      -- Fill with wares
+      if bdescr.wares then b:set_wares(bdescr.wares)
+      elseif b.valid_wares then b:set_wares(b.valid_wares) end
+   end
+end
+

=== added file 'maps/Tutorials/03_Seafaring.wmf/scripting/init.lua'
--- maps/Tutorials/03_Seafaring.wmf/scripting/init.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/scripting/init.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,27 @@
+-- =======================================================================
+--                          Tutorial 03: Seafaring
+-- =======================================================================
+
+plr = wl.Game().players[1]
+map = wl.Game().map
+
+sf = map.player_slots[1].starting_field
+second_port_field = map:get_field(37,27)
+port_on_island = map:get_field(102,36)
+additional_port_space = map:get_field(85,5)
+
+set_textdomain("Seafaring.wmf")
+
+include "scripting/coroutine.lua"
+include "scripting/infrastructure.lua"
+include "scripting/messages.lua"
+include "scripting/table.lua"
+include "scripting/ui.lua"
+
+include "map:scripting/texts.lua"
+include "map:scripting/helper_functions.lua"
+
+include "map:scripting/starting_conditions.lua"
+
+include "map:scripting/mission_thread.lua"
+

=== added file 'maps/Tutorials/03_Seafaring.wmf/scripting/mission_thread.lua'
--- maps/Tutorials/03_Seafaring.wmf/scripting/mission_thread.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/scripting/mission_thread.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,84 @@
+-- ===============
+-- Mission thread
+-- ===============
+
+function introduction()
+   additional_port_space.terr = "wasser" -- disable the port space
+   sleep(1000)
+   message_box_objective(plr, intro_south)
+   sleep(300)
+   message_box_objective(plr, intro_north)
+   sleep(20000)
+
+   build_port()
+end
+
+function build_port()
+   sleep(200)
+   message_box_objective(plr, tell_about_port)
+
+   wl.ui.MapView().buildhelp = true -- so that the player sees the port building icon
+   local o = message_box_objective(plr, tell_about_port_building)
+
+   while #plr:get_buildings("port") < 2 do sleep(200) end
+   o.done = true
+
+   build_ships()
+end
+
+function build_ships()
+   sleep(200)
+   local o = message_box_objective(plr, tell_about_shipyard)
+   plr:allow_buildings{"shipyard"}
+
+   while #plr:get_buildings("shipyard") < 1 do sleep(200) end
+   o.done = true
+
+   local o = message_box_objective(plr, tell_about_ships)
+
+   -- we cannot check for ships yet (see https://bugs.launchpad.net/widelands/+bug/1380287), so we just wait some time and hope for the best
+   sleep(25*60*1000) -- 25 minutes
+   o.done = true
+
+   expedition()
+end
+
+function expedition()
+   sleep(200)
+   message_box_objective(plr, expedition1)
+   local o = message_box_objective(plr, expedition2)
+
+   -- again, we can only wait. Better a bit too long than too short
+   sleep(3*60*1000) -- 3 minutes
+   o.done = true
+
+   local o2 = message_box_objective(plr, expedition3)
+
+   while #plr:get_buildings("port") < 3 do sleep(200) end
+   o.done = true
+
+   -- places 5 signs with iron to show the player he really found some iron ore
+   local fields = map:get_field(97,35):region(3)
+   for i=1,5 do
+      local successful = false
+      while not successful do
+         local idx = math.random(#fields)
+         f = fields[idx]
+         if ((f.resource == "iron") and not f.immovable) then
+            map:place_immovable("resi_iron2",f,"atlanteans")
+            successful = true
+         end
+         table.remove(fields,idx)
+      end
+   end
+
+   conclude()
+end
+
+function conclude()
+   additional_port_space.terr = "desert_steppe" -- make it land again so that the player can build a port
+   message_box_objective(plr, conclusion)
+end
+
+run(introduction)
+

=== added file 'maps/Tutorials/03_Seafaring.wmf/scripting/starting_conditions.lua'
--- maps/Tutorials/03_Seafaring.wmf/scripting/starting_conditions.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/scripting/starting_conditions.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,163 @@
+-- ===============
+-- Initialization
+-- ===============
+
+plr:allow_buildings("all")
+
+function init_player()
+   filled_buildings(plr, {"port", sf.x, sf.y,
+      wares = {
+         diamond = 7,
+         ironore = 20,
+         quartz = 9,
+         stone = 50,
+         spideryarn = 9,
+         log = 80,
+         coal = 12,
+         goldyarn = 6,
+         iron = 12,
+         planks = 65,
+         spidercloth = 35,
+         blackroot = 5,
+         blackrootflour = 12,
+         bread = 28,
+         corn = 15,
+         cornflour = 12,
+         fish = 13,
+         meat = 13,
+         smoked_fish = 26,
+         smoked_meat = 26,
+         water = 12,
+         bread_paddle = 2,
+         bucket = 2,
+         fire_tongs = 2,
+         fishing_net = 4,
+         hammer = 11,
+         hunting_bow = 1,
+         milking_tongs = 2,
+         hook_pole = 2,
+         pick = 8,
+         saw = 9,
+         scythe = 4,
+         shovel = 9,
+         tabard = 15,
+         light_trident = 15,
+      },
+      workers = {
+         armorsmith = 1,
+         blackroot_farmer = 1,
+         builder = 10,
+         charcoal_burner = 1,
+         carrier = 40,
+         fish_breeder = 2,
+         geologist = 4,
+         miner = 3,
+         sawyer = 1,
+         stonecutter = 2,
+         toolsmith = 2,
+         weaponsmith = 1,
+         woodcutter = 3,
+         horse = 15,
+      },
+      soldiers = {
+         [{0,0,0,0}] = 35,
+      }
+   },
+   {"woodcutters_house", 32, 48},
+   {"woodcutters_house", 33, 47},
+   {"woodcutters_house", 29, 56},
+   {"woodcutters_house", 30, 57},
+   {"foresters_house", 31, 53},
+   {"foresters_house", 32, 46},
+   {"foresters_house", 32, 50},
+   {"foresters_house", 34, 50},
+   {"sawmill", 41, 46},
+   {"quarry",  45, 54},
+   {"tower", 43, 52},
+   {"tower", 35, 46},
+   {"guardhouse", 49, 60},
+   {"crystalmine", 51, 61},
+   {"guardhall", 43, 64},
+   {"fish_breeders_house", 40, 66},
+   {"fishers_house", 42, 66},
+   {"fish_breeders_house", 44, 66},
+   {"fishers_house", 46, 66},
+   {"fish_breeders_house", 48, 66},
+   {"castle", 22, 55},
+   {"coalmine", 22, 48},
+   {"coalmine", 16, 49},
+   {"farm", 20, 59},
+   {"farm", 23, 59},
+   {"farm", 19, 64},
+   {"farm", 21, 65},
+   {"farm", 26, 64},
+   {"blackroot_farm", 53, 53},
+   {"blackroot_farm", 56, 50},
+   {"mill", 34, 58},
+   {"mill", 32, 64},
+   {"bakery", 38, 49},
+   {"bakery", 40, 48},
+   {"smokery", 46, 57},
+   {"smokery", 44, 57},
+   {"horsefarm", 40, 55},
+   {"spiderfarm", 37, 45},
+   {"weaving-mill", 45, 45},
+   {"smelting_works", 35, 56, wares = {coal = 8, ironore = 8}}, -- no gold
+   {"smelting_works", 35, 59, wares = {coal = 8, ironore = 8}},
+   {"toolsmithy", 41, 52},
+   {"weaponsmithy", 37, 54},
+   {"small_tower", 34, 63},
+   {"tower", 52, 46},
+   {"well", 39, 43},
+   {"well", 39, 45},
+   {"well", 38, 55},
+   {"well", 35, 61},
+   {"well", 32, 59},
+   {"warehouse", 36, 57},
+
+   -- everthing below is in the north
+   {"castle", 36, 20},
+   {"warehouse", 37, 16,
+      wares = {
+         smoked_meat = 50,
+         smoked_fish = 150,
+         bread = 200,
+         log = 20,
+         planks = 13,
+         stone = 10,
+         diamond = 3,
+         quartz = 4,
+         spidercloth = 7,
+         gold = 2,
+      },
+      workers = {
+         builder = 3,
+         miner = 3
+      },
+      soldiers = {
+         [{0,0,0,0}] = 10,
+      }
+   }, -- end of warehouse on northern peninsula
+   {"goldmine", 32, 25}
+   )
+
+   plr:forbid_buildings{"shipyard"}
+
+   connected_road(plr,map:get_field(42,44).immovable,"bl,br,bl|bl,bl|bl,l|l,bl|l,l,l|l,l|tr,tl|r,tr")
+   connected_road(plr,map:get_field(42,44).immovable,"br,r|br,r,r|r,r,tr|r,r|r,r|br,bl|br,br|br,br|r,r")
+   connected_road(plr,map:get_field(35,47).immovable,"r,r,tr|r,r|br,r|br,br|br,br|br,bl|br,br,r|br,r|br,bl|br,br|br,r|r,br,r")
+   connected_road(plr,map:get_field(45,58).immovable,"r,r|bl,br,bl|bl,bl,l|bl,bl|bl,bl")
+   connected_road(plr,map:get_field(48,67).immovable,"l,l|l,l|l,l|l,l|l,tl|tl,tl|l,l,l|l,l,bl|l,tl,l|l,bl|l,l|bl,l,l|l,l|l,l,tl|tr,tr|tl,tr,tr|tr,tr|tr,tr|tr,tr|tr,tr|tr,tr|tr,tr|tr,tr|tr,tr|tr,r|r,r|r,r|br,br|br,r,r")
+   connected_road(plr,map:get_field(43,53).immovable,"l,l|br,bl,bl|l,l|l,tl|bl,l,bl|bl,bl|br,r|br,bl|bl,bl")
+   connected_road(plr,map:get_field(17,50).immovable,"r,r|r,r|tr,r|br,r|br,br|r,br|br,br|br,br,r|br,r|bl,br|r,r|tr,r")
+   connected_road(plr,map:get_field(24,60).immovable,"l,l,l")
+   connected_road(plr,map:get_field(54,54).immovable,"tr,tr,tl")
+   connected_road(plr,map:get_field(42,44).immovable,"l,l|l,tl|l,l|l,l")
+   connected_road(plr,map:get_field(37,58).immovable,"bl,bl")
+   connected_road(plr,map:get_field(41,47).immovable,"r,tr,tr")
+
+   connected_road(plr,map:get_field(33,26).immovable,"r,tr|tr,tr|tr,tr|tr,tr|tl,tr")
+end
+
+run(init_player)
+

=== added file 'maps/Tutorials/03_Seafaring.wmf/scripting/texts.lua'
--- maps/Tutorials/03_Seafaring.wmf/scripting/texts.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/scripting/texts.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,191 @@
+-- =======================================================================
+--                      Texts for the tutorial mission
+-- =======================================================================
+
+-- =========================
+-- Some formating functions
+-- =========================
+
+include "scripting/formatting.lua"
+include "scripting/format_scenario.lua"
+
+
+-- =============
+-- Texts below
+-- =============
+
+intro_south = {
+   position = "topright",
+   field = wl.Game().map.player_slots[1].starting_field,
+   title = _"Seafaring",
+   body = rt(
+      h1(_"Seafaring Tutorial") ..
+      p(_[[Welcome back. In this tutorial, you are going to learn the most important things about seafaring, that is ships, ports, and expedition.]]) ..
+      p([[]]) .. -- empty line
+      p(_[[But let me first give you an overview about your territory: Here in the south, you have a whole economy with almost everything you need.]])
+   ),
+   h = 300
+}
+
+intro_north = {
+   position = "topright",
+   field = wl.Game().map:get_field(36,20), -- field of the castle
+   title = _"The Northern Part",
+   body = rt(
+      p(_[[Here in the northern part, you only have a goldmine and a warehouse. While the miners are supplied well with food, there is no way to bring the goldores to our smelting works in the southern part.]]) ..
+      p(_[[We have tried to build a road, but the mountain is too wide and too steep. We have therefore only one possibility: We need to establish a ship route between those two parts.]]) ..
+      p(_[[But I don't want to rush you: You have just arrived here and you would probably like to have a closer look at your camp. I will also take a short break and be back soon.]])
+   ),
+   h = 350
+}
+
+tell_about_port = {
+   position = "topright",
+   title = _"Ports",
+   body = rt(
+      h1(_"Ports") ..
+      p(_[[For everything you do on the high seas, you need a port at the shore. Ports are like headquarters: They can store wares, workers and soldiers. The soldiers inside will automatically come out when an enemy attacks the port.]]) ..
+      p(_[[But ports offer the possibility to transport wares via ships. When you click on the port you already have, you will notice two additional tabs: Wares and workers in the dock. They are waiting for a ship to transport them to another port. Currently, there are none because we have not yet built a second port. So let's change this!]])
+   ),
+   h = 350
+}
+
+tell_about_port_building = {
+   position = "topright",
+   field = second_port_field,
+   title = _"Building ports",
+   body = rt(
+      h1(_"How to build a port?") ..
+      p(_[[Ports are big buildings, but they can only be built at special locations: Those marked with the]])
+   ) ..
+   rt("image=pics/port.png", p(_[[blue port space icon.]])) ..
+   rt(
+      p(_[[Port spaces are set by the map designer, so a map either contains them or not. They might, however, be hidden under trees or be blocked by surrounding buildings.]]) ..
+      p(_[[You might already have noticed that you have such an icon next to your castle.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Build a port in the northern part of your camp.]])
+   ),
+   obj_name = "build_port",
+   obj_title = _"Build a port in the northern part of your camp.",
+   obj_body = rt(
+      h1(_"Build a port") ..
+      p(_[[You always need a port when you want to transport wares with a ship.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Build a port next to your castle, on the blue port space icon.]]) ..
+      listitem_arrow(_[[Ports are built like normal buildings, but are only available on blue port spaces. Just click on a field with the icon and the building menu automatically offers you to build a port.]]) ..
+      listitem_arrow(_[[Although ports act as warehouses, you should not build more than necessary: They cost quartz, diamonds and gold, which makes them quite expensive.]])
+   ),
+}
+
+tell_about_shipyard = {
+   position = "topright",
+   title = _"Constructing ships",
+   body = rt(
+      h1(_"Let's build ships") ..
+      p(_[[Great. Your port has just been finished. Now we have to take care of ships.]]) ..
+      p(_[[Ships are constructed in a shipyard by a shipwright. We have to build one somewhere close to the shore. You should do it in your main camp because only this provides the needed materials.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Build a shipyard at the cost. It is a medium building.]])
+   ),
+   h = 300,
+   obj_name = "build_shipyard",
+   obj_title = _"Build a shipyard",
+   obj_body = rt(
+      h1(_"Build a shipyard") ..
+      p(_[[Ships are produced in a shipyard.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Build a shipyard close to the shore of the southern part of your territory.]]) ..
+      listitem_arrow(_[[The shipyard is a medium building. Although it can be built everywhere on the map, the shipwright only works when he is close to the water and there are not trees or roads at the coast.]])
+   ),
+}
+
+tell_about_ships = {
+   position = "topright",
+   title = _"Constructing ships",
+   body = rt(
+      h1(_"Waiting for the ships") ..
+      p(_[[Very good. Your shipyard is finished and your shipwright immediately starts working. For the construction of ships, he needs logs, planks and spidercloth, which will be transported to the shipyard. The shipwright takes the ware he needs to a free spot at the coast and builds a ships there. When the first ship is finished, it will drive onto the sea and the shipwright will construct another one.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[We should wait until we have two ships. That should be enough for now.]]) ..
+      listitem_arrow(_[[You need to stop your shipyard when you have enough ships. Otherwise, your shipwright will consume all your logs and spidercloth, producing dozens of ships.]])
+   ) ..
+   rt("image=pics/stop.png",p(_[[This is the icon. You find it in the building window.]])),
+   obj_name = "wait_for_ships",
+   obj_title = _"Construct two ships",
+   obj_body = rt(
+      p(_[[Ships are constructed automatically when the shipyard is complete and the needed wares have been delivered.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Wait until the shipwright has constructed two ships.]]) ..
+      listitem_arrow(_[[Do not forget to stop your shipyard when you have enough ships.]])
+   )
+}
+
+expedition1 = {
+   position = "topright",
+   title = _"No Iron",
+   body = rt(
+      h1(_"We lack iron") ..
+      p(_[[The second ship might not finished yet, but we have an urgent problem.]]) ..
+      p(_[[As you surely have already noticed, there is no iron in the mountain in the west. We have plenty of coal and goldores, but without ironores, we cannot produce any tools.]]) ..
+      p(_[[Although it might take long and is expensive and not without dangers (who knows what monsters live in the sea?), I see no other possibility: We have to make an expedition into the unknown seas.]])
+   ),
+   h = 300
+}
+
+expedition2 = {
+   position = "topright",
+   -- TRANSLATORS: This shall be the beginning of a poem
+   title = _"A trip by the sea what fun it can be",
+   body = rt(
+      h1(_"Expeditions") ..
+      p(_[[In an expedition, you send a ship out to discover new islands and maybe found a colony there.]])
+   ) ..
+   rt("image=pics/start_expedition.png",p(_[[Expeditions can be started in every port. Then, all needed wares are transported to that port. The wares are exactly those your tribe needs to build a port (you build a port far away from home, so that is not surprising), and of course you need a builder, too. When everything is prepared, a ship will come and pick it up. You can check out the missing wares in the fifth tab of your port (it will appear when you've started an expedition).]]) ..
+      p(_[[Now try this out. I will tell you later what are the next steps.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Start an expedition in any of your ports.]])
+   ),
+   obj_name = "start_expedition",
+   obj_title = _"Start an expedition",
+   obj_body = rt(
+      paragraphdivider() ..
+      listitem_bullet(_[[Start an expedition.]])
+   ) ..
+   rt("image=pics/start_expedition.png",p(_[[To do so, click on the 'Start Expedition' button in any port. A new tab where you can see the needed wares will appear.]])
+   )
+}
+
+expedition3 = {
+   position = "topright",
+   title = _"Off to new pastures",
+   body = rt(
+      h1(_"The ship is ready") ..
+      p(_[[Your expedition should be ready about now. (If not, please wait some more time. You will receive a message.) Your ship is waiting for your orders in front of your port. It does not transport wares anymore. The control is self-explanatory: You can send your ship in any of the six main directions of the Widelands map. When it has reached a coast, you can make it travel around the coast, where it looks for suitable places for landing. With the button in the centre of the ship's control window, you can construct a port.]]) ..
+      p(_[[The wares will then be unloaded and the ship takes the task of transporting wares again. The builder will start his work and build a port.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Search for an island with a mountain, and look for a port space there. Colonize the island.]])
+   ),
+   obj_name = "found_settlement",
+   obj_title = _"Found a settlement",
+   obj_body = rt(
+      paragraphdivider() ..
+      listitem_bullet(_[[Navigate your ship to an island that could contain ironore.]]) ..
+      listitem_arrow(_[[When you click on the expedition ship, a window opens where you can control your ship.]]) ..
+      listitem_bullet(_[[When you have found a suitable port space, build a port there.]])
+   )
+}
+
+conclusion = {
+   position = "topright",
+   field = port_on_island,
+   title = _"Conclusion",
+   body = rt(
+      h1(_"Congratulations") ..
+      p(_[[You've lead the expedition to a successful end and founded a new colony. I've sent out some geologists - they already report that they've found some ironore.]]) ..
+      p(_[[In this scenario, you've learned everything about seafaring: how to build ports and ships and how to send out an expedition. Remember that expeditions are sometimes the fastest way to reach essentially needed resources - and sometimes the only one.]]) ..
+      p(_[[But I want to speak a word of warning. Ports are like headquarters: They can be attacked by a nearby enemy. While your headquarters has soldiers to defend, your newly built port hasn't. You should therefore avoid to settle next to an enemy.]]) ..
+      p(_[[On this map, there is no enemy to fear. As always, you can continue playing and watch how the ships deliver wares to the island when you construct some buildings here. There is also another island where you can build a port.]])
+   ),
+   h = 450
+}
+

=== added file 'maps/Tutorials/03_Seafaring.wmf/version'
--- maps/Tutorials/03_Seafaring.wmf/version	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/03_Seafaring.wmf/version	2014-10-17 09:40:17 +0000
@@ -0,0 +1,11 @@
+# Automatically created by Widelands bzr7199[trunk] (Release)
+
+[global]
+map_source_url=
+map_release=
+map_creator_version="bzr7168[trunk]"
+map_version_major="0"
+map_version_minor="6"
+map_version_timestamp="1413124387"
+packet_version="1"
+packet_compatibility="1"

=== added directory 'maps/Tutorials/04_Economy.wmf'
=== added directory 'maps/Tutorials/04_Economy.wmf/binary'
=== added file 'maps/Tutorials/04_Economy.wmf/binary/building'
Binary files maps/Tutorials/04_Economy.wmf/binary/building	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/binary/building	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/binary/exploration'
Binary files maps/Tutorials/04_Economy.wmf/binary/exploration	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/binary/exploration	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/binary/flag'
Binary files maps/Tutorials/04_Economy.wmf/binary/flag	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/binary/flag	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/binary/heights'
Binary files maps/Tutorials/04_Economy.wmf/binary/heights	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/binary/heights	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/binary/mapobjects'
Binary files maps/Tutorials/04_Economy.wmf/binary/mapobjects	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/binary/mapobjects	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/binary/node_ownership'
Binary files maps/Tutorials/04_Economy.wmf/binary/node_ownership	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/binary/node_ownership	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/binary/resource'
Binary files maps/Tutorials/04_Economy.wmf/binary/resource	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/binary/resource	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/binary/road'
Binary files maps/Tutorials/04_Economy.wmf/binary/road	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/binary/road	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/binary/terrain'
Binary files maps/Tutorials/04_Economy.wmf/binary/terrain	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/binary/terrain	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/elemental'
--- maps/Tutorials/04_Economy.wmf/elemental	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/elemental	2014-10-17 09:40:17 +0000
@@ -0,0 +1,10 @@
+# Automatically created by Widelands bzr7194[trunk] (Release)
+
+[global]
+packet_version="1"
+map_w="144"
+map_h="112"
+nr_players="2"
+name=_"Economy"
+author="wl-zocker"
+descr=_"In this tutorial, you learn what option Widelands offers to adjust your economy. Recommended for players with some experience."

=== added file 'maps/Tutorials/04_Economy.wmf/extra_data'
--- maps/Tutorials/04_Economy.wmf/extra_data	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/extra_data	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7194[trunk] (Release)
+
+[global]
+packet_version="1"

=== added file 'maps/Tutorials/04_Economy.wmf/objective'
--- maps/Tutorials/04_Economy.wmf/objective	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/objective	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7194[trunk] (Release)
+
+[global]
+packet_version="2"

=== added directory 'maps/Tutorials/04_Economy.wmf/player'
=== added directory 'maps/Tutorials/04_Economy.wmf/player/1'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/messages'
--- maps/Tutorials/04_Economy.wmf/player/1/messages	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/player/1/messages	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7194[trunk] (Release)
+
+[global]
+packet_version="1"

=== added directory 'maps/Tutorials/04_Economy.wmf/player/1/view'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/border_1'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/node_immovable_kinds_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/node_immovables_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/owners_0'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/roads_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/survey_amounts_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/survey_times_1'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/surveys_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/terrains_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/triangle_immovable_kinds_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/triangle_immovables_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/unseen_times_1'
=== added file 'maps/Tutorials/04_Economy.wmf/player/1/view/vision_1'
Binary files maps/Tutorials/04_Economy.wmf/player/1/view/vision_1	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/player/1/view/vision_1	2014-10-17 09:40:17 +0000 differ
=== added directory 'maps/Tutorials/04_Economy.wmf/player/2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/messages'
--- maps/Tutorials/04_Economy.wmf/player/2/messages	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/player/2/messages	2014-10-17 09:40:17 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands bzr7194[trunk] (Release)
+
+[global]
+packet_version="1"

=== added directory 'maps/Tutorials/04_Economy.wmf/player/2/view'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/border_1'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/node_immovable_kinds_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/node_immovables_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/owners_0'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/roads_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/survey_amounts_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/survey_times_1'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/surveys_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/terrains_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/triangle_immovable_kinds_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/triangle_immovables_2'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/unseen_times_1'
=== added file 'maps/Tutorials/04_Economy.wmf/player/2/view/vision_1'
Binary files maps/Tutorials/04_Economy.wmf/player/2/view/vision_1	1970-01-01 00:00:00 +0000 and maps/Tutorials/04_Economy.wmf/player/2/view/vision_1	2014-10-17 09:40:17 +0000 differ
=== added file 'maps/Tutorials/04_Economy.wmf/player_names'
--- maps/Tutorials/04_Economy.wmf/player_names	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/player_names	2014-10-17 09:40:17 +0000
@@ -0,0 +1,16 @@
+# Automatically created by Widelands bzr7194[trunk] (Release)
+
+[global]
+packet_version="2"
+
+[player_1]
+name="Spieler 1"
+tribe="empire"
+ai=
+closeable="false"
+
+[player_2]
+name="Spieler 2"
+tribe="atlanteans"
+ai=
+closeable="false"

=== added file 'maps/Tutorials/04_Economy.wmf/player_position'
--- maps/Tutorials/04_Economy.wmf/player_position	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/player_position	2014-10-17 09:40:17 +0000
@@ -0,0 +1,6 @@
+# Automatically created by Widelands bzr7194[trunk] (Release)
+
+[global]
+packet_version="2"
+player_1="96 53"
+player_2="39 89"

=== added file 'maps/Tutorials/04_Economy.wmf/port_spaces'
--- maps/Tutorials/04_Economy.wmf/port_spaces	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/port_spaces	2014-10-17 09:40:17 +0000
@@ -0,0 +1,7 @@
+# Automatically created by Widelands bzr7194[trunk] (Release)
+
+[global]
+packet_version="1"
+number_of_port_spaces="0"
+
+[port_spaces]

=== added directory 'maps/Tutorials/04_Economy.wmf/scripting'
=== added file 'maps/Tutorials/04_Economy.wmf/scripting/helper_functions.lua'
--- maps/Tutorials/04_Economy.wmf/scripting/helper_functions.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/scripting/helper_functions.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,29 @@
+-- =================
+-- Helper functions
+-- =================
+
+-- A copy of prefilled_buildings from scripting/infrastructure.lua, but with
+-- as much wares as possible, if not indicated otherwise, and only one soldier
+function filled_buildings_one_soldier(p, ...)
+   for idx,bdescr in ipairs({...}) do
+      b = p:place_building(bdescr[1], wl.Game().map:get_field(bdescr[2],bdescr[3]), false, true)
+      -- Fill with workers
+      if b.valid_workers then b:set_workers(b.valid_workers) end
+      if bdescr.workers then b:set_workers(bdescr.workers) end
+      -- Fill with soldiers
+      if b.max_soldiers and b.set_soldiers then
+         if bdescr.soldiers then
+            b:set_soldiers(bdescr.soldiers)
+         else
+            -- TODO(codereview): this creates "1 soldier (+4)", but I want a capacity of 1 (i.e. "1 soldier")
+            b:set_soldiers({0,0,0,0}, 1)
+         end
+      elseif bdescr.soldiers then -- Must be a warehouse
+         b:set_soldiers(bdescr.soldiers)
+      end
+      -- Fill with wares
+      if bdescr.wares then b:set_wares(bdescr.wares)
+      elseif b.valid_wares then b:set_wares(b.valid_wares) end
+   end
+end
+

=== added file 'maps/Tutorials/04_Economy.wmf/scripting/init.lua'
--- maps/Tutorials/04_Economy.wmf/scripting/init.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/scripting/init.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,30 @@
+-- =======================================================================
+--                          Tutorial 04: Economy
+-- =======================================================================
+
+plr = wl.Game().players[1]
+plr2 = wl.Game().players[2]
+
+map = wl.Game().map
+mv = wl.ui.MapView()
+
+tavern_field = map:get_field(105,44)
+warehouse_field = map:get_field(78,67)
+
+sf = map.player_slots[1].starting_field
+
+set_textdomain("economy.wmf")
+
+include "scripting/coroutine.lua"
+include "scripting/infrastructure.lua"
+include "scripting/messages.lua"
+include "scripting/table.lua"
+include "scripting/ui.lua"
+
+include "map:scripting/helper_functions.lua"
+include "map:scripting/texts.lua"
+
+include "map:scripting/starting_conditions.lua"
+
+include "map:scripting/mission_thread.lua"
+

=== added file 'maps/Tutorials/04_Economy.wmf/scripting/mission_thread.lua'
--- maps/Tutorials/04_Economy.wmf/scripting/mission_thread.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/scripting/mission_thread.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,140 @@
+-- ===============
+-- Mission thread
+-- ===============
+
+function introduction()
+   sleep(500)
+   message_box_objective(plr, intro1)
+   message_box_objective(plr, intro2)
+
+   burn_tavern_down()
+end
+
+function burn_tavern_down()
+   sleep(500)
+   scroll_smoothly_to(tavern_field)
+   sleep(250)
+   tavern_field.immovable:destroy()
+   sleep(50)
+   message_box_objective(plr, tavern_burnt_down)
+   sleep(2000)
+   local o = message_box_objective(plr, building_stat)
+   -- wait for the window to open and close
+   while not mv.windows.building_statistics do sleep(100) end
+   -- we cannot check whether the user scrolled, so let's hope he does it
+   while mv.windows.building_statistics do sleep(100) end
+   o.done = true
+
+   sleep(2000)
+   o = message_box_objective(plr, inventory1)
+   while not mv.windows.stock_menu do sleep(200) end
+   o.done = true
+
+   o = message_box_objective(plr, inventory2)
+   -- We cannot create several objectives with the same name. Therefore, we create o2 here once and change its visibility
+   local o2 = _try_add_objective(reopen_stock_menu_obj)
+   o2.visible = false
+   while not o.done do
+      if not mv.windows.stock_menu then
+         o2.visible = true
+         message_box_objective(plr, reopen_stock_menu)
+         while not mv.windows.stock_menu do sleep(200) end
+         o2.visible = false
+      end
+      if mv.windows.stock_menu.tabs["wares_in_warehouses"].active then o.done = true end
+      sleep(200)
+   end
+
+   message_box_objective(plr, inventory3)
+
+   sleep(2000)
+   o = message_box_objective(plr, build_taverns)
+
+   sleep(100*1000)
+   message_box_objective(plr, ware_encyclopedia) -- a small insert
+
+   while #plr:get_buildings("tavern") < 2 do sleep(500) end
+   o.done = true
+
+   plan_the_future()
+end
+
+function plan_the_future()
+   sleep(2000)
+   message_box_objective(plr, building_priority_settings)
+   sleep(30*1000) -- give the user time to try it out
+
+   local o = message_box_objective(plr, ware_stats1)
+   while not mv.windows.ware_statistics do sleep(200) end
+   o.done = true
+
+   o = message_box_objective(plr, ware_stats2)
+   local o2 = _try_add_objective(reopen_ware_stats1_obj)
+   o2.visible = false
+   while not o.done do
+      if not mv.windows.ware_statistics then
+         o2.visible = true
+         message_box_objective(plr, reopen_ware_stats1)
+         while not mv.windows.ware_statistics do sleep(200) end
+         o2.visible = false
+      end
+      if mv.windows.ware_statistics.tabs["economy_health"].active then o.done = true end
+      sleep(200)
+   end
+
+   o = message_box_objective(plr, ware_stats3)
+   o2 = _try_add_objective(reopen_ware_stats2_obj)
+   o2.visible = false
+   while not o.done do
+      if not mv.windows.ware_statistics then
+         o2.visible = true
+         message_box_objective(plr, reopen_ware_stats2)
+         while not mv.windows.ware_statistics do sleep(200) end
+         o2.visible = false
+      end
+      if mv.windows.ware_statistics.tabs["stock"].active then o.done = true end
+      sleep(200)
+   end
+
+   o = message_box_objective(plr, ware_stats4)
+   while mv.windows.ware_statistics do sleep(500) end
+   o.done = true
+
+   sleep(2000)
+
+   o = message_box_objective(plr, economy_settings1)
+   while not mv.windows.economy_options do sleep(200) end
+   o.done = true
+   message_box_objective(plr, economy_settings2)
+   o = message_box_objective(plr, economy_settings3)
+
+   while sf.immovable:get_wares("marblecolumn") < 12 do sleep(500) end
+   -- wait that the player has really changed the target quantity
+
+   o.visible = false
+   -- just forget about the old objective, the new one includes the old one
+   o = message_box_objective(plr, warehouse_preference_settings)
+
+   local enough_wares = false
+   while not enough_wares do
+      if (warehouse_field.immovable and (warehouse_field.immovable.descr.name == "warehouse")) then
+         if warehouse_field.immovable:get_wares("marblecolumn") >= 20 then
+            enough_wares = true
+         end
+      end
+      sleep(500)
+   end
+   o.done = true
+
+   -- if the minimum_storage_per_warehouse feature is introduced, use the gold mountain to the northeast for explanation
+   conclude()
+end
+
+function conclude()
+   message_box_objective(plr, conclusion)
+end
+
+
+run(init_player)
+run(introduction)
+

=== added file 'maps/Tutorials/04_Economy.wmf/scripting/starting_conditions.lua'
--- maps/Tutorials/04_Economy.wmf/scripting/starting_conditions.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/scripting/starting_conditions.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,171 @@
+-- ===============
+-- Initialization
+-- ===============
+
+plr:forbid_buildings{"scouts_house"} -- otherwise, player could scout and attack the enemy when he should not
+
+function init_player()
+   -- a headquarters without helms, lances, ores and coal
+   prefilled_buildings(plr, { "headquarters", sf.x, sf.y,
+      wares = {
+         ax = 6,
+         bread_paddle = 2,
+         basket = 2,
+         bread = 28,
+         cloth = 5,
+         fire_tongs = 2,
+         fish = 6,
+         fishing_rod = 2,
+         flour = 34,
+         grape = 4,
+         hammer = 14,
+         hunting_spear = 2,
+         kitchen_tools = 4,
+         marble = 25,
+         marblecolumn = 6,
+         meal = 4,
+         meat = 6,
+         pick = 8,
+         ration = 5,
+         saw = 2,
+         scythe = 5,
+         shovel = 6,
+         stone = 40,
+         log = 60,
+         water = 12,
+         wheat = 24,
+         wine = 8,
+         wood = 45,
+         wool = 2,
+      },
+      workers = {
+         armorsmith = 1,
+         brewer = 1,
+         builder = 10,
+         carrier = 40,
+         charcoal_burner = 1,
+         geologist = 4,
+         lumberjack = 3,
+         miner = 4,
+         stonemason = 2,
+         toolsmith = 2,
+         weaponsmith = 1,
+         donkey = 5,
+      }
+   })
+
+   filled_buildings_one_soldier(plr,
+      {"lumberjacks_house",92,65},
+      {"lumberjacks_house",89,52},
+      {"foresters_house",90,54},
+      {"foresters_house",91,56},
+      {"lumberjacks_house",92,57},
+      {"foresters_house",93,59},
+      {"lumberjacks_house",93,61},
+      {"quarry",99,57},
+      {"quarry",89,38},
+      {"sawmill",91,53},
+      {"stonemasons_house",92,50},
+      {"donkeyfarm",96,58},
+      {"farm",88,48},
+      {"farm",91,38},
+      {"farm",94,39},
+      {"farm",88,34},
+      {"vineyard",97,49},
+      {"vineyard",100,50},
+      {"vineyard",103,50},
+      {"vineyard",103,56},
+      {"winery",101,52},
+      {"winery",101,57},
+      {"brewery",106,49},
+      {"brewery",104,49},
+      {"piggery",110,23},
+      {"piggery",113,21},
+      {"warehouse",110,29,
+         wares = {
+            wheat = 20,
+            flour = 20
+         }
+      },
+      {"mill",105,46},
+      {"mill",107,44},
+      {"mill",108,39},
+      {"bakery",114,26},
+      {"bakery",116,28},
+      {"bakery",115,32},
+      {"tavern",tavern_field.x,tavern_field.y}, -- (105,44), will be destroyed
+      {"coalmine",118,45, wares = {beer = 6}},
+      {"coalmine",119,39, wares = {beer = 6}},
+      {"oremine",107,59, wares = {beer = 6}},
+      {"marblemine",98,38, wares = {wine = 6}},
+      {"marblemine",102,38, wares = {wine = 6}},
+      {"smelting_works",110,38, wares = {}},
+      {"smelting_works",111,43, wares = {}},
+      {"toolsmithy",104,64, wares = {log = 8}},
+      {"weaponsmithy",113,40, wares = {wood = 8}},
+      {"armorsmithy",112,37, wares = {cloth = 8}},
+      {"farm",105,70},
+      {"farm",101,71},
+      {"farm",99,77},
+      {"fishers_house",106,77},
+      {"fishers_house",104,77},
+      {"fishers_house",103,79},
+      {"warehouse",100,74},
+      {"hunters_house",95,60},
+      {"well",92,48},
+      {"well",103,45},
+      {"well",107,40},
+      {"well",103,47},
+      {"well",104,51},
+      {"well",106,51},
+      {"well",113,23},
+      {"well",113,32},
+      {"well",112,34},
+      {"well",111,31},
+      {"well",115,24},
+      {"warehouse",warehouse_field.x,warehouse_field.y}, -- (78,67)
+
+      {"barracks",89,31},
+      {"barrier",91,45},
+      {"tower",103,42},
+      {"barrier",112,25},
+      {"sentry",116,41},
+      {"barracks",102,66},
+      {"outpost",103,76},
+      {"tower",90,67},
+      {"sentry",105,56},
+      {"fortress",66,63},
+      {"fortress",71,66},
+      {"fortress",75,72}
+   )
+   plr:conquer(map:get_field(111,34),3) -- some remaining fields inside
+
+   connected_road(plr,map:get_field(97,54).immovable,"tr,tr|tr,tl")
+   connected_road(plr,map:get_field(98,52).immovable,"br,r|r,r|tr,r,tr|tr,r|r,r|tr,tr|tr,tr|tr,tr|r,r|r,r|r,r|br,br|r,r")
+   connected_road(plr,map:get_field(99,53).immovable,"tr,tr|tr,tr|tl,tr|tr,tr|tr,tr|tr,tl|tl,tl|l,l|l,l|l,l|l,bl")
+   connected_road(plr,map:get_field(97,54).immovable,"bl,br|br,bl,bl|bl,bl|bl,l|bl,bl|br,bl|bl,bl,l|l,l|l,l|l,l|l,l|l,l|l,l|l,l|l,l|l,l|l,tl|l,l|l,tl|tl,tl")
+   connected_road(plr,map:get_field(97,56).immovable,"r,br|br,r|r,r|r,tr|r,r|br,br|br,r")
+   connected_road(plr,map:get_field(97,54).immovable,"l,l|l,tl|tl,tl|bl,l|l,bl")
+   connected_road(plr,map:get_field(88,49).immovable,"br,br|r,br")
+   connected_road(plr,map:get_field(92,51).immovable,"tr,tl|tr,tl,tl|tr,tr|tr,tr|tr,tr")
+   connected_road(plr,map:get_field(94,42).immovable,"tl,l|tl,tl|l,l|l,tl,tl|tr,tr|tr,tr,tr")
+   connected_road(plr,map:get_field(75,73).immovable,"tr,tr|tr,r|tr,tr")
+   connected_road(plr,map:get_field(92,54).immovable,"tr,r")
+   connected_road(plr,map:get_field(93,58).immovable,"tr,tr|tr,tr")
+   connected_road(plr,map:get_field(102,45).immovable,"br,r|br,r|br,bl,bl")
+   connected_road(plr,map:get_field(105,47).immovable,"tr,tl|r,r|br,r")
+   connected_road(plr,map:get_field(116,44).immovable,"tr,tr|tr,tr|r,r")
+   connected_road(plr,map:get_field(105,45).immovable,"tr,tr|tr,tr|r,tr|tr,r|tr,tr|tr,tr|tr,tr|r,r|tr,tr|tr,tl|l,tl,tl|l,tl|l,tl,tl")
+   connected_road(plr,map:get_field(114,22).immovable,"br,bl|bl,bl|bl,bl|bl,bl|bl,bl|bl,bl|bl,bl|bl,bl|bl,bl|bl,bl|bl,l")
+   connected_road(plr,map:get_field(105,42).immovable,"br,r")
+   connected_road(plr,map:get_field(111,37).immovable,"br,r|r,br|bl,bl|bl,bl,bl")
+   connected_road(plr,map:get_field(106,59).immovable,"bl,bl|bl,br|bl,bl|l,bl,bl|bl,br|br,br|r,r|br,bl|br,br|br,br,bl|l,l|bl,bl|l,tl|tl,tl|tl,tl|tr,tr,tr|tr,r")
+   connected_road(plr,map:get_field(100,78).immovable,"tr,r|r,r")
+   connected_road(plr,map:get_field(104,48).immovable,"r,tr")
+   connected_road(plr,map:get_field(105,52).immovable,"tr,tl")
+   connected_road(plr,map:get_field(107,52).immovable,"tr,tl")
+   connected_road(plr,map:get_field(112,32).immovable,"l,l")
+   connected_road(plr,map:get_field(115,25).immovable,"bl,bl")
+   connected_road(plr,map:get_field(97,54).immovable,"r,r,tr")
+end
+

=== added file 'maps/Tutorials/04_Economy.wmf/scripting/texts.lua'
--- maps/Tutorials/04_Economy.wmf/scripting/texts.lua	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/scripting/texts.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,413 @@
+-- =======================================================================
+--                      Texts for the tutorial mission
+-- =======================================================================
+
+-- =========================
+-- Some formating functions
+-- =========================
+
+include "scripting/formatting.lua"
+include "scripting/format_scenario.lua"
+
+
+-- =============
+-- Texts below
+-- =============
+
+intro1 = {
+   title = _"Economy and its settings",
+   body = rt(
+      h1(_[[Economy]]) ..
+      p(_[[Welcome back. In this tutorial, I'll tell you what you can do to check how well your economy works.]]) ..
+      p(_[[Building your economy up and making it work well and grow is the main part of Widelands. But you can't control the workers directly - they follow the frame conditions you set.]]) ..
+      p(_[[That is what I'll show you in this tutorial: What action can you take to define those frame conditions?]])
+   ),
+   h = 300
+}
+
+intro2 = {
+   position = "topright",
+   field = wl.Game().map:get_field(69,66), -- somewhere near the border
+   title = _"A peaceful land",
+   body = rt(
+      p(_[[Now about the map: You settled in a nice valley between two mountains, rich in marble, iron ore and coal. All were hoping for a peaceful life.]]) ..
+      p(_[[But one day, you discovered a barren, waste land with abandoned buildings in the east. A strange aura came from there, and no one wanted to set a foot there. But the border could not be let undefended, and so you have three castles constructed.]]) ..
+      p(_[[You you have not been prepared for a war, and so you have to hurry to build up an army.]])
+   ),
+   h = 300
+}
+
+tavern_burnt_down = {
+   position = "topright",
+   title = _"The tavern is burning!",
+   body = rt(
+      h1(_[[An accident]]) ..
+      p(_[[Oh no, look at this: Our tavern is burning! In all the hurry, our innkeeper accidentally dropped a torch. She is fine, but we could not extinguish the fire in time.]])
+   ),
+   w = 300,
+   h = 250
+}
+
+building_stat = {
+   position = "topright",
+   title = _"Building statistics",
+   body = rt(
+      h1(_[[Check for your taverns]]) ..
+      p(_[[At first, we should check how many taverns we currently have. Widelands offers you a list where you can easily check this.]])
+   ) ..
+   rt("image=pics/menu_toggle_menu.png",p(_[[At first, you have to open the statistics menu (you can find the corresponding button at the bottom). We will need this menu several times.]])) ..
+   rt("image=pics/menu_building_stats.png",p(_[[Afterwards, choose the 'Building statistics'.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Open the building statistic menu.]]) ..
+      listitem_bullet(_[[When you have looked up the number of taverns, close it.]])
+   ),
+   h = 350,
+   obj_name = "open_building_stat",
+   obj_title = _"Look the number of taverns up in the building statistics window.",
+   obj_body =
+      rt("image=pics/menu_building_stats.png", p(_[[The building statistics window gives you an overview over the buildings you have.]])) ..
+   rt(
+      paragraphdivider() ..
+      -- TRANSLATORS: "it" refers to the building statistic window
+      listitem_bullet(_[[Open it. You can access it from the statistic window.]]) ..
+      listitem_arrow(_[[The statistic window is accessible via the second button at the bottom. It provides several menus that give you information about the game.]]) ..
+      listitem_bullet(_[[Look how many taverns you have (in the column 'Owned')]]) ..
+      listitem_bullet(_[[Close the building statistics window when you are done.]])
+   )
+}
+
+inventory1 = {
+   position = "topright",
+   title = _"Stock",
+   body = rt(
+      h1(_[[Check for your rations]]) ..
+      p(_[[Ok. In the list, you've seen that you have no more taverns or inns. That means that you're not producing any rations. But let's see what we've still in stock.]])
+   ) ..
+   rt("image=pics/menu_stock.png",p(_[[Click on the 'Stock' button.]])) ..
+   rt(
+      paragraphdivider() ..
+      listitem_arrow(_[[You can also use the hotkey 'i' (like inventory) to accesss this menu quickly.]])
+   ),
+   h = 300,
+   obj_name = "open_inventory",
+   obj_title = _"Open your stock window.",
+   obj_body = rt(
+      p(_[[The stock window gives you an overview over the wares you have.]]) ..
+      paragraphdivider() ..
+      -- TRANSLATORS: "it" refers to the stock window
+      listitem_bullet(_[[Open it. You can access it from the statistic window.]]) ..
+      listitem_arrow(_[[The statistic window is accessible via the second button at the bottom. It provides several menus that give you information about the game.]])
+   )
+}
+
+inventory2 = {
+   title = _"Stock",
+   body = rt(
+      p(_[[The stock window has four tabs. The first (and currently selected) one shows you all the wares you have, including those on the roads, at the flags and inside the buildings waiting for processing.]]) ..
+      p(_[[Looking at the rations, there are currently five ones in total, probably on the way to somewhere. Five rations are not much for such a big economy.]]) ..
+      p(_[[The second tab shows you all your workers, again those on the roads and in the buidlings summed up.]]) ..
+      p(_[[Now have a look at these two tabs. When you click on the]])) ..
+   rt("image=pics/menu_tab_wares_warehouse.png",p(_[[third tab ('Wares in warehouses'), I'll continue.]])
+   ),
+   h = 350,
+   show_instantly = true,
+   obj_name = "switch_stock_tab",
+   obj_title = _"Switch to the third tab in the stock window.",
+   obj_body = rt(
+      p(_[[Have a look at the first two tabs in the stock window. They show all the wares and workers you have.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[When you have seen enough, switch to third tab.]])
+   ),
+}
+
+inventory3 = {
+   title = _"Stock",
+   body = rt(
+      p(_[[The third tab shows you the wares that are stored in your headquarters, your warehouses and ports. They are not needed anywhere and are therefore your reserve.]]) ..
+      p(_[[The fourth tab shows the same thing for workers.]]) ..
+      p(_[[The third tab tells you that there aren't any rations left in your headquarters - that is not good!]])
+   ),
+   show_instantly = true,
+   h = 300
+}
+
+reopen_stock_menu = {
+   title = _"You closed the stock menu!",
+   body = rt(
+      p(_[[You have closed the stock menu window, but I have not yet finished with my explanation. Would you please reopen it and choose the third tab?]])
+   ),
+   show_instantly = true,
+   w = 300,
+   h = 250
+}
+
+reopen_stock_menu_obj = {
+   obj_name = "open_stock_menu_again",
+   obj_title = _"Open the stock menu again.",
+   obj_body = rt(
+      p(_[[You closed the stock menu window before I had told you everything about it. If you already know everything, please leave this tutorial.]]) ..
+      paragraphdivider() ..
+      -- TRANSLATORS: "it" refers to the stock menu window.
+      listitem_bullet(_[[Otherwise: Please reopen it and choose the third tab.]])
+   ),
+   h = 250
+}
+
+build_taverns = {
+   position = "topright",
+   title = _"New taverns",
+   body = rt(
+      h1(_[[We need new taverns]]) ..
+      p(_[[Now that you have an overview, you should act. I think we should build more than a tavern - two or three are better. Remember: As long as we don't produce rations, our miners don't dig for ores. And without iron, we cannot forge a single helm.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Build at least two taverns.]])
+   ),
+   h = 300,
+   obj_name = "build_taverns",
+   obj_title = _"Build new taverns.",
+   obj_body = rt(
+      p(_[[To make our mines work, we need rations again - the more, the better.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Build at least two taverns.]])
+   )
+}
+
+ware_encyclopedia = {
+   title = _"Ware Encyclopedia",
+   body = rt(
+      p(_[[I am not sure if you could follow my remarks. Why do we need rations to get soldiers?]]) ..
+      p(_[[When you've played a lot, you know such things by heart. But when you're unsure what this tribe needs for a special ware, you can easily look it up in your tribe's ware encyclopedia.]]) ..
+      p(_[[This encyclopedia can be accessed via]])
+   ) ..
+   rt("image=pics/menu_help.png",p(_[[this button at the bottom. For all wares of your tribe, it shows a short help text, the building that produces the ware and the needed wares.]]) ..
+      p(_[[If you want, you can try it out. A soldier needs a wood lance and a helm - from there on, you can search backwards.]])
+      -- TODO(codereview): Is there a place where the player can see the needed weapons?
+   ),
+   h = 350
+}
+
+building_priority_settings = {
+   position = "topright",
+   title = _"Priority settings",
+   body = rt(
+      h1(_[[Send the wares where they're needed]]) ..
+      p(_[[Great. Our taverns are now built up and are supplying us with rations.]]) ..
+      p(_[[At the moment, all mines are supplied with rations. If you want to prioritize a special mine, you simply have to open its menu. In the wares tab, behind every ware, you see the 'traffic lights'.]]) ..
+      p(_[[When you click on the red part (low priority), the corresponding ware gets delivered less frequently. Green means that as many wares as possible should de delivered to this building, maybe because it produces something important.]]) ..
+      p(_[[In our situation, you might want to work the bakeries as fast as possible because they supply our taverns, so you set the water to the highest priority. The other buildings (for example the donkey farm) then get less water, but the bakery can work faster.]])
+      -- we cannot check whether the user does this, so no objective
+      -- see bug https://bugs.launchpad.net/widelands/+bug/1380288
+   )
+}
+
+ware_stats1 = {
+   position = "top",
+   title = _"Ware Statistics",
+   body = rt(
+      p(_[[In the statistic menu, there is also the]])) ..
+      rt("image=pics/menu_ware_stats.png",p(_[[button 'Ware statistics'.]])) ..
+      rt(paragraphdivider() ..
+      -- TRANSLATORS: "it" refers to the ware statistics button
+      listitem_bullet(_[[Click on it.]])
+   ),
+   w = 200,
+   h = 200,
+   obj_name = "open_ware_stat",
+   obj_title = _"Open the ware statistics window.",
+   obj_body = rt(
+      paragraphdivider() ..
+      listitem_bullet(_[[Open the Ware statistics window, accessible via the statistics menu.]])
+   )
+}
+
+ware_stats2 = {
+   title = _"Ware Statistics",
+   body = rt(
+      p(_[[In this window you can select wares to see how their production or consumption has changed over the time. Try it out with some wares.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[I'll continue as soon as you click on the]])) ..
+   rt("image=pics/menu_tab_wares_econ_health.png",p(_[[third tab ('Economy Health').]])
+   ),
+   h = 250,
+   show_instantly = true,
+   obj_name = "switch_ware_stat_tab_to_third",
+   obj_title = _"Switch to the third tab in the ware statistics window.",
+   obj_body = rt(
+      p(_[[The first two tabs show you the production and consumption of any ware. You can toggle it by simply clicking on it.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[When you have seen enough, switch to third tab.]])
+   )
+}
+
+ware_stats3 = {
+   title = _"Ware Statistics",
+   body = rt(
+      p(_[[In this tab, you can see the difference between production and consumption, called 'economy health'. You can see at one glance which one of those two is higher for the selected ware, that means whether the amount increases or decreases.]]) ..
+      p(_[[Now try this out. You can also compare it with the two previous tabs.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Click on the last tab when I shall continue.]])
+   ),
+   h = 250,
+   show_instantly = true,
+   obj_name = "switch_ware_stat_tab_to_forth",
+   obj_title = _"Switch to the last tab in the ware statistics window.",
+   obj_body = rt(
+      p(_[[The third tab shows you the economy health of the ware. When the value is positive, this means your stock grows.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[When you have seen enough, switch to the forth tab.]])
+   )
+}
+
+ware_stats4 = {
+   title = _"Ware Statistics",
+   body = rt(
+      p(_[[In the last tab, you can also see your absolute stock. It increases when the economy health is positive, and decreases otherwise. Compare the two graphs!]]) ..
+      p(_[[The last two tabs are good indicators to see whether shortages are about to come. Don't forget to check them regularily!]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Close this window when you're done.]])
+   ),
+   h = 250,
+   show_instantly = true,
+   obj_name = "close_ware_stats",
+   obj_title = _"Close the ware statistics window.",
+   obj_body = rt(
+      p(_[[The stock tab shows you how many wares you have. Compare the information from the four tabs to understand the correlation.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[When you have finished, close the ware statistics window.]])
+   ),
+}
+
+reopen_ware_stats1 = {
+   title = _"You closed the ware statistics menu!",
+   body = rt(
+      p(_[[You have closed the ware statistics window, but I have not yet finished with my explanation. Would you please reopen it and choose the third tab?]])
+   ),
+   show_instantly = true,
+   w = 300,
+   h = 250
+}
+
+reopen_ware_stats1_obj = {
+   obj_name = "open_ware_stats_menu_again1",
+   obj_title = _"Open the ware statistics menu again.",
+   obj_body = rt(
+      p(_[[You closed the ware statistics window before I had told you everything about it. If you already know everything, please leave this tutorial.]]) ..
+      paragraphdivider() ..
+      -- TRANSLATORS: "it" refers to the ware statistics window.
+      listitem_bullet(_[[Otherwise: Please reopen it and choose the third tab.]])
+   )
+}
+
+reopen_ware_stats2 = {
+   title = _"You closed the ware statistics menu!",
+   body = rt(
+      p(_[[You have closed the ware statistics window, but I have not yet finished with my explanation. Would you please reopen it and choose the forth tab?]])
+   ),
+   show_instantly = true,
+   w = 300,
+   h = 250
+}
+
+reopen_ware_stats2_obj = {
+   obj_name = "open_ware_stats_menu_again2",
+   obj_title = _"Open the ware statistics menu again.",
+   obj_body = rt(
+      p(_[[You closed the ware statistics window before I had told you everything about it. If you already know everything, please leave this tutorial.]]) ..
+      paragraphdivider() ..
+      -- TRANSLATORS: "it" refers to the ware statistics window.
+      listitem_bullet(_[[Otherwise: Please reopen it and choose the forth tab.]])
+   )
+}
+
+economy_settings1 = {
+   position = "topright",
+   title = _"Economy options",
+   body = rt(
+      p(_[[I've shown you our stock window, where you could see which wares are at the warehouses. You remember?]]) ..
+      p(_[[Now I'll tell you how you can determine how many wares you want to have. The menu for this purpose can be accessed via any flag and is called 'Configure economy'.]])) ..
+   -- Yup, that's indeed the correct icon
+   rt("image=pics/genstats_nrwares.png",p(_[[This is the icon.]])) ..
+   rt(
+      paragraphdivider() ..
+      listitem_bullet(_[[Open this menu.]])
+   ),
+   h = 350,
+   obj_name = "open_economy_settings",
+   obj_title = _"Open the 'Configure economy' menu.",
+   obj_body = rt(
+      paragraphdivider() ..
+      listitem_bullet(_[[Open the 'Configure economy' menu.]]) ..
+      listitem_arrow(_[[The menu can be accessed by clicking on any flag you own.]])
+   )
+}
+
+economy_settings2 = {
+   title = _"Economy options",
+   body = rt(
+      p(_[[This window looks similar to the stock window, but it has additional buttons at the bottom.]]) ..
+      -- TODO(codereview): What is the correct name for drag selection?
+      p(_[[You first have to select one or more wares (you can also use a drag selection). Then, you can set the desired target quantity of this ware/these wares.]]) ..
+      p(_[[Most buildings will only produce when your stock level (what is in your warehouses) is below the target quantity, so you indicate the reserve you want to have.]]) ..
+      p(_[[An example: The default value for scythes is 1. If you build a farm, a carrier takes a scythe and becomes a farmer. Now there are no scythes left, but the target quantity is 1, therefore your toolsmith starts to produce another one.]]) ..
+      p(_[[If you build two farms, only one can immediately start working. The second farm waits for its worker, who needs a scythe. If you had set the target quantity to 2 before, two scythes were available and both farms could start working right away.]])
+   ),
+   h = 450
+}
+
+economy_settings3 = {
+   title = _"Economy options",
+   body = rt(
+      p(_[[By changing this value, you can therefore decide which wares/tools your resources (in this case: iron) should be turned into or whether you would like to save your iron and wait what you will need it for.]]) ..
+      p(_[[Only buildings that consume wares take care of this setting. Buildings that produce wares for free (e.g. your farms or wells) will always work.]]) ..
+      p(_[[Now let's try it out: The current target quantity for marble columns is 10. Higher it to be prepared if you have to build up your fortification quickly.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Set the target quantity for marble columns to 20 and wait for your stonemason to produce them.]])
+   ),
+   obj_name = "produce_marble_columns",
+   obj_title = "Produce 20 marble columns.",
+   obj_body = rt(
+      p(_[[Sometimes, you need many wares of the same time quickly - faster than they can be produced. In this case, it is good to have enough on reserve.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[To be prepared for additional fortification, you should produce 20 marble columns.]]) ..
+      listitem_arrow(_[[Your stonemason will not produce marble columns when they are not needed. You have to increase the target quantity.]]) ..
+      listitem_arrow(_[[To do so, click on any flag and choose 'Configure economy'. In this menu, you can decide how many wares of each type you wish to have in stock.]])
+   )
+}
+
+warehouse_preference_settings = {
+   field = warehouse_field,
+   position = "topright",
+   title = _"Warehouse preferences",
+   body = rt(
+      h1(_[[Bring the marble columns to the front line]]) ..
+      p(_[[It is great that we are producing marble columns, but it would be great if they were stored where we need them.]]) ..
+      p(_[[Normally, produced wares are brought to the closest warehouse if they are not needed elsewhere. In this case, this means in our headquarters. But we would like to have them in the warehouse near our fortresses.]]) ..
+      p(_[[Every warehouse has four buttons to set the preference. If you move your mouse pointer over them, you see a tooltip that explains what the button does.]]) ..
+      paragraphdivider() ..
+      listitem_bullet(_[[Bring all the marble columns to the warehouse near the front line.]]) ..
+      -- TODO(codereview): Is this how the "Preferably store here" option works? (change the text below, too)
+      listitem_arrow(_[[To achieve this, you have to do two things: Set a preference for the marble columns in the desired warehouse. All marble columns produced in the future will be brought there.]]) ..
+      listitem_arrow(_[[To get the marble columns out of your headquarters, you have to click on the remove button there.]])
+   ),
+   obj_name = "bring_marble_columns_to_front",
+   obj_title = _"Bring 20 marble columns to the front line.",
+   obj_body = economy_settings3.obj_body .. rt(
+      p(_[[To decide where your wares get stored, you can use the preference buttons in the warehouses.]]) ..
+      listitem_bullet(_[[Bring all the marble columns to the warehouse near the front line.]]) ..
+      listitem_arrow(_[[To achieve this, you have to do two things: Set a preference for the marble columns in the desired warehouse. All marble columns produced in the future will be brought there.]]) ..
+      listitem_arrow(_[[To get the marble columns out of your headquarters, you have to click on the remove button there.]])
+   )
+}
+
+conclusion = {
+   title = _"Borders secured",
+   body = rt(
+      h1(_[[We're safe now]]) ..
+      p(_[[Great. We now have enough marble columns so that in case of an aggressor, we can build up our fortification. But I do not think that that'll be necessary. So far, no enemy has shown up.]]) ..
+      p(_[[I hope I could teach you how you can control the economy in Widelands. There are many options and they are surely confusing. Even if you've only understood a few concepts, you mustn't give up. Try them out in some games, become familiar with them and experience the possibilities. Then, return to this tutorial and learn the rest!]]) ..
+      p([[]]) ..
+      p(_[[This was the last tutorial I had prepared for you. I've now taught you everything I know. There are still secrets hidden in this world even I don't know. I will now search a quiet place to spend my sunset years. If you have still questions, the Widelands community will surely help you. You can find it under:]])
+   ) ..
+   rt("text-align=center", "<p font-size=24 font-decoration=underline>http://www.widelands.org</p>")
+}
+

=== added file 'maps/Tutorials/04_Economy.wmf/version'
--- maps/Tutorials/04_Economy.wmf/version	1970-01-01 00:00:00 +0000
+++ maps/Tutorials/04_Economy.wmf/version	2014-10-17 09:40:17 +0000
@@ -0,0 +1,11 @@
+# Automatically created by Widelands bzr7194[trunk] (Release)
+
+[global]
+map_source_url=
+map_release=
+map_creator_version="bzr7181[trunk]"
+map_version_major="0"
+map_version_minor="5"
+map_version_timestamp="1412189434"
+packet_version="1"
+packet_compatibility="1"

=== modified file 'scripting/coroutine.lua'
--- scripting/coroutine.lua	2010-09-25 18:49:53 +0000
+++ scripting/coroutine.lua	2014-10-17 09:40:17 +0000
@@ -2,42 +2,42 @@
 -- coroutine.lua
 -- -------------
 --
--- This script contains convenience wrapper around creation and resuming 
+-- This script contains convenience wrapper around creation and resuming
 -- of coroutines and yielding proper sleeping times to widelands. These
--- functions are more specially tailored to widelands and take a lot of 
+-- functions are more specially tailored to widelands and take a lot of
 -- the awkwardness out of using coroutines directly.
 
 -- =======================================================================
---                             PUBLIC FUNCTIONS                             
+--                             PUBLIC FUNCTIONS
 -- =======================================================================
 
 -- RST
 -- .. function:: run(func[, ...])
---    
+--
 --    Start to run a function as a coroutine and hand it over to widelands
 --    for periodical resuming. All arguments passed to this function are
---    given to the coroutine when it is first run. 
+--    given to the coroutine when it is first run.
 --
 --    :arg func: Lua function to launch as a coroutine
 --
 --    :returns: :const:`nil`
-function run(func, ...) 
+function run(func, ...)
    local c = coroutine.create(func)
    local success, sleeptime = coroutine.resume(c, ...)
    if success then
-      if coroutine.status(c) ~= "dead" then 
+      if coroutine.status(c) ~= "dead" then
          wl.Game():launch_coroutine(c, sleeptime)
       end
    else
-      error(sleeptime) 
+      error(sleeptime)
    end
 end
 
 -- RST
 -- .. function:: sleep(time)
---    
+--
 --    This must be called inside a coroutine. This will put the coroutine to
---    sleep. Widelands will wake it after the given amount of time. 
+--    sleep. Widelands will wake it after the given amount of time.
 --
 --    :arg time: time to sleep in ms
 --    :type time: :class:`integer`
@@ -49,7 +49,7 @@
 
 -- RST
 -- .. function:: wake_me(at)
---    
+--
 --    This must be called inside a coroutine. This will put the coroutine to
 --    sleep. Widelands will wake it at the absolute time given. If this time is
 --    already in the past (that is at < :func:`wl.Game().time`) the

=== modified file 'scripting/format_scenario.lua'
--- scripting/format_scenario.lua	2014-07-14 10:45:44 +0000
+++ scripting/format_scenario.lua	2014-10-17 09:40:17 +0000
@@ -33,7 +33,7 @@
    end
 
    -- Surround the text with translatable ","
-   text = (_ '“%s”'):format(text)
+   text = (_'“%s”'):format(text)
 
    local s = ""
    if title then
@@ -122,13 +122,14 @@
 --       objective text & title.
 --
 function new_objectives(...)
+   local sum = 0
    local s = ""
    for idx,obj in ipairs{...} do
-   	s = rt("<p font-size=10> <br></p>" ..
+   	s = s .. obj.body
+      sum = sum + obj.number
+   end
+   return rt("<p font-size=10> <br></p>" ..
 	   "<p font=DejaVuSerif font-size=18 font-weight=bold font-color=D1D1D1>"
-	   .. ngettext("New Objective", "New Objectives", obj.number) .. "</p>")
-	   .. obj.body
-   end
-   return s
+	   .. ngettext("New Objective", "New Objectives", sum) .. "</p>") .. s
 end
 

=== modified file 'scripting/formatting.lua'
--- scripting/formatting.lua	2013-10-28 20:33:13 +0000
+++ scripting/formatting.lua	2014-10-17 09:40:17 +0000
@@ -37,7 +37,7 @@
 --
 --    :returns: A paragraph with s formatted as heading.
 function h1(s)
-   return "<p font-size=18 font-weight=bold font-color=D1D1D1>" --font-face=DejaVuSerif
+   return "<p font-size=18 font-weight=bold font-color=D1D1D1>" -- font-face=DejaVuSerif
       ..  s .. "<br></p><p font-size=8> <br></p>"
 end
 
@@ -48,7 +48,7 @@
 --
 --    :returns: A paragraph with s formatted as heading.
 function h2(s)
-   return "<p font-size=14 font-weight=bold font-color=D1D1D1>" --font-face=DejaVuSerif
+   return "<p font-size=14 font-weight=bold font-color=D1D1D1>" -- font-face=DejaVuSerif
       ..  s .. "<br></p><p font-size=4> <br></p>"
 end
 
@@ -60,7 +60,7 @@
 --    :returns: A paragraph with s formatted as heading.
 --
 function h3(s)
-   return "<p font-size=13 font-color=D1D1D1>" --font-face=DejaVuSerif font-style=italic
+   return "<p font-size=13 font-color=D1D1D1>" -- font-face=DejaVuSerif font-style=italic
       ..  s .. "<br></p><p font-size=4> <br></p>"
 end
 
@@ -72,7 +72,7 @@
 --    :returns: A paragraph with s formatted as heading.
 --
 function h4(s)
-   return "<p font-size=12 font-style=italic font-color=D1D1D1>" --font-face=DejaVuSerif
+   return "<p font-size=12 font-style=italic font-color=D1D1D1>" -- font-face=DejaVuSerif
       ..  s .. "<br></p><p font-size=4> <br></p>"
 end
 

=== added file 'scripting/messages.lua'
--- scripting/messages.lua	1970-01-01 00:00:00 +0000
+++ scripting/messages.lua	2014-10-17 09:40:17 +0000
@@ -0,0 +1,178 @@
+-- RST
+-- messages.lua
+-- --------------
+--
+-- Functions to send messages to the player and to add objectives to campaigns.
+
+include "scripting/coroutine.lua"
+include "scripting/table.lua"
+
+-- RST
+-- .. function:: send_message(player, title, body, parameters)
+--
+--    Sends a message to the player.
+--    If the popup parameter is true and the player is in building mode,
+--    the function waits until the player leaves the building mode
+--    before sending the message
+--
+--    :arg player: the recipient of the message
+--    :arg title: the localized title of the message
+--    :type title: :class:`string`
+--    :arg body: the localized body of the message. You can use rt functions here.
+--    :type body: :class:`string`
+--    :arg parameters: Array of message parameters as defined in the Lua interface,
+--                     for wl.game.Player, e.g. { field = f, popup = true }.
+--                     The popup parameter must be set.
+--
+function send_message(player, title, body, parameters)
+	if (parameters["popup"]) then
+		while (wl.ui.MapView().is_building_road) do sleep(2000) end
+   end
+   player:send_message(title, body, parameters)
+end
+
+-- RST
+-- .. function:: message_box(player, title, message, parameters)
+--
+--    Waits if player is in building mode, then shows a scenario message box
+--
+--    :arg player: the recipient of the message
+--    :arg title: the localized title of the message
+--    :type title: :class:`string`
+--    :arg body: the localized body of the message. You can use rt functions here.
+--    :type body: :class:`string`
+--    :arg parameters: Array of message parameters as defined in the Lua interface,
+--                     for wl.game.Player, e.g. { field = f }.
+--
+function message_box(player, title, body, parameters)
+   while (wl.ui.MapView().is_building_road) do sleep(2000) end
+   -- In case the user input was forbidden for some reason, allow him to close the message box.
+   -- While the message box is shown, the user cannot do anything else anyway.
+   local user_input = wl.ui.get_user_input_allowed()
+   wl.ui.set_user_input_allowed(true)
+   player:message_box(title, body, parameters)
+   wl.ui.set_user_input_allowed(user_input)
+end
+
+-- RST
+-- .. function:: campaign_message_box(message)
+--
+--    Sets message.h and message.w if not set and calls
+--    message_box(player, title, body, parameters) for player 1
+--
+--    :arg message: the message to be sent
+--
+function campaign_message_box(message)
+   if not message.h then message.h = 400 end
+   if not message.w then message.w = 450 end
+   message_box(wl.Game().players[1], message.title, message.body, message)
+end
+
+-- RST
+-- .. function:: add_campaign_objective(objective)
+--
+--    Adds an objective to a campaign.
+--
+--    :arg objective: The objective to be added. If the variable obj_name exists, obj_name, obj_title and obj_body are used. Otherwise, it needs to have a name, title, and body.
+--
+--    :returns: The new objective.
+--
+function add_campaign_objective(objective)
+   if objective.obj_name then
+      return wl.Game().players[1]:add_objective(objective.obj_name, objective.obj_title, objective.obj_body)
+   else
+      return wl.Game().players[1]:add_objective(objective.name, objective.title, objective.body)
+   end
+end
+
+-- RST
+-- .. function:: message_box_objective(player, message)
+--
+--    Calls message_box(player, message.title, message.body, message). Also adds an objective defined in obj_name, obj_title and obj_body.
+--    This method should gather all options that are used often to avoid reimplementation in every single scenario script.
+--
+--    :arg player: the recipient of the message
+--    :arg message: a table that contains all information
+--
+--    Besides the normal message arguments (see wl.Game.Player:message_box) the following ones can be used:
+--
+--    :arg append_objective: If true, the objective text is appended to the message.body using new_objectives(). Default: False.
+--       :arg obj_number: or :arg number: Used for the plural formatting in new_objectives. Default: 1.
+--    :arg jump_to_field: If true, the view jumps to the message.field rather than scroll to it. Does nothing if the field is nil. Default: False, i.e. the view will scroll.
+--    :arg position: A string that indicates at which border of the screen the message box shall appear. Can be "top", "bottom", "right", "left" or a combination (e.g. "topright"). Overrides posx and posy. Default: Center. If only one direction is indicated, the other one stays central.
+--    :arg scroll_back: If true, the view scrolls/jumps back to where it came from. If false, the new location stays on the screen when the message box is closed. Default: False.
+--    :arg show_instantly: If true, the message box is shown immediately. If false, this function calls message_box(), which waits until the player leaves the roadbuilding mode. Use this with care because it can be very interruptive. Default: false.
+--
+--    :returns: the objective if defined, nil otherwise
+
+-- TODO(wl-zocker): This function should be used by all tutorials, campaigns and scenario maps
+function message_box_objective(player, message)
+   message.jump_to_field = message.jump_to_field or false
+   message.show_instantly = message.show_instantly or false
+   message.scroll_back = message.scroll_back or false
+   message.append_objective = message.append_objective or false
+   message.h = message.h or 400
+   message.w = message.w or 450
+
+   local way, x, y
+
+   if message.field then
+      -- This is necessary. Otherwise, we would scroll and then wait until the road is finished.
+      -- In this time, could user can scroll elsewhere, giving weird results.
+      if not message.show_instantly then
+         while (wl.ui.MapView().is_building_road) do sleep(2000) end
+      end
+      if message.jump_to_field then
+         x,y = wl.ui.MapView().viewpoint_x, wl.ui.MapView().viewpoint_y
+         -- player:message_box jumps, so nothing to do for us
+      else
+         way = scroll_smoothly_to(message.field)
+      end
+   end
+
+   if message.position then
+      if string.find(message.position,"top") then
+         message.posy = 0
+      elseif string.find(message.position,"bottom") then
+         message.posy = 10000
+      end
+      if string.find(message.position,"left") then
+         message.posx = 0
+      elseif string.find(message.position,"right") then
+         message.posx = 10000
+      end
+   end
+
+   if (message.obj_name and message.append_objective) then
+      message.obj_number = message.obj_number or message.number or 1
+      -- because new_objectives needs a body
+      local obj = {body = objective_text(message.obj_title, message.obj_body), number = message.obj_number}
+      message.body = message.body .. new_objectives(obj)
+   end
+
+   if message.show_instantly then
+      -- message_box takes care of this, but player:message_box does not
+      local user_input = wl.ui.get_user_input_allowed()
+      wl.ui.set_user_input_allowed(true)
+      player:message_box(message.title, message.body, message)
+      wl.ui.set_user_input_allowed(user_input)
+   else
+      message_box(plr, message.title, message.body, message)
+   end
+
+   if (message.field and message.scroll_back) then
+      if message.jump_to_field then
+         wl.ui.MapView().viewpoint_x = x
+         wl.ui.MapView().viewpoint_y = y
+      else
+         timed_scroll(array_reverse(way))
+      end
+   end
+
+   if message.obj_name then
+      return add_campaign_objective(message)
+   else
+      return nil
+   end
+end
+

=== modified file 'scripting/set.lua'
--- scripting/set.lua	2012-02-15 21:25:34 +0000
+++ scripting/set.lua	2014-10-17 09:40:17 +0000
@@ -2,14 +2,14 @@
 -- set.lua
 -- -------------
 --
--- This adds a new data type Set. 
+-- This adds a new data type Set.
 
 -- RST
 -- Set
 -- ---
--- 
+--
 -- .. class:: Set(iteratable)
--- 
+--
 --    A set is a collection of items. Each item must compare uniquely
 --    in the set, otherwise it is discarded; that is a Set never contains
 --    the same item more than once.
@@ -20,10 +20,10 @@
 
 -- RST
 --    .. attribute:: size
---    
+--
 --       (RO) Due to a bug in Lua 5.1, one cannot use the '#' operator to get
 --       the number of items in a set. Use this property instead.
--- 
+--
 Set = {}
 
 function Set:new(l)
@@ -34,7 +34,7 @@
    self.__index = self
 
    if l then
-      for _, v in ipairs(l) do 
+      for _, v in ipairs(l) do
          set:add(v)
       end
    end
@@ -44,7 +44,7 @@
 
 -- RST
 --    .. method:: add(item)
---     
+--
 --       Add this item to the set
 function Set:add(item)
    local hash = item.__hash or item
@@ -56,7 +56,7 @@
 
 -- RST
 --    .. method:: discard(item)
---     
+--
 --       Remove this item from the set. Does nothing if the item is not in the
 --       set.
 function Set:discard(item)
@@ -69,7 +69,7 @@
 
 -- RST
 --    .. method:: contains(item)
---    
+--
 --       Returns :const:`true` if the item is contained in this set,
 --       :const:`false` otherwise
 function Set:contains(item)
@@ -79,12 +79,12 @@
 
 -- RST
 --    .. method:: pop_at(n)
---    
+--
 --       Returns the n-th item of this set and removes it. Note that the only
 --       way to get to this item is by iterating, so this function scales
 --       linearly with n.
 function Set:pop_at(n)
-   assert(n <= self.size) 
+   assert(n <= self.size)
    assert(n >= 1)
    local ghash, gitem
    for hash,item in pairs(self) do
@@ -102,7 +102,7 @@
 
 -- RST
 --    .. method:: items
---    
+--
 --       Iterator function that allows easy iterating of all items.
 --
 --       .. code-block:: lua
@@ -125,12 +125,12 @@
 
 -- RST
 --    .. method:: union(other_set)
---    
+--
 --       Returns a new set that is the union of both sets. This is
 --       also overloaded to the '+' operator
 function Set:union(b)
    local rv = Set:new()
-   for hash,item in pairs(self) do 
+   for hash,item in pairs(self) do
       if hash ~= "size" then rv:add(item) end
    end
    for hash,item in pairs(b) do
@@ -142,15 +142,15 @@
 
 -- RST
 --    .. method:: subtract(other_set)
---    
---       Returns a new set that contains all values of this set that 
+--
+--       Returns a new set that contains all values of this set that
 --       are not in other_set. This is also overloaded to the '-' operator.
 function Set:substract(b)
    local rv = Set:new()
    for hash, value in pairs(self) do
       if hash ~= "size" then rv:add(value) end
    end
-   for hash, value in pairs(b) do 
+   for hash, value in pairs(b) do
       if hash ~= "size" then rv:discard(value) end
    end
    return rv
@@ -159,7 +159,7 @@
 
 -- RST
 --    .. method:: intersection(other_set)
---    
+--
 --       Returns a new set that contains all values of this set that are also
 --       in other_set. This is also overloaded to the '*' operator.
 function Set:intersection(b)

=== modified file 'scripting/table.lua'
--- scripting/table.lua	2010-09-25 19:34:01 +0000
+++ scripting/table.lua	2014-10-17 09:40:17 +0000
@@ -14,7 +14,7 @@
 --
 --    :arg arrays: any number of arrays
 --    :returns: a new array with all values of all arguments
-function array_combine(...) 
+function array_combine(...)
    local t = {}
    for _,arg in ipairs{...} do
       for _,v in ipairs(arg) do
@@ -23,7 +23,7 @@
    end
    return t
 end
-   
+
 -- RST
 -- .. function:: array_reverse(a)
 --

=== modified file 'scripting/ui.lua'
--- scripting/ui.lua	2014-03-25 06:18:48 +0000
+++ scripting/ui.lua	2014-10-17 09:40:17 +0000
@@ -77,7 +77,7 @@
 --
 --    .. code-block:: lua
 --
-include "scripting/table.lua" -- for reverse()
+--       include "scripting/table.lua" -- for reverse()
 --
 --       -- Move there in one second
 --       pts = scroll_smoothly_to(wl.Game().map:get_field(23, 42))
@@ -93,12 +93,18 @@
    local dt = gdt or 20
    local mv = wl.ui.MapView()
 
+   local old_speed = wl.Game().desired_speed
+   -- Set the speed to normal speed (1.0x). Otherwise, the scrolling would also
+   -- be faster, which is probably not intended.
+   wl.Game().desired_speed = 1000
+
    for idx,p in ipairs(points) do
       mv.viewpoint_x = p.x
       mv.viewpoint_y = p.y
 
       sleep(dt)
    end
+   wl.Game().desired_speed = old_speed
 end
 
 
@@ -184,12 +190,19 @@
    local dt = gdt or 20
    local mv = wl.ui.MapView()
 
+   local old_speed = wl.Game().desired_speed
+   -- Set the speed to normal speed (1.0x). Otherwise, the mouse movement would also
+   -- be faster, which is probably not intended.
+   wl.Game().desired_speed = 1000
+
    for idx,p in ipairs(points) do
       mv.mouse_position_x = p.x
       mv.mouse_position_y = p.y
 
       sleep(dt)
    end
+
+   wl.Game().desired_speed = old_speed
 end
 
 -- RST

=== modified file 'txts/developers'
--- txts/developers	2014-07-15 10:02:22 +0000
+++ txts/developers	2014-10-17 09:40:17 +0000
@@ -87,6 +87,7 @@
 "<rt image=pics/genstats_nrwares.png image-align=left text-align=left><p font-size=12> Tino Miegel (TinoM)</p></rt>"
 "<rt image=pics/genstats_nrwares.png image-align=left text-align=left><p font-size=12> Tibor Bamhor (tiborb95)</p></rt>"
 "<rt image=pics/genstats_nrwares.png image-align=left text-align=left><p font-size=12> Ferdinand Thiessen (f-thiessen)</p></rt>"
+"<rt image=pics/genstats_nrwares.png image-align=left text-align=left><p font-size=12> wl-zocker</p></rt>"
 "<rt text-align=left><p font-size=24 font-decoration=bold font-face=DejaVuSerif font-color=f4a131><br>"
 ""
 ""
@@ -162,6 +163,12 @@
 "<rt text-align=left><p font-size=24 font-decoration=bold text-align=left font-face=DejaVuSerif font-color=f4a131><br>"
 ""
 ""
+_ "Tutorials"
+"</p></rt>"
+"<rt image=pics/ls_wlmap.png image-align=left text-align=left><p font-size=12> wl-zocker</p></rt>"
+"<rt text-align=left><p font-size=24 font-decoration=bold text-align=left font-face=DejaVuSerif font-color=f4a131><br>"
+""
+""
 _ "Campaign Story"
 "</p></rt>"
 "<rt text-align=left><p font-size=18 font-decoration=bold text-align=left font-face=DejaVuSerif font-color=f4a131>"


Follow ups