← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/Mission4 into lp:widelands

 

hessenfarmer has proposed merging lp:~widelands-dev/widelands/Mission4 into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1705950 in widelands: "empire mission 4"
  https://bugs.launchpad.net/widelands/+bug/1705950

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/Mission4/+merge/334279

Introduces Empire Mission 4
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/Mission4 into lp:widelands.
=== modified file 'data/campaigns/campaigns.conf'
--- data/campaigns/campaigns.conf	2017-05-07 17:31:18 +0000
+++ data/campaigns/campaigns.conf	2017-11-25 23:51:00 +0000
@@ -90,6 +90,11 @@
 path="campaigns/emp03.wmf"
 
 [empiretut03]
+name=_"Higgledy-Piggledy"
+visible=0
+path="campaigns/emp04.wmf"
+
+[empiretut04]
 name=_"Not yet implemented"
 newvisi="campsect2"
 visible=0

=== added directory 'data/campaigns/emp04.wmf'
=== added directory 'data/campaigns/emp04.wmf/binary'
=== added file 'data/campaigns/emp04.wmf/binary/heights'
Binary files data/campaigns/emp04.wmf/binary/heights	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/binary/heights	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/binary/mapobjects'
Binary files data/campaigns/emp04.wmf/binary/mapobjects	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/binary/mapobjects	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/binary/resource'
Binary files data/campaigns/emp04.wmf/binary/resource	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/binary/resource	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/binary/terrain'
Binary files data/campaigns/emp04.wmf/binary/terrain	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/binary/terrain	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/elemental'
--- data/campaigns/emp04.wmf/elemental	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/elemental	2017-11-25 23:51:00 +0000
@@ -0,0 +1,13 @@
+# Automatically created by Widelands master-2416_Release_x64 (Release)
+
+[global]
+packet_version="1"
+map_w="112"
+map_h="208"
+nr_players="3"
+name="Higgledy-Piggledy"
+author="hessenfarmer"
+descr="After returning home Lutius and his crew are faced with a complete economic mess. It will be of utmost importance to resolve the bottlenecks in the economy to reinstate the glory of the empire."
+hint=
+background="campaigns/emp04.wmf/pics/background.jpg"
+tags="artifacts,unbalanced"

=== added file 'data/campaigns/emp04.wmf/minimap.png'
Binary files data/campaigns/emp04.wmf/minimap.png	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/minimap.png	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/objective'
--- data/campaigns/emp04.wmf/objective	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/objective	2017-11-25 23:51:00 +0000
@@ -0,0 +1,4 @@
+# Automatically created by Widelands master-2416_Release_x64 (Release)
+
+[global]
+packet_version="2"

=== added directory 'data/campaigns/emp04.wmf/pics'
=== added file 'data/campaigns/emp04.wmf/pics/Amalea.png'
Binary files data/campaigns/emp04.wmf/pics/Amalea.png	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/pics/Amalea.png	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/pics/Amalea2.png'
Binary files data/campaigns/emp04.wmf/pics/Amalea2.png	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/pics/Amalea2.png	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/pics/Amalea3.png'
Binary files data/campaigns/emp04.wmf/pics/Amalea3.png	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/pics/Amalea3.png	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/pics/Lutius.png'
Binary files data/campaigns/emp04.wmf/pics/Lutius.png	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/pics/Lutius.png	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/pics/Markus.png'
Binary files data/campaigns/emp04.wmf/pics/Markus.png	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/pics/Markus.png	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/pics/Saledus2.png'
Binary files data/campaigns/emp04.wmf/pics/Saledus2.png	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/pics/Saledus2.png	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/pics/Saledus3.png'
Binary files data/campaigns/emp04.wmf/pics/Saledus3.png	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/pics/Saledus3.png	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/pics/Vesta.png'
Binary files data/campaigns/emp04.wmf/pics/Vesta.png	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/pics/Vesta.png	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/pics/background.jpg'
Binary files data/campaigns/emp04.wmf/pics/background.jpg	1970-01-01 00:00:00 +0000 and data/campaigns/emp04.wmf/pics/background.jpg	2017-11-25 23:51:00 +0000 differ
=== added file 'data/campaigns/emp04.wmf/player_names'
--- data/campaigns/emp04.wmf/player_names	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/player_names	2017-11-25 23:51:00 +0000
@@ -0,0 +1,22 @@
+# Automatically created by Widelands master-2416_Release_x64 (Release)
+
+[global]
+packet_version="2"
+
+[player_1]
+name="Lutius"
+tribe="empire"
+ai=
+closeable="false"
+
+[player_2]
+name="Runeth"
+tribe="barbarians"
+ai=
+closeable="false"
+
+[player_3]
+name="Vesta"
+tribe="empire"
+ai=
+closeable="false"
\ No newline at end of file

=== added file 'data/campaigns/emp04.wmf/player_position'
--- data/campaigns/emp04.wmf/player_position	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/player_position	2017-11-25 23:51:00 +0000
@@ -0,0 +1,7 @@
+# Automatically created by Widelands master-2416_Release_x64 (Release)
+
+[global]
+packet_version="2"
+player_1="16 0"
+player_2="85 104"
+player_3="19 155"

=== added file 'data/campaigns/emp04.wmf/port_spaces'
--- data/campaigns/emp04.wmf/port_spaces	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/port_spaces	2017-11-25 23:51:00 +0000
@@ -0,0 +1,9 @@
+# Automatically created by Widelands master-2416_Release_x64 (Release)
+
+[global]
+packet_version="1"
+number_of_port_spaces="2"
+
+[port_spaces]
+0="12 15"
+1="20 194"

=== added directory 'data/campaigns/emp04.wmf/scripting'
=== added file 'data/campaigns/emp04.wmf/scripting/helper_functions.lua'
--- data/campaigns/emp04.wmf/scripting/helper_functions.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/helper_functions.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,91 @@
+-- Helper functions for campaign emp04
+
+function count_buildings(plr, tbl)
+   -- return overall amount of buildings:
+   -- plr : Player to count for
+   -- tbl : Table in form of {"building_name1", "building_name2", ...}
+   local amount = 0
+   for idx, bldng in ipairs(tbl) do
+      amount = amount + #plr:get_buildings(bldng)
+   end
+   return amount
+end
+
+function count_in_warehouses(ware)
+   local whs = array_combine(
+      p1:get_buildings("empire_headquarters"),
+      p1:get_buildings("empire_warehouse"),
+      p1:get_buildings("empire_port")
+   )
+   local rv = 0
+   for idx,wh in ipairs(whs) do
+      rv = rv + wh:get_wares(ware)
+   end
+   return rv
+end
+
+
+function enemy_seen()
+   for x=32, 90 do
+      for y=20, 175 do
+         local field = map:get_field(x,y)	 
+		 if field.owner == p2 and p1:sees_field(field) then 
+			return field
+	     end
+      end
+   end 
+end
+
+function concentric_reveal(plr, center, max_radius, delay)
+   if not delay then delay = 100 end
+   local steps = 0
+   while steps < max_radius do
+      plr:reveal_fields(center:region(steps))
+      steps = steps + 1
+      sleep(delay)
+   end
+end
+
+function concentric_hide(plr, center, max_radius, delay)
+   if not delay then delay = 100 end
+   while max_radius > 0 do
+      local to_hide = center:region(max_radius, max_radius - 1)
+      plr:hide_fields(to_hide, true)
+      sleep(delay)
+      max_radius = max_radius -1
+   end
+   -- Hide the remaining field
+   plr:hide_fields({center},true)
+end
+
+function random_reveal(plr, region, time)
+   -- if no time is given the default '1000' (1 sec) is used
+   if not time then time = 1000 end
+   -- Calculate the sleep as integer
+   delay = math.floor(time / #region)
+   -- Create a table with randomized fields
+   -- This is done for efficience reasons
+   rand_tbl = {}
+   while #region > 0 do
+      f = math.random(1, #region)
+      table.insert(rand_tbl, region[f])
+      table.remove(region, f)
+   end
+   --reveal field by field:
+   for i, f in ipairs(rand_tbl) do
+      plr:reveal_fields({f})
+      sleep(delay)
+   end
+end
+
+function random_hide(plr, region, time)
+   if not time then time = 1000 end
+   delay = math.floor(time / #region)
+   while #region > 0 do
+      f = math.random(1, #region)
+      plr:hide_fields({region[f]}, true)
+      table.remove(region, f)
+      sleep(delay)
+   end
+end
+

=== added file 'data/campaigns/emp04.wmf/scripting/init.lua'
--- data/campaigns/emp04.wmf/scripting/init.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/init.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,28 @@
+-- =======================================================================
+--                         Empire Campaign Mission 4
+-- =======================================================================
+--set_textdomain("scenario_emp04.wmf")
+
+include "scripting/coroutine.lua"
+include "scripting/objective_utils.lua"
+include "scripting/infrastructure.lua"
+include "scripting/table.lua"
+include "scripting/ui.lua"
+
+
+p1 = wl.Game().players[1]
+p2 = wl.Game().players[2]
+p3 = wl.Game().players[3]
+
+
+
+include "map:scripting/texts.lua"
+include "map:scripting/mission_thread.lua"
+
+
+
+map = wl.Game().map
+mv = wl.ui.MapView()
+sf = map.player_slots[1].starting_field
+
+

=== added file 'data/campaigns/emp04.wmf/scripting/mission_thread.lua'
--- data/campaigns/emp04.wmf/scripting/mission_thread.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/mission_thread.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,534 @@
+include "scripting/messages.lua"
+include "map:scripting/helper_functions.lua"
+
+-- Some objectives need to be waited for in separate threads
+local obj_find_monastry_done = false
+local vesta_conquered = false
+local enemy = false
+local mv = wl.ui.MapView()
+
+--  dismantle the unproductive small buildings
+function dismantle()
+   local o = add_campaign_objective(obj_dismantle_buildings)
+   local buildmessage = false
+   sleep(5000)
+   while count_buildings(p1, {"empire_fishers_house", "empire_quarry", "empire_lumberjacks_house2", "empire_well2"}) > 0 do
+      if mv.windows.field_action and mv.windows.field_action.tabs.small and not buildmessage then
+         campaign_message_box(amalea_19)
+		 buildmessage = true
+	  end
+	  sleep(500)
+   end
+   sleep(2000)
+   p1:allow_buildings("all")
+   p1:forbid_buildings{"empire_farm", "empire_mill", "empire_brewery", "empire_trainingcamp", "empire_colosseum"}
+   o.done = true
+   campaign_message_box(amalea_3)
+   run (clear_roads)
+   run (quarries_lumberjacks)
+end
+
+-- we need to find the plans how to build a farm
+function farm_plans()
+   local f = map:get_field(47, 190)
+   local farmclick = false
+   local count = 0
+   while not farmclick do
+      if mv.windows.building_window and not mv.windows.building_window.buttons.dismantle and not mv.windows.building_window.tabs.wares and mv.windows.building_window.tabs.workers then
+            farmclick = true
+      end
+	  count = count + 1
+	  if count == 1201 then 
+	  campaign_message_box(amalea_18)
+	  end
+      sleep(500)
+   end
+   
+   campaign_message_box(amalea_2)
+   local o = add_campaign_objective(obj_find_farm_plans)
+   while not (f.owner == p1) do 
+   sleep(4000)
+   end
+   if f.immovable then
+      local prior_center = scroll_to_field(f)
+	  campaign_message_box(amalea_4)
+	  sleep(2000)
+      f.immovable:remove()
+      sleep(2000)
+	  scroll_to_map_pixel(prior_center)
+   else
+      print("Failed to remove artifact at (" .. f.x .. ", " .. f.y .. ")")
+   end
+
+   o.done = true
+   p1:allow_buildings{"empire_farm"}
+   run (wheat_chain)
+end  
+
+-- the chaotic road network has to be cleared
+function clear_roads()
+   local o = add_campaign_objective(obj_clear_roads)
+   local cleared = false
+   
+   while cleared == false do 
+   cleared = true
+   sleep (5000)
+      for x=7, 40 do
+         for y=180, 207 do
+           local field = map:get_field(x,y)
+		   if (field.immovable and field.immovable.descr.type_name == "flag" and field.immovable.building == nil) then
+			  local numroads = 0
+              for _ in pairs(field.immovable.roads) do numroads = numroads + 1 end
+		        if numroads < 2 then
+		        cleared = false
+                end
+		    end
+	     end
+         for y=0, 28 do
+           local field = map:get_field(x,y)
+		   if (field.immovable and field.immovable.descr.type_name == "flag" and field.immovable.building == nil) then
+			  local numroads = 0
+              for _ in pairs(field.immovable.roads) do numroads = numroads + 1 end
+		        if numroads < 2 then
+		        cleared = false
+                end
+		    end
+	     end
+	  end	  
+   end 
+   o.done = true
+   campaign_message_box(amalea_6)
+end
+
+-- the foresters have to be replaced too
+function no_trees()
+   local trees = 100
+   while trees > 8 do 
+      trees = 0
+      sleep (5000)
+      for x=13, 25 do
+         for y=182, 205 do
+           local field = map:get_field(x,y)
+		   if (field.immovable and field.immovable.descr.terrain_affinity) then
+              trees = trees + 1 
+		   end
+	     end
+      end
+   end
+   if #p1:get_buildings("empire_foresters_house1") > 0 then
+      local o = add_campaign_objective(obj_replace_foresters)   
+      campaign_message_box(amalea_7)
+      while #p1:get_buildings("empire_foresters_house") < 2 do sleep(3249) end
+      o.done = true
+      campaign_message_box(amalea_8)
+   end
+end
+
+-- after having some logs and planks we need to ensure a constant supply of building materials 
+function quarries_lumberjacks()
+   local o = add_campaign_objective(obj_build_quarries_and_lumberjacks)
+   while not check_for_buildings(p1, { empire_lumberjacks_house = 3, empire_quarry = 2}) do sleep(3000) end
+   o.done = true
+   campaign_message_box(amalea_5)
+   run(produce_food)
+   run(no_trees)
+end
+
+-- now we can start to produce food for our miners
+function produce_food()
+   local o = add_campaign_objective(obj_produce_fish)
+   while p1:get_produced_wares_count("ration") < 14 do sleep(3000) end
+   o.done = true
+   run(steel)
+   run(charcoal)
+end
+
+-- after having started the metal production we need tools and later on we need soldiers
+function steel()
+   campaign_message_box(amalea_13)
+   local o = add_campaign_objective(obj_produce_tools)
+
+   while not (( 
+      p1:get_produced_wares_count("basket") + 
+	  p1:get_produced_wares_count("bread_paddle") + 
+	  p1:get_produced_wares_count("felling_ax") + 
+	  p1:get_produced_wares_count("fire_tongs") +
+	  p1:get_produced_wares_count("fishing_rod") +
+	  p1:get_produced_wares_count("hammer") +
+	  p1:get_produced_wares_count("hunting_spear") +
+	  p1:get_produced_wares_count("kitchen_tools") +
+	  p1:get_produced_wares_count("pick") +
+	  p1:get_produced_wares_count("saw") +
+	  p1:get_produced_wares_count("scythe") +
+	  p1:get_produced_wares_count("shovel")
+	  ) > 9) do 
+   sleep(2500) 
+   end
+   campaign_message_box(diary_page_6)
+   o.done = true   
+   sleep(10000)
+   run(check_enemy)
+   
+   -- enough tools produced now start to build weapons
+   local o1 = add_campaign_objective(obj_recruit_soldiers)
+   campaign_message_box(saledus_5)
+   local number_soldiers = 0
+   local bld = array_combine(
+      p1:get_buildings("empire_headquarters"),
+      p1:get_buildings("empire_warehouse"),
+      p1:get_buildings("empire_trainingcamp1"),
+      p1:get_buildings("empire_arena"),
+      p1:get_buildings("empire_sentry"),
+	  p1:get_buildings("empire_tower"),
+      p1:get_buildings("empire_fortress"),
+      p1:get_buildings("empire_outpost"),
+	  p1:get_buildings("empire_barrier"),
+      p1:get_buildings("empire_blockhouse"),
+      p1:get_buildings("empire_castle")
+      )
+   for idx,site in ipairs(bld) do
+      for descr,count in pairs(site:get_soldiers("all")) do
+         number_soldiers = number_soldiers + count
+	  end
+   end
+   
+   number_soldiers = number_soldiers + 9
+   local enough_soldiers = false
+   while not enough_soldiers do
+   bld = array_combine(
+      p1:get_buildings("empire_headquarters"),
+      p1:get_buildings("empire_warehouse"),
+      p1:get_buildings("empire_trainingcamp1"),
+      p1:get_buildings("empire_arena"),
+      p1:get_buildings("empire_sentry"),
+	  p1:get_buildings("empire_tower"),
+      p1:get_buildings("empire_fortress"),
+      p1:get_buildings("empire_outpost"),
+	  p1:get_buildings("empire_barrier"),
+      p1:get_buildings("empire_blockhouse"),
+      p1:get_buildings("empire_castle")
+      )
+	  local amount = 0
+      for idx,site in ipairs(bld) do
+	     for descr,count in pairs(site:get_soldiers("all")) do
+            amount = amount + count
+		 end
+      end
+	  if amount > number_soldiers then
+	     enough_soldiers = true
+      end
+      sleep(4273)
+   end
+   o1.done = true
+   campaign_message_box(saledus_6)
+   run(training)
+
+end
+
+-- charcoal might be needed to support the metal production
+function charcoal()
+   while p1:get_wares("coal") < 15 do sleep(2342) end
+   while (p1:get_wares("coal")/p1:get_wares("iron_ore")) > 0.1 do sleep(2342) end
+   local o = add_campaign_objective(obj_charcoal)
+   campaign_message_box(amalea_14)
+   while #p1:get_buildings("empire_charcoal_kiln") < 2 do sleep(3249) end
+   o.done = true
+   campaign_message_box(amalea_15)
+end
+
+-- soldiers need to be trained until we have 3 heroes
+function training()
+   local o = add_campaign_objective(obj_training)
+   local strength = 0
+
+   local bld = array_combine(
+      p1:get_buildings("empire_headquarters"),
+      p1:get_buildings("empire_warehouse"),
+      p1:get_buildings("empire_trainingcamp1"),
+      p1:get_buildings("empire_arena"),
+      p1:get_buildings("empire_sentry"),
+	  p1:get_buildings("empire_tower"),
+      p1:get_buildings("empire_fortress"),
+      p1:get_buildings("empire_outpost"),
+	  p1:get_buildings("empire_barrier"),
+      p1:get_buildings("empire_blockhouse"),
+      p1:get_buildings("empire_castle")
+      )
+   for idx,site in ipairs(bld) do
+      for descr,count in pairs(site:get_soldiers("all")) do
+		 strength = strength + descr[1]*count + descr[2]*count 
+	  end
+   end
+   
+   strength = strength + 10
+   local enough_strength = false
+   while not enough_strength do
+   bld = array_combine(
+      p1:get_buildings("empire_headquarters"),
+      p1:get_buildings("empire_warehouse"),
+      p1:get_buildings("empire_trainingcamp1"),
+      p1:get_buildings("empire_arena"),
+      p1:get_buildings("empire_sentry"),
+	  p1:get_buildings("empire_tower"),
+      p1:get_buildings("empire_fortress"),
+      p1:get_buildings("empire_outpost"),
+	  p1:get_buildings("empire_barrier"),
+      p1:get_buildings("empire_blockhouse"),
+      p1:get_buildings("empire_castle")
+      )
+	  local amount = 0
+      for idx,site in ipairs(bld) do
+	     for descr,count in pairs(site:get_soldiers("all")) do
+            amount = amount + descr[1]*count + descr[2]*count 
+		 end
+      end
+	  if amount > strength then
+	     enough_strength = true
+      end
+      sleep(4273)
+   end
+   o.done = true
+   
+   -- after some training we have enough knowledge to build better training buildings
+   p1:allow_buildings{"empire_trainingcamp", "empire_colosseum"}
+   campaign_message_box(saledus_7)
+   local o2 = add_campaign_objective(obj_upgrade)
+   sleep(5000)
+
+   while not (check_for_buildings(p1, { empire_trainingcamp = 1, empire_colosseum = 1})) do sleep(3000) end
+   o2.done = true
+   campaign_message_box(diary_page_7)
+   sleep(5000)
+   while not (obj_find_monastry_done) do sleep(2000) end
+   campaign_message_box(saledus_8)
+   local o1 = add_campaign_objective(obj_heroes)
+   local heroes = false
+   
+   while not heroes do
+   bld = array_combine(
+      p1:get_buildings("empire_headquarters"),
+      p1:get_buildings("empire_warehouse"),
+      p1:get_buildings("empire_trainingcamp1"),
+      p1:get_buildings("empire_trainingcamp"),
+      p1:get_buildings("empire_arena"),
+      p1:get_buildings("empire_colosseum"),
+      p1:get_buildings("empire_sentry"),
+	  p1:get_buildings("empire_tower"),
+      p1:get_buildings("empire_fortress"),
+      p1:get_buildings("empire_outpost"),
+	  p1:get_buildings("empire_barrier"),
+      p1:get_buildings("empire_blockhouse"),
+      p1:get_buildings("empire_castle")
+      )
+	  local amount = 0
+      for idx,site in ipairs(bld) do
+            amount = amount + (site:get_soldiers{4,4,0,2})
+      end
+	  if amount > 2 then
+	     heroes = true
+      end
+      sleep(4273)
+   end
+   
+   o1.done = true
+   if enemy == false then
+      enemy = true
+      campaign_message_box(saledus_9)
+      run(conquer)
+   end
+
+end
+
+   
+-- check if the enemy has been seen and where
+function check_enemy()
+   local en_see = {}
+	  while not enemy do
+	     en_see = enemy_seen()
+	  
+	     if en_see then
+	        local prior_center = scroll_to_field(en_see)
+			sleep(2000)
+	        campaign_message_box(saledus_11)
+		    enemy = true
+		    run(conquer)
+	        scroll_to_map_pixel(prior_center)
+	     end
+		 sleep(8000)
+	  end
+end
+
+
+-- lets finish the babarians off
+function conquer()
+   local o = add_campaign_objective(obj_conquer_all)
+
+   while not p2.defeated do sleep(2342) end
+   o.done = true
+
+   -- Babarians defeated.
+   campaign_message_box(saledus_10)
+
+   -- Sleep a while to have some time between the last objective done message and final victory
+   sleep(25000)
+   campaign_message_box(diary_page_5)
+
+   p1:reveal_campaign("campsect2")
+   p1:reveal_scenario("empiretut04")
+end
+
+-- another production chain that is uneffective and need to be corrected
+function wheat_chain()
+   while not (p1:get_produced_wares_count('beer') > 4  and p1:get_produced_wares_count('flour') > 4) do sleep(2434) end
+   local o = add_campaign_objective(obj_find_monastry)
+   campaign_message_box(amalea_9)
+   while not (p1:sees_field(map:get_field(16,156)) or p1:sees_field(map:get_field(16,157)) or p1:sees_field(map:get_field(17,158)) or p1:sees_field(map:get_field(17,159)) or p1:sees_field(map:get_field(18,160)) or p1:sees_field(map:get_field(18,161)) or p1:sees_field(map:get_field(19,162)) or p1:sees_field(map:get_field(20,162)) or p1:sees_field(map:get_field(21,162)) or p1:sees_field(map:get_field(22,162)) or p1:sees_field(map:get_field(23,162)) or p1:sees_field(map:get_field(24,162))) do sleep(2500) end
+   local well = map:get_field(17, 154)
+   place_building_in_region(p3, "empire_well", {map:get_field(17, 154)})
+   local brew = map:get_field(19, 155)
+   place_building_in_region(p3, "empire_brewery", {map:get_field(19, 155)})
+   local mill = map:get_field(18, 156)
+   place_building_in_region(p3, "empire_mill", {map:get_field(18, 156)})
+   local ware = map:get_field(21, 158)
+   place_building_in_region(p3, "empire_warehouse", {map:get_field(21, 158)}, {workers = {empire_carrier = 0, empire_recruit = 0,}})
+   local sent = map:get_field(19, 157)
+   place_building_in_region(p3, "empire_sentry", {map:get_field(19, 157)}, {soldiers = {[{0,0,0,0}] = 1,}})
+   o.done = true
+   sleep(4000)
+   local vesta = map:get_field(19, 157)
+   local prior_center = scroll_to_field(vesta)
+   concentric_reveal(p1, vesta, 7, 100)
+   campaign_message_box(vesta_0)
+   campaign_message_box(amalea_10)
+   campaign_message_box(saledus_1)
+   local o1 = add_campaign_objective(obj_deal_with_vesta)
+   scroll_to_map_pixel(prior_center)
+   
+   local hq = p1:get_buildings("empire_headquarters")
+   local wh = p3:get_buildings("empire_warehouse")
+   while not ((hq[1]:get_wares("wheat") > 34 and hq[1]:get_wares("wine") > 14) or p3.defeated) do sleep(4000) end
+   if p3.defeated then
+      o1.done = true
+	  vesta_conquered = true
+	  p1:allow_buildings{"empire_mill", "empire_brewery"}
+      campaign_message_box(saledus_2)
+	  campaign_message_box(vesta_2)
+	  campaign_message_box(amalea_11)
+	  campaign_message_box(saledus_4)
+   else
+      o1.done = true
+	  wh[1]:set_workers("empire_carrier", 0)
+	  wh[1]:set_workers("empire_recruit", 0)
+	  local wheat = hq[1]:get_wares("wheat") - 35
+	  local wine = hq[1]:get_wares("wine") - 15
+	  hq[1]:set_wares("wheat", wheat)
+	  hq[1]:set_wares("wine", wine)	  
+	  p1:allow_buildings{"empire_mill", "empire_brewery"}
+      campaign_message_box(vesta_1) 
+
+      well.immovable:remove()
+      brew.immovable:remove()
+      mill.immovable:remove()
+      ware.immovable:remove()
+      sent.immovable:remove()
+      place_building_in_region(p1, "empire_well", {map:get_field(17, 154)})
+      place_building_in_region(p1, "empire_brewery", {map:get_field(19, 155)})
+      place_building_in_region(p1, "empire_mill", {map:get_field(18, 156)})
+      place_building_in_region(p1, "empire_warehouse", {map:get_field(21, 158)}, {wares = {water = 30, flour = 30, beer = 40,}})
+      place_building_in_region(p1, "empire_sentry", {map:get_field(19, 157)})   
+      campaign_message_box(amalea_12)
+      campaign_message_box(saledus_3)
+   end
+   obj_find_monastry_done = true
+   run(karma)
+end
+
+-- our actions have an effect positively or negatively
+function karma()
+   if vesta_conquered then
+      for count = 0, 10 do 
+	     sleep(1200000)
+	     bld = {
+		 "empire_stonemasons_house",
+         "empire_sawmill",
+         "empire_mill",
+         "empire_bakery",
+         "empire_brewery",
+         "empire_vineyard",
+         "empire_winery",
+	     "empire_tavern",
+         "empire_inn",
+         "empire_charcoal_kiln",
+	     "empire_smelting_works",
+         "empire_toolsmithy",
+         "empire_armorsmithy",
+		 "empire_barracks"
+         }
+	     local most = 1
+		 local selc = 0 
+         for idx,site in ipairs(bld) do
+            if #p1:get_buildings(site) > most then
+			   most = #p1:get_buildings(site)
+			   local build = p1:get_buildings(site)
+			   selc = build[1]
+			end	   
+         end
+		 if selc ~= 0 then
+		    local fields = selc.fields
+		    local prior_center = scroll_to_field(fields[1])
+		    selc:destroy()
+		    campaign_message_box(amalea_16)
+		    scroll_to_map_pixel(prior_center)
+	     end
+	  end
+   else
+      for count = 0, 10 do 
+	     sleep(1500000)
+		 local hq = p1:get_buildings("empire_headquarters")
+		 local beer = hq[1]:get_wares("beer") + 20
+	     local wine = hq[1]:get_wares("wine") + 10
+	     hq[1]:set_wares("beer", beer)
+	     hq[1]:set_wares("wine", wine)
+		 campaign_message_box(amalea_17)
+      end
+   end
+end
+
+function mission_thread()
+   sleep(1000)
+   scroll_to_field(sf)  --scroll to our headquarters
+   include "map:scripting/starting_conditions.lua"
+   sleep(1000)
+
+
+   --Initial messages
+   campaign_message_box(diary_page_1)
+   sleep(700)
+   campaign_message_box(saledus)
+   sleep(700)
+   campaign_message_box(amalea)
+ 
+   -- the mayor is appearing
+   sleep(700)
+   campaign_message_box(diary_page_2)
+   sleep(700)
+   campaign_message_box(marcus_1) 
+   sleep(700)
+   campaign_message_box(diary_page_3)
+   sleep(700)
+   campaign_message_box(marcus_2)
+   sleep(700)
+   campaign_message_box(diary_page_4)
+   sleep(700) 
+   
+   -- let's start with dismantling the unproductive buildings  
+   campaign_message_box(amalea_1)
+   run(dismantle)
+   run(farm_plans)
+
+end
+
+
+
+run(mission_thread)
+

=== added file 'data/campaigns/emp04.wmf/scripting/starting_conditions.lua'
--- data/campaigns/emp04.wmf/scripting/starting_conditions.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/starting_conditions.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,491 @@
+-- =======================================================================
+--                                 Player 3
+-- =======================================================================
+-- Player 3 (Vesta) will be introduced to the game when discovered so for the beginning we fornbid everything
+-- and do not place any buildings
+
+p3:forbid_buildings("all")
+
+-- =======================================================================
+--                                 Player 1
+-- =======================================================================
+
+p1:forbid_buildings("all")
+p1:allow_buildings{"empire_lumberjacks_house"}
+
+ prefilled_buildings(p1, { "empire_headquarters", sf.x, sf.y,
+      workers = {
+         empire_builder = 10,
+		 empire_geologist = 1,
+      },
+   })
+   
+-- lower ressources to zero in starting region (to cope with default ressources)
+     for x=7, 42 do
+      for y=190, 207 do
+         local field = map:get_field(x,y)
+		 if field.resource == "fish" or
+		 field.resource == "water" then
+		 field.resource_amount = 0
+         end
+	  end
+      for y=0, 22 do
+         local field = map:get_field(x,y)
+		 if field.resource == "fish" or
+		 field.resource == "water" then
+		 field.resource_amount = 0
+         end
+      end		 
+     end 
+   
+   
+-- place towers and fortress
+      place_building_in_region(p1, "empire_tower", {map:get_field(10, 196)})
+      place_building_in_region(p1, "empire_tower", {map:get_field(24, 190)})	  
+      place_building_in_region(p1, "empire_tower", {map:get_field(16, 18)})	  
+      place_building_in_region(p1, "empire_tower", {map:get_field(28, 24)})	  
+      place_building_in_region(p1, "empire_tower", {map:get_field(35, 202)})
+      place_building_in_region(p1, "empire_fortress", {map:get_field(31, 5)})
+
+
+-- place farm
+	  place_building_in_region(p1, "empire_farm1", {map:get_field(20, 194)})	  
+	  place_building_in_region(p1, "empire_farm1", sf:region(15))	 
+
+-- place fishers_house
+	  place_building_in_region(p1, "empire_fishers_house", {map:get_field(12, 203)})
+	  place_building_in_region(p1, "empire_fishers_house", {map:get_field(12, 15)})
+	 
+-- place well
+	  place_building_in_region(p1, "empire_well2", sf:region(15))
+	  place_building_in_region(p1, "empire_well2", sf:region(15))
+
+-- place lumberjacks	  
+	  place_building_in_region(p1, "empire_lumberjacks_house2", sf:region(10))
+	  place_building_in_region(p1, "empire_lumberjacks_house2", sf:region(10))	
+	  place_building_in_region(p1, "empire_lumberjacks_house2", sf:region(10))
+	  place_building_in_region(p1, "empire_foresters_house2", {map:get_field(19, 190)})	  	  
+	  place_building_in_region(p1, "empire_foresters_house2", {map:get_field(19, 198)}) 
+
+-- mines
+	  place_building_in_region(p1, "empire_ironmine", {map:get_field(33, 194)})
+	  place_building_in_region(p1, "empire_coalmine", {map:get_field(24, 17)})	  
+	  place_building_in_region(p1, "empire_coalmine", {map:get_field(31, 20)})
+	  place_building_in_region(p1, "empire_goldmine", sf:region(25))	  
+
+-- place quarry	  
+	  place_building_in_region(p1, "empire_quarry", sf:region(9))
+	  place_building_in_region(p1, "empire_quarry", sf:region(9))
+	  
+-- place build material infrastructure	  
+      place_building_in_region(p1, "empire_sawmill", sf:region(8))
+      place_building_in_region(p1, "empire_stonemasons_house", sf:region(8))
+
+-- place metal industry	  
+	  place_building_in_region(p1, "empire_armorsmithy", sf:region(10))
+      place_building_in_region(p1, "empire_toolsmithy", sf:region(10))
+      place_building_in_region(p1, "empire_weaponsmithy", sf:region(15))
+	  place_building_in_region(p1, "empire_smelting_works", sf:region(15))	  
+	  
+-- food supply
+	  place_building_in_region(p1, "empire_bakery", sf:region(15))
+	  place_building_in_region(p1, "empire_brewery1", sf:region(15))
+	  place_building_in_region(p1, "empire_winery", sf:region(15))
+	  place_building_in_region(p1, "empire_mill1", sf:region(15))
+	  place_building_in_region(p1, "empire_tavern", sf:region(15))	  
+
+
+
+-- military training	  
+	  place_building_in_region(p1, "empire_arena", sf:region(20))
+      place_building_in_region(p1, "empire_trainingcamp1", sf:region(20))
+      place_building_in_region(p1, "empire_barracks", sf:region(20), {inputs = {empire_recruit = 8}})
+
+	  
+	  
+-- roads
+     for x=7, 35 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.bln
+			 local n2 = n1.bln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "bl", "bl", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.bln
+			 local n2 = n1.bln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "bl", "bl", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+	 
+     for x=5, 35, 3 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.trn
+			 local n0 = n1.trn
+			 local n2 = n0.trn
+			     if n1.immovable == nil and n1:has_caps("walkable") and n0.immovable == nil and n0:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "tr", "tr", "tr", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.trn
+			 local n0 = n1.trn
+			 local n2 = n0.trn
+			     if n1.immovable == nil and n1:has_caps("walkable") and n0.immovable == nil and n0:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "tr", "tr", "tr", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+	
+     for x=6, 35, 3 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.trn
+			 local n0 = n1.trn
+			 local n2 = n0.trn
+			     if n1.immovable == nil and n1:has_caps("walkable") and n0.immovable == nil and n0:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "tr", "tr", "tr", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.trn
+			 local n0 = n1.trn
+			 local n2 = n0.trn
+			     if n1.immovable == nil and n1:has_caps("walkable") and n0.immovable == nil and n0:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "tr", "tr", "tr", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+	 
+     for x=7, 35 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.bln
+			 local n2 = n1.bln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "bl", "bl", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.bln
+			 local n2 = n1.bln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "bl", "bl", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+
+     for x=7, 35 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.ln
+			 local n2 = n1.ln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "l", "l", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.ln
+			 local n2 = n1.ln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "l", "l", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+	 
+	 for x=7, 35 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.tln
+			 local n2 = n1.tln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "tl", "tl", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.tln
+			 local n2 = n1.tln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "tl", "tl", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+	 
+	 for x=7, 35 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.brn
+			 local n2 = n1.brn
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "br", "br", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.brn
+			 local n2 = n1.brn
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "br", "br", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+	 
+	 	 for x=7, 35 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.rn
+			 local n2 = n1.rn
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "r", "r", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.rn
+			 local n2 = n1.rn
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "r", "r", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+
+	 	 for x=7, 35 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.rn
+			 local n2 = n1.trn
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "r", "tr", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.rn
+			 local n2 = n1.trn
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "r", "tr", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+	 
+	 	 for x=7, 35 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.trn
+			 local n2 = n1.tln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "tr", "tl", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.trn
+			 local n2 = n1.tln
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "tr", "tl", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+	 
+	 	 for x=7, 35 do
+      for y=180, 207 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.rn
+			 local n2 = n1.brn
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "r", "br", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end
+      for y=0, 25 do
+         local field = map:get_field(x,y)
+		 if field.immovable and field.immovable.descr.type_name == "flag" then
+			 local n1 = field.rn
+			 local n2 = n1.brn
+			     if n1.immovable == nil and n1:has_caps("walkable") and (n2:has_caps("flag") or (n2.immovable and n2.immovable.descr.type_name == "flag")) then
+		         local road = p1:place_road(field.immovable, "r", "br", true)
+				 road:set_workers('empire_carrier',1)
+			     end
+         end
+	  end		 
+     end 
+	  
+
+-- =======================================================================
+--                                 Player 2
+-- =======================================================================
+p2:forbid_buildings("all")
+p2:allow_buildings{
+   "barbarians_bakery",
+   "barbarians_barrier",
+   "barbarians_farm",
+   "barbarians_fishers_hut",
+   "barbarians_gamekeepers_hut",
+   "barbarians_hunters_hut",
+   "barbarians_lime_kiln",
+   "barbarians_lumberjacks_hut",
+   "barbarians_micro_brewery",
+   "barbarians_rangers_hut",
+   "barbarians_reed_yard",
+   "barbarians_sentry",
+   "barbarians_tower",
+   "barbarians_well",
+   "barbarians_wood_hardener",
+   "barbarians_quarry",
+   "barbarians_coalmine",
+   "barbarians_ironmine",
+   "barbarians_goldmine",
+   "barbarians_granitemine",
+   "barbarians_coalmine_deep",
+   "barbarians_ironmine_deep",
+   "barbarians_goldmine_deep",
+   "barbarians_coalmine_deeper",
+   "barbarians_ironmine_deeper",
+   "barbarians_goldmine_deeper",
+   "barbarians_port",
+   "barbarians_cattlefarm",
+   "barbarians_charcoal_kiln",
+   "barbarians_brewery",
+   "barbarians_tavern",
+   "barbarians_inn",
+   "barbarians_smelting_works",
+   "barbarians_metal_workshop",
+   "barbarians_ax_workshop",
+   "barbarians_warmill",
+   "barbarians_helmsmithy",
+   "barbarians_barracks",
+   "barbarians_battlearena",
+   "barbarians_trainingcamp",
+   "barbarians_big_inn",
+   "barbarians_scouts_hut",
+   "barbarians_citadel",
+   "barbarians_tower", 
+   "barbarians_fortress",
+}
+
+prefilled_buildings(p2,
+   {"barbarians_headquarters", 85, 104,
+   wares = {
+      ax = 6,
+      blackwood = 32,
+      barbarians_bread = 8,
+      bread_paddle = 2,
+      cloth = 5,
+      coal = 12,
+      fire_tongs = 2,
+      fish = 6,
+      fishing_rod = 2,
+      gold = 4,
+      granite = 40,
+      grout = 12,
+      hammer = 12,
+      hunting_spear = 2,
+      iron = 12,
+      iron_ore = 5,
+      kitchen_tools = 4,
+      log = 80,
+      meal = 4,
+      meat = 6,
+      pick = 14,
+      ration = 12,
+      scythe = 6,
+      shovel = 4,
+      snack = 3,
+      thatch_reed = 24,
+   },
+   workers = {
+      barbarians_blacksmith = 2,
+      barbarians_brewer = 1,
+      barbarians_builder = 10,
+      barbarians_carrier = 40,
+      barbarians_charcoal_burner = 1,
+      barbarians_gardener = 1,
+      barbarians_geologist = 4,
+      barbarians_lime_burner = 1,
+      barbarians_lumberjack = 3,
+      barbarians_miner = 4,
+      barbarians_ranger = 1,
+      barbarians_stonemason = 2,
+   },
+
+    soldiers = {
+       [{0,0,0,0}] = 45,
+    }
+  }
+)
+
+
+   
\ No newline at end of file

=== added file 'data/campaigns/emp04.wmf/scripting/texts.lua'
--- data/campaigns/emp04.wmf/scripting/texts.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/texts.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,699 @@
+-- =========================
+-- Some formating functions
+-- =========================
+
+include "scripting/formatting.lua"
+include "scripting/format_scenario.lua"
+
+function lutius(title, text)
+   return speech("map:Lutius.png", "2F9131", title, text)
+end
+function saledus2(title, text)
+   return speech("map:Saledus2.png", "8F9131", title, text)
+end
+function saledus3(title, text)
+   return speech("map:Saledus3.png", "8F9131", title, text)
+end
+function saledus4(title, text)
+   return speech("map:Saledus2.png", "8F9131", title, text)
+end
+function amalea1(title, text)
+   return speech("map:Amalea.png", "AF7511", title, text)
+end
+function amalea2(title, text)
+   return speech("map:Amalea2.png", "AF7511", title, text)
+end
+function amalea3(title, text)
+   return speech("map:Amalea3.png", "AF7511", title, text)
+end
+function vesta(title, text)
+   return speech("map:Vesta.png", "D0D0D0", title, text)
+end
+function marcus(title, text)
+   return speech("map:Markus.png", "1175AF", title, text)
+end
+
+
+
+
+-- =======================================================================
+--                           Texts - No logic here
+-- =======================================================================
+
+
+-- ===========
+-- objectives
+-- ===========
+obj_dismantle_buildings = {
+    name = "dismantle_unproductive_buildings",
+    title=_"Dismantle the unproductive buildings",
+    number = 1,
+    body = objective_text(_"Dismantle buildings",
+       listitem_bullet(_[[We should dismantle all unproductive small buildings and the farms to get some ressources for new buildings. Remember to check the messages and the building stats for unproductive buildings.]])
+    ),
+}
+
+obj_clear_roads = {
+   name = "clear_roads",
+   title=_"Clear all unnecessary roads",
+   number = 1,
+   body = objective_text(_"Clear road network",
+      listitem_bullet(_[[Resolve the chaotic road network by clearing all unnecessary roads.]])
+   ),
+}
+
+obj_find_farm_plans = {
+   name = "find_farm_construction_plans",
+   title=_"Find the construction plans for our farm",
+   number = 1,
+   body = objective_text(_"Find our farm construction plans",
+      listitem_bullet(_[[We need to recover our plans how to construct a farm. We should search for them in the hills east of our border.]])
+   ),
+}
+
+obj_build_quarries_and_lumberjacks = {
+   name = "build_quarries_and_lumberjacks",
+   title=_"Build at least 3 lumberjack’s houses and 2 quarries",
+   number = 1,
+   body = objective_text(_"Quarries and lumberjacks",
+      listitem_bullet(_[[Build at least 3 lumberjack’s houses and 2 quarries to renew our building material supply chain.]])
+   ),
+}
+
+obj_produce_fish = {
+   name = "produce_fish",
+   title=_"Produce Fish and Rations",
+   number = 1,
+   body = objective_text(_"Produce food",
+      listitem_bullet(_[[Find and catch some fish. Afterwards produce rations for our miners.]])
+   ),
+}
+
+obj_replace_foresters = {
+   name = "replace_foresters",
+   title=_"Replace our old and uneffective foresters",
+   number = 1,
+   body = objective_text(_"Build 2 new foresters instead of the old and uneffective ones",
+      listitem_bullet(_[[Our forester's houses are old and weared out. We should build 2 new ones to increase our productivity.]])
+   ),
+}
+
+obj_find_monastry = {
+   name = "find_monastry",
+   title=_"Find the monastry in the north",
+   number = 1,
+   body = objective_text(_"Find the monastry",
+      listitem_bullet(_[[Find the monastry in the north to obtain the improved technology for our wheat production chain.]])),
+}
+
+obj_deal_with_vesta = {
+   name = "deal_with_vesta",
+   title=_"Deal with Vesta to get the technology",
+   number = 1,
+   body = objective_text(_"Diplomacy: Trade or War",
+      listitem_bullet(_[[We need to get the improvements very soon. But we have to decide: either we collect 35 wheat and 15 wine for Vesta in one of our warehouses or we just conquer the monastry.]])),
+}
+
+obj_heroes = {
+   name = "train_heroes",
+   title=_"Train at least 3 heroes",
+   number = 1,
+   body = objective_text(_"Training of heroes",
+      listitem_bullet(_[[Use our resources wisely to train at least 3 heroes.]])),
+}
+
+obj_produce_tools = {
+   name = "produce_tools",
+   title=_"Produce at least 10 tools",
+   number = 1,
+   body = objective_text(_"Produce 10 tools for the beginning",
+      listitem_bullet(_[[We need to produce additional tools to improve our economy. For the beginning start with at least 10 of them. Remember the possibility to control the production in the economy settings.]])),
+}
+
+obj_recruit_soldiers = {
+   name = "recruit_soldiers",
+   title=_"Recruit new soldiers",
+   number = 1,
+   body = objective_text(_"Recruiting new soldiers",
+      listitem_bullet(_[[Start to recruit new soldiers in our barracks. For the beginning recruit 10 of them at least. Don't forget, you need to forge weapons and armour for them.]])
+   ),
+}
+
+obj_conquer_all = {
+   name = "conquer_all",
+   title=_"Defeat the barbarians",
+   number = 1,
+   body = objective_text(_"Defeat the enemy",
+      listitem_bullet(_[[Now it is time to end the barbarian aggression in our very own part of the world.]])
+   ),
+}
+
+obj_charcoal = {
+   name = "charcoal",
+   title=_"Build 2 charcoal kiln",
+   number = 1,
+   body = objective_text(_"Build 2 charcoal kiln",
+      listitem_bullet(_[[We should build 2 charcoal kiln to support our iron industry. Be aware to ensure a constant log supply for them though.]])
+   ),
+}
+
+obj_training = {
+   name = "train_your_soldiers",
+   title=_"Increase your miltitary strength by training your soldiers",
+   number = 1,
+   body = objective_text(_"Training is important",
+      listitem_bullet(_[[Train your soldiers hard and train them fast. We need to increase our military strength.]])
+   ),
+}
+
+obj_upgrade = {
+   name = "upgrade",
+   title=_"Build a training camp and upgrade the colosseum",
+   number = 1,
+   body = objective_text(_"Build more efficient training buildings",
+      listitem_bullet(_[[We need more efficient training sites. Build a trainingscamp and upgrade our colosseum to an arena.]])
+   ),
+}
+
+-- ==================
+-- Texts to the user
+-- ==================
+
+-- Lutius diary
+
+diary_page_1 = {
+   title =_"Home, sweet home",
+   body=lutius(_"Diary of Lutius",
+      -- TRANSLATORS: Lutius - Diary
+      _([[Finally we managed to get home. I am so glad to see our beautiful country again. I really look forward for a walk on our lovely coast and for a hunt in our deep forrests.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Lutius - Diary
+      _([[Saledus, Amalea, aren't you delighted as well?]])),
+   posy=1,
+}
+
+diary_page_2 = {
+   title=_"Chaos",
+   body= lutius(_"Diary of Lutius",
+      -- TRANSLATORS: Lutius - Diary
+      _([[Oh no. Amalea is right. In fact I can't see any productivity overall. And our road network seems to be a complete mess as well. Who might be responsible for this chaos?]])),
+   posy=1,
+}
+
+diary_page_3 = {
+   title=_"Explanation needed",
+   body= lutius(_"Diary of Lutius",
+      -- TRANSLATORS: Lutius - Diary
+      _([[Ave. Who are you and what happened to our beautiful land.]])),
+   posy=1,
+}
+
+diary_page_4 = {
+   title=_"Difficult times",
+   body= lutius(_"Diary of Lutius",
+      -- TRANSLATORS: Lutius - Diary
+      _([[Mayor, we have to thank you for your efforts to saveguard our city. And we will do our very best to recover from the chaos. But unfortunately it seems to be very difficult.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Lutius - Diary
+      _([[I am really afraid we could be totally unprepared if the babarians will attack us.]])),
+   posy=1,
+}
+
+diary_page_6= {
+   title=_"Tools, tools, tools",
+   body= lutius(_"Diary of Lutius",
+      -- TRANSLATORS: Lutius - Diary
+      _([[Praise the gods. We just ensured a constant tool supply. Now we should be able to expand our economy.]])),
+   posy=1,
+}
+
+diary_page_7= {
+   title=_"Military strength",
+   body= lutius(_"Diary of Lutius",
+      -- TRANSLATORS: Lutius - Diary
+      _([[Thank goodness. Now we have everything ready to fully train our soldiers. Finally we will increase our military strength.]])),
+   posy=1,
+}
+
+diary_page_5 = {
+   title=_"Battle is won",
+   body= lutius(_"Diary of Lutius",
+      -- TRANSLATORS: Lutius - Diary
+      _([[Yes my fellow comrades, we have done it. We managed all the challenges that were imposed on us. And not to forget we have expelled the Babarians out of our country. But this was only a battle that was won, the war is even yet to begin. Let's see what the future will bring to us.]])
+	  .. paragraphdivider() ..
+      _([[You have completed this mission. You may continue playing if you wish, otherwise move on to the next mission.]])),
+   posy=1,
+}
+
+-- Marcus (mayor of fremil)
+
+marcus_1 = {
+   title=_"Welcome Back",
+   body= marcus(_"A high fremil official is advancing ...",
+      -- TRANSLATORS: Marcus - Mayor of fremil welcoming Lutius and explaining the chaos
+      _([[Ave Sire. The people and me we are so glad to see you returning back home. We really could use some good leadership around here.]])
+	  .. paragraphdivider() ..
+      _([[As you have already noticed, things have gone terribly wrong around here after you left.]])),
+   posy=1,
+}
+
+marcus_2 = {
+   title=_"a long story",
+   body= marcus(_"The official is deeply sighing...",
+      -- TRANSLATORS: Marcus - Mayor of fremil welcoming Lutius and explaining the chaos
+      _([[Sire. The emperor left fremil a long time ago to fight against the babarians. As this duty was demanding his full dedication he delegated the authority to run the city to his former secretary and instated him as his surrogate around here.]])
+	  .. paragraphdivider() ..
+      _([[But this was one of his worst decisions ever. The secretary got caught by his powers. His selfish instincts were as awful as his total stupidity and inability to govern the city.]])
+	  .. paragraphdivider() ..
+      _([[After a while the people discovered the truth and expelled the bloody moron. Afterwards they elected me as mayor of this city. But recovering the chaos seems to be a task to big for my abilities alone.]])),
+   posy=1,
+}
+
+
+-- Amalea
+
+amalea = {
+    title=_"Amalea looking puzzled",
+    body= amalea1(_"Amalea is doubtful…",
+    -- TRANSLATORS: Amalea
+    _([[Salve Lutius. Yes, on the one hand I'm glad to see our homeland again. But on the other hand I have the impression that something went deeply wrong here.]])
+    .. paragraphdivider() ..
+    -- TRANSLATORS: Lutius - Diary
+    _([[Have a look on the economy. There is nearly no productivity at all. Who ever managed our country while we were absent, created a huge mess. I'm not quite sure how we can fix this, if at all.]])),
+
+    posy=1,
+}
+
+amalea_1 = {
+   title=_"Amalea investigating",
+   body= amalea2(_"Amalea is nodding thougtfully…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius in my opinion this will be a very difficult challenge again. But I'm afraid, we're doomed to manage this situation. To make things even worse I discovered a bad issue in our warehouses. There is hardly some grain of dust left in there. No wares, no tools, no workers and no soldiers as well.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[So, first of all we need some building material to start correcting the mistakes made by the infamous secretary. I think we should try to dismantle the unproductive small buildings to collect their leftover building materials and regain them in our headquarters. As far as I can see now the fisherman's huts and the quarries don't have any ressources available. The lumberjack's houses and the well additionally seem to be unefficient and weared out.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[Additionally we should restrict the input to all builidngs which consume any of our building material to zero. Or maybe you could even pause the production in all bigger buildings and get the workers some rest until we will have produced some of their input wares.]]))
+      .. new_objectives(obj_dismantle_buildings),
+   posy=1,
+   h=500,
+}
+
+amalea_2 = {
+   title=_"Amalea's bad news",
+   body= amalea3(_"Amalea recommends…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius, I'm really worried to deliver bad news again. As you can see our farms have no productivity and we can't dismantle them, but just destroy.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[This is caused by the sad fact that our constructors have lost the plans how to construct and operate a farm. For this reason they have zero productivity and the constructors don't know how to dismantle them either.]])
+	  .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[So we urgently need to recover our plans regarding the construction and operation of farms. One older constructor told me that they might have been concealed in a cave in the hills east of our border.]]))
+	  .. new_objectives(obj_find_farm_plans),
+   posy=1,
+   h=500,
+}
+
+amalea_3 = {
+   title=_"Amalea looking confident",
+   body= amalea2(_"Amalea is more confident",
+      -- TRANSLATORS: Amalea
+      _([[Lutius, now we have some options. As we have gained some construction material we can start to rebuild our economy.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[First of all we need more construction material. So we should build at least 3 lumberjack's houses and 2 quarries.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[Oh before I forget, there is another task to accomplish. While our builders are doing their job, somebody should clear the mess in our road network in the meantime. There is so much chaos wasting a lot of building lots.]]))
+      .. new_objectives(obj_build_quarries_and_lumberjacks, obj_clear_roads),
+   posy=1,
+   h=500,
+}
+
+amalea_4 = {
+   title=_"Amalea is somewhat relieved",
+   body= amalea2(_"Amalea is giving a deep sigh…",
+      -- TRANSLATORS: Amalea
+      _([[Praise the gods Lutius. We have refound the plans how to build and operate a farm.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[Now we can start to build farms to produce some beer which our miners need so daringly.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[But I'm afraid that this problem hasn't been the last in our economy.]])),
+   posy=1,
+   h=500,
+}
+
+amalea_5 = {
+   title=_"Amalea has good news",
+   body= amalea2(_"Amalea smiles for the first time since long…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius, well done so far. I just got the news that we have finished the basic buildings to get some construction material.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[This is offering us more options to get the mess in our economy solved.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[I really think we can start to look forward into our future now. I pray that we can make ourselves comfortable in our homeland again.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[But this will be still hard work. For now we should start to find some fish and build some huts for our fishermen. As all the fish has been caught at our coast we should try our luck in the eastern part of our territory.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[After we have managed this we could start making rations in our tavern.]]))
+      .. new_objectives(obj_produce_fish),
+   posy=1,
+   h=500,
+}
+
+amalea_6 = {
+   title=_"Amalea is pleased",
+   body= amalea3(_"Amalea is nodding her head…",
+      -- TRANSLATORS: Amalea
+      _([[Well done. Well done. Now our road network looks a lot more structured than before.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[Now we can focus on rebuilding our economy.]])),
+   posy=1,
+   h=400,
+}
+
+amalea_7 = {
+   title=_"Amalea shaking her head",
+   body= amalea2(_"Amalea is getting fed up with all the problems in this economy…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius for the sake of Neptune, I just discovered another problem. It seems that really very few things are working as expected in this economy.]])
+      .. paragraphdivider() ..
+	  -- TRANSLATORS: Amalea
+      _([[One of our lumberjacks told me that the reproduction of our forests is far behind his experience and expectations. So I had a deep look on our foresters effectiveness.]])
+      .. paragraphdivider() ..
+	  -- TRANSLATORS: Amalea
+      _([[And guess what, they are very old. Their houses and tools are weared and their seed is degenerated. For this reason they need much more time to plant a tree then usual.]])
+      .. paragraphdivider() ..
+	  -- TRANSLATORS: Amalea
+      _([[The only solution is we need to build 2 new forester's houses near our lumberjacks. Be sure to first build a new forester and then eventually destroy the old one or at least expel the forester to change houses. Dismantling them is also possible but will not return any wares because they are so weared.]]))
+	  .. new_objectives(obj_replace_foresters),
+   posy=1,
+   h=500,
+}
+
+amalea_8 = {
+   title=_"Amalea sarcastic",
+   body= amalea1(_"Amalea is laughing sarcastically…",
+      -- TRANSLATORS: Amalea
+      _([[Ok Lutius. We have solved just another weird behaviour in our economy. Now our lumberjacks would be supplied with enough wood to enhance our economy.]])
+      .. paragraphdivider() ..
+	  -- TRANSLATORS: Amalea
+      _([[I am deeply curious what will go wrong next.]])),
+   posy=1,
+}
+
+amalea_9 = {
+   title=_"Amalea shaking head",
+   body= amalea3(_"Amalea is looking defeatist…",
+      -- TRANSLATORS: Amalea
+      _([[Alright Lutius. Here is another problem. After the production of some beer and some flour I found out that the technology in the mill and the brewery is somewhat outdated. By this they consume far to much resources.]])
+      .. paragraphdivider() ..
+	  -- TRANSLATORS: Amalea
+      _([[And you wouldn't believe it, nobody knows how to improve the technology nor how to build more efficient buildings. The only thing I found out is, there might be a monastry in the north where the female priests might know how to improve our technology.]])
+      .. paragraphdivider() ..
+	  -- TRANSLATORS: Amalea
+      _([[But I'm not sure if they will give us their knowledge for free. Anyway we have no choice we need to find them to improve our economy.]]))
+	  .. new_objectives(obj_find_monastry),
+   posy=1,
+   h=500,
+}
+
+amalea_10 = {
+   title=_"Amalea looks happy",
+   body= amalea2(_"Amalea comes in…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius. I think this is rather a fair offer. And we could use some good karma from any of our gods as well.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[The only problem might be that it will take some time to collect all the wares. Especially we will need to shorten the supply to our mines drastically, which gives us a drawback in metal production.]])),
+   posy=1,
+}
+
+
+amalea_11 = {
+   title=_"Amalea sad",
+   body= amalea1(_"Amalea is really sad…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius. Yes we have obtained the plans but we will never know if and how Vesta and her sisters could have helped us against the babarians.]])
+      .. paragraphdivider() ..
+	  -- TRANSLATORS: Amalea
+      _([[Furthermore we will have to live with the guilt of destroying a temple of an empire god on our souls.]])),
+   posy=1,
+}
+
+amalea_12 = {
+   title=_"Amalea is very content",
+   body= amalea2(_"Amalea is clapping her hands…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius. Well done. Now we are able to build more effective buildings to refine our wheat. And best of all we have a new ally who just provided us with lots of water, flour and beer. Now I really think that nothing could stop us to get stronger and conquer back our homeland.]])),
+   posy=1,
+}
+
+amalea_13 = {
+   title=_"Amalea satisfied",
+   body= amalea3(_"Amalea is satisfied with the progress…",
+      -- TRANSLATORS: Amalea
+      _([[Alright Lutius another problem solved. Still more to come. As we are able to produce food now we should urgently start to mine some coal and iron ore. After all we need more tools to back up our economy and built more and different production sites.]])
+      .. paragraphdivider() ..
+	  -- TRANSLATORS: Amalea
+      _([[But due to recent experience I assume that something could be wrong with our mines as well. Probably it would be a good idea to send a geologist to check whether there are enough ressources in the vicinity of our mines.]])
+      .. paragraphdivider() ..
+	  -- TRANSLATORS: Amalea
+      _([[As soon as we have melted some iron we should start to produce tools. Perhaps we should control the production of them via the economy settings. In the meantime we could start to build the buildings we need most urgently. I think we miss a vineyard yet in our economy.]]))
+	  .. new_objectives(obj_produce_tools),
+   posy=1,
+   h=500,
+}
+
+amalea_14 = {
+   title=_"Amalea advising",
+   body= amalea3(_"Amalea is providing economic advise…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius, it seems that our coal supply is a little bit weak. So we need to expand and explore all mineable areas for more coal.]])
+	  .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[In the meantime it might help to build some charcoal kiln for buffering any mining shortfalls with charcoal. But be careful to ensure a continous log supply afterwards.]]))
+      .. new_objectives(obj_charcoal),  
+   posy=1,
+   h=500,
+}
+
+amalea_15 = {
+   title=_"Amalea is in a good manner",
+   body= amalea2(_"Amalea is celebrating success…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius. Another issue is solved. Now the charcoal will backup our metal industry and we can concentrate on our exploration and military strength.]])),
+   posy=1,
+}
+
+amalea_16 = {
+   title=_"Amalea thoughtful",
+   body= amalea2(_"Amalea is sad about the news…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius. I have bad news to report. One of our buildings was just destroyed due to a fireplace got uncontrolled. I fear this might be a sign of the goddess Vesta being still in a bad mood.]])),
+   posy=1,
+}
+
+amalea_17 = {
+   title=_"Amalea positively surprised",
+   body= amalea2(_"Amalea is celebrating a happy event…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius. I don't know how, but we have been gifted with some beer and wine. During our recent inventory taking we found the additional wares. Maybe the goddess Vesta is still supporting us.]])),
+   posy=1,
+}
+
+amalea_18 = {
+   title=_"Amalea analyses",
+   body= amalea1(_"Amalea reminds…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius. I just have analyzed our economy somewhat further. I think there might be a problem with our farms. They don't show any productivity although there is space enough to plant wheat.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[I think we should have a deeper look into the issue and open the Building window of one of them.]])),
+   posy=1,
+}
+
+amalea_19 = {
+   title=_"Amalea's restrictions",
+   body= amalea1(_"Amalea restricted building possibilities…",
+      -- TRANSLATORS: Amalea
+      _([[Lutius. The most critical ressource in the current state of our economy is wood.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Amalea
+      _([[Therefore I took the freedom to restrict our current buildingoptions to the lumberjack's house until we have dismantled all necessary small buildings.]])),
+   posy=1,
+}
+
+   
+-- Saledus
+
+saledus = {
+    title=_"Military Strength",
+    body= saledus2(_"Saledus looks very relaxed…",
+       -- TRANSLATORS: Saledus
+       _([[Sire, you are right it is a great pleasure to be at home again. And the best of all things: I can see we still have some military strength. I can count five towers and a fortress in our vicinity to guard us.]])),
+    posy=1,
+}
+
+saledus_1 = {
+   title=_"We could use the military instead",
+   body= saledus2(_"Saledus raises his hand…",
+      -- TRANSLATORS: Saledus
+      _([[Sire, If we need to get the technology very quickly why not conquer it. We could defeat the little monastry in an instant.]])
+	  .. paragraphdivider() ..
+      -- TRANSLATORS: Saledus
+      _([[The only problem might be that probably the gods will not be that amused if we destroy a temple of them. And you never know what this could lead to.]]))
+      .. new_objectives(obj_deal_with_vesta),  
+   posy=1,
+   h=500,
+}
+
+saledus_2 = {
+   title=_"Easy victory",
+   body= saledus3(_"Saledus cheering proudly…",
+      -- TRANSLATORS: Saledus
+      _([[Sire, our armies just swept over the priests and conquered the plans. That was rather an easy victory.]])),
+   posy=1,
+}
+
+saledus_3 = {
+   title=_"Defiance",
+   body= saledus2(_"Saledus is keeping his point…",
+      -- TRANSLATORS: Saledus
+      _([[Sire, I admit this has been proven to be a very good deal. But we could have had the plans much earlier. Anyhow we will not be able to make any deals with the babarians, so we better keep our soldiers in a good mood and train them adequately.]])),
+   posy=1,
+}
+
+saledus_4 = {
+   title=_"Pride",
+   body= saledus2(_"Saledus is keeping his point…",
+      -- TRANSLATORS: Saledus
+      _([[Sire, I admit that we have accumulated some bad karma, but in wartime sometimes the end justifies the means. And we won't be able to make any deals with the babarians either, so we better keep our soldiers in good mood and train them adequately.]])),
+   posy=1,
+}
+
+
+saledus_5 = {
+   title=_" Military Strength",
+   body= saledus2(_"Saledus is asking for a stronger army…",
+      -- TRANSLATORS: Saledus
+      _([[Now that we have produced some tools, I think it is time to diverge some of our iron and coal to start some military production.]])
+      .. paragraphdivider() ..
+      -- TRANSLATORS: Saledus
+      _([[I am really worried about the weakness of our army. We should start to increase our military power. For the beginning we should start to recruit at least 10 new soldiers.]])
+	  .. paragraphdivider() ..
+      -- TRANSLATORS: Saledus
+      _([[Remember we need to produce wooden spears and helmets to recruit them in the barracks. Perhaps we could start to train them in the arena as well.]]))
+	  .. new_objectives(obj_recruit_soldiers),
+   posy=1,
+   h=500,
+}
+
+saledus_6 = {
+   title=_"Training is needed",
+   body= saledus3(_"Saledus still has security concerns…",
+      -- TRANSLATORS: Saledus
+      _([[Sire, although we have started to recruit new soldiers we still need to train them well. It is important to increase the strength of our soldiers as fast as we can.]])
+      .. paragraphdivider() ..
+      _([[Unfortunately we only have an arena and a very old and small training camp with very little storage capacity. And guess what none of our builders knows how to improve this. But we need to use what we have to get prepared for battle.]]))
+	  .. new_objectives(obj_training),
+   posy=1,
+   h=500,
+}
+
+saledus_7 = {
+   title=_"Praise the army of the empire",
+   body= saledus2(_"Saledus is happy…",
+      -- TRANSLATORS: Saledus
+      _([[Sire, after training a bunch of recruits our trainers together with our builders developed better and more efficient training buildings.]])
+      .. paragraphdivider() ..
+      _([[Now we could really improve our army and build the military strength that we will need to defend our country.]]))
+	  .. new_objectives(obj_upgrade),
+   posy=1,
+   h=500,
+}
+
+saledus_8 = {
+   title=_"We just need another hero",
+   body= saledus4(_"Saledus is in a good mood…",
+      -- TRANSLATORS: Saledus
+      _([[Sire, after we now have more and better beer together with enhanced training facilities we should be able to train as much heroes as we can.]])
+      .. paragraphdivider() ..
+      _([[It will give us great advantage in battle if our soldiers are much more powerful than the babarians. So we need to spend our ressources wisely to get heroes as soon as we can.]])
+      .. paragraphdivider() ..
+      _([[I would say for the beginning 3 fully trained heroes would be sufficient. But don't forget to send them to the frontline, cause they are not that useful back at home.]]))
+	  .. new_objectives(obj_heroes),
+   posy=1,
+   h=500,
+}
+
+saledus_9 = {
+   title=_"We should expell the babarians",
+   body= saledus3(_"Saledus is excited…",
+      -- TRANSLATORS: Saledus
+      _([[Now that we have some fully trained soldiers it is time to expell the babarians of our homeland.]])
+      .. paragraphdivider() ..
+      _([[Let's finish them off and regain control over our lands. They should regret deeply they ever came.]]))
+      .. new_objectives(obj_conquer_all),
+   posy=1,
+   h=500,
+}   
+   
+saledus_10 = {
+   title=_"Victory is our's",
+   body= saledus2(_"Saledus is cheering out…",
+      -- TRANSLATORS: Saledus
+      _([[Sire, finally we have defeated the babarians. We have expelled even the last of them. May they never come back.]])
+      .. paragraphdivider() ..
+      _([[Now it is time to find out why this big mess around could have happened. But first of all we should have a beer or two to celebrate our victory and our newfound freedom.]])),
+   posy=1,
+}
+
+saledus_11 = {
+   title=_"The enemy is near...",
+   body= saledus3(_"Saledus is alerted…",
+      -- TRANSLATORS: Saledus
+      _([[Sire. Although we have not enough fully trained soldiers yet, we just have made contact with the enemy.]])
+      .. paragraphdivider() ..
+      _([[We shall finish them off and regain control over our lands. They should regret deeply they ever came.]]))
+      .. new_objectives(obj_conquer_all),
+   posy=1,
+   h=500,
+}  
+
+
+
+-- Vesta
+
+vesta_0 = {
+   title=_"Worship to be gifted",
+   body= vesta(_"Vesta is demanding a sacrifice for the gods...",
+      -- TRANSLATORS: Vesta
+      _([[Ave Lutius. If you want us to help you, you first have to worship our gods. Therefore deliver 35 wheat and 15 wine to prepare a worthy sacrifice for our gods.]])),
+   posy=1,
+}
+
+vesta_1 = {
+   title=_"May the gods bless you",
+   body= vesta(_"Vesta is blessing us...",
+      -- TRANSLATORS: Vesta
+      _([[Ave Lutius. You have served our gods well. You will not only be gifted with the improvements to your technology but with some goods that you could use so daringly as well. Furthermore we will pray for you and join your party to safeguard our land from the babarians.]])),
+   posy=1,
+}
+
+vesta_2 = {
+   title=_"Damn you...",
+   body= vesta(_"Vesta is cursing us...",
+      -- TRANSLATORS: Vesta
+      _([[Damn you Lutius, for killing peacefull sisters of the goddess vesta. May your life and your land be cursed and may the wrath of the goods diminish your family from the earth.]])),
+   posy=1,
+}

=== added directory 'data/campaigns/emp04.wmf/scripting/tribes'
=== added file 'data/campaigns/emp04.wmf/scripting/tribes/brewery.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/brewery.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/brewery.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,63 @@
+dirname = "tribes/buildings/productionsites/empire/brewery/"
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_brewery1",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Brewery"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "medium",
+
+   -- buildcost = {
+      -- log = 1,
+      -- planks = 2,
+      -- granite = 2
+   -- },
+   return_on_dismantle = {
+      planks = 1,
+      granite = 1
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 39, 62 },
+      },
+      working = {
+         pictures = path.list_files(dirname .. "idle_??.png"), -- TODO(GunChleoc): No animation yet.
+         hotspot = { 39, 62 },
+      },
+   },
+
+   aihints = {
+
+   },
+
+   working_positions = {
+      empire_brewer = 1
+   },
+
+   inputs = {
+      { name = "water", amount = 3 },
+      { name = "wheat", amount = 7 }
+   },
+   outputs = {
+      "beer"
+   },
+
+   programs = {
+      work = {
+         -- TRANSLATORS: Completed/Skipped/Did not start brewing beer because ...
+         descname = _"brewing beer",
+         actions = {
+            "sleep=30000",
+            "return=skipped unless economy needs beer",
+            "consume=water:3 wheat",
+            "play_sound=sound/empire beerbubble 180",
+            "animate=working 30000",
+            "produce=beer"
+         }
+      },
+   },
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/farm.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/farm.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/farm.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,73 @@
+dirname = "tribes/buildings/productionsites/empire/farm/"
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_farm1",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Farm"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "big",
+
+   
+   return_on_dismantle = {
+      planks = 1,
+      granite = 1,
+      marble = 1,
+      marble_column = 1
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 82, 74 },
+      },
+   },
+
+   aihints = {
+
+   },
+
+   working_positions = {
+      empire_farmer = 1
+   },
+
+   outputs = {
+      "wheat"
+   },
+
+   programs = {
+      work = {
+         -- TRANSLATORS: Completed/Skipped/Did not start working because ...
+         descname = _"working",
+         actions = {
+            "call=plant_wheat",
+            "call=harvest_wheat",
+            "return=skipped"
+         }
+      },
+      plant_wheat = {
+         -- TRANSLATORS: Completed/Skipped/Did not start planting wheat because ...
+         descname = _"planting wheat",
+         actions = {
+            "sleep=14000",
+            "worker=harvest"
+         }
+      },
+      harvest_wheat = {
+         -- TRANSLATORS: Completed/Skipped/Did not start harvesting wheat because ...
+         descname = _"harvesting wheat",
+         actions = {
+            "sleep=4000",
+            "worker=harvest"
+         }
+      },
+   },
+   out_of_resource_notification = {
+      -- Translators: Short for "Out of ..." for a resource
+      title = _"No Fields",
+      heading = _"Out of Fields",
+      message = pgettext("empire_building", "The farmer working at this farm has no cleared soil to plant his seeds."),
+      productivity_threshold = 30
+   },
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/foresters_house.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/foresters_house.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/foresters_house.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,48 @@
+dirname = "tribes/buildings/productionsites/empire/foresters_house/"
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_foresters_house1",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Forester’s House"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "small",
+   enhancement = "empire_foresters_house2",
+   
+   buildcost = {
+      log = 1,
+      planks = 1,
+      granite = 1
+   },
+   
+   return_on_dismantle = {
+      planks = 0,
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 52, 54 },
+      },
+   },
+
+   aihints = {
+
+   },
+
+   working_positions = {
+      empire_forester = 1
+   },
+
+   programs = {
+      work = {
+         -- TRANSLATORS: Completed/Skipped/Did not start planting trees because ...
+         descname = _"planting trees",
+         actions = {
+            "sleep=66000",
+            "worker=plant"
+         }
+      },
+   },
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/foresters_house1.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/foresters_house1.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/foresters_house1.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,46 @@
+dirname = "tribes/buildings/productionsites/empire/foresters_house/"
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_foresters_house2",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Forester’s House"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "small",
+
+   enhancement_cost = {
+      log = 2,
+      planks = 1
+   },
+   
+   return_on_dismantle_on_enhanced = {
+      planks = 0
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 52, 54 },
+      },
+   },
+
+   aihints = {
+
+   },
+
+   working_positions = {
+      empire_forester = 1
+   },
+
+   programs = {
+      work = {
+         -- TRANSLATORS: Completed/Skipped/Did not start planting trees because ...
+         descname = _"planting trees",
+         actions = {
+            "sleep=66000",
+            "worker=plant"
+         }
+      },
+   },
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/init.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/init.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/init.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,56 @@
+tribes = wl.Tribes()
+include "scripting/mapobjects.lua"
+
+-- ===================================
+--    Campaign Specific Data
+-- ===================================
+print_loading_message("Loading campaign-specific tribe units", function()
+   -- ===================================
+   --    Empire Mission 4
+   -- ===================================
+   include "map:scripting/tribes/brewery.lua"
+   include "map:scripting/tribes/farm.lua"
+   include "map:scripting/tribes/foresters_house1.lua"
+   include "map:scripting/tribes/foresters_house.lua"
+   include "map:scripting/tribes/lumberjacks_house1.lua"
+   include "map:scripting/tribes/lumberjacks_house.lua"
+   include "map:scripting/tribes/mill.lua"
+   include "map:scripting/tribes/trainingcamp.lua"
+   include "map:scripting/tribes/well1.lua"
+   include "map:scripting/tribes/well.lua"
+end)
+
+tribes:add_custom_building {
+   tribename = "empire",
+   buildingname = "empire_brewery1",
+}
+
+tribes:add_custom_building {
+   tribename = "empire",
+   buildingname = "empire_farm1",
+}
+
+tribes:add_custom_building {
+   tribename = "empire",
+   buildingname = "empire_foresters_house2",
+}
+
+tribes:add_custom_building {
+   tribename = "empire",
+   buildingname = "empire_lumberjacks_house2",
+}
+
+tribes:add_custom_building {
+   tribename = "empire",
+   buildingname = "empire_mill1",
+}
+
+tribes:add_custom_building {
+   tribename = "empire",
+   buildingname = "empire_trainingcamp1",
+}
+
+tribes:add_custom_building {
+   tribename = "empire",
+   buildingname = "empire_well2",
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/lumberjacks_house.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/lumberjacks_house.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/lumberjacks_house.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,58 @@
+dirname = "tribes/buildings/productionsites/empire/lumberjacks_house/"
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_lumberjacks_house1",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Lumberjack’s House"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "small",
+   enhancement = "empire_lumberjacks_house2",
+
+   buildcost = {
+      log = 2,
+      planks = 1
+   },
+   
+   return_on_dismantle = {
+      log = 1,
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 40, 59 },
+      },
+   },
+
+   aihints = {
+
+   },
+
+   working_positions = {
+      empire_lumberjack = 1
+   },
+
+   outputs = {
+      "log"
+   },
+
+   programs = {
+      work = {
+         -- TRANSLATORS: Completed/Skipped/Did not start felling trees because ...
+         descname = _"felling trees",
+         actions = {
+            "sleep=400000", -- Barbarian lumberjack sleeps 25000
+            "worker=chop"
+         }
+      },
+   },
+   out_of_resource_notification = {
+      -- Translators: Short for "Out of ..." for a resource
+      title = _"No Trees",
+      heading = _"Out of Trees",
+      message = pgettext("empire_building", "The lumberjack working at this lumberjack’s house can’t find any trees in his work area. You should consider dismantling or destroying the building or building a forester’s house."),
+      productivity_threshold = 60
+   },
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/lumberjacks_house1.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/lumberjacks_house1.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/lumberjacks_house1.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,58 @@
+dirname = "tribes/buildings/productionsites/empire/lumberjacks_house/"
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_lumberjacks_house2",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Lumberjack’s House"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "small",
+
+   enhancement_cost = {
+      log = 2,
+      planks = 1
+   },
+   
+   return_on_dismantle_on_enhanced = {
+      planks = 1,
+	  --felling_ax = 1
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 40, 59 },
+      },
+   },
+
+   aihints = {
+
+   },
+
+   working_positions = {
+      empire_lumberjack = 1
+   },
+
+   outputs = {
+      "log"
+   },
+
+   programs = {
+      work = {
+         -- TRANSLATORS: Completed/Skipped/Did not start felling trees because ...
+         descname = _"felling trees",
+         actions = {
+            "sleep=400000", -- Barbarian lumberjack sleeps 25000
+            "worker=chop"
+         }
+      },
+   },
+   out_of_resource_notification = {
+      -- Translators: Short for "Out of ..." for a resource
+      title = _"No Trees",
+      heading = _"Out of Trees",
+      message = pgettext("empire_building", "The lumberjack working at this lumberjack’s house can’t find any trees in his work area. You should consider dismantling or destroying the building or building a forester’s house."),
+      productivity_threshold = 60
+   },
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/mill.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/mill.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/mill.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,64 @@
+dirname = "tribes/buildings/productionsites/empire/mill/"
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_mill1",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Mill"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "medium",
+
+   -- buildcost = {
+      -- log = 3,
+      -- granite = 3,
+      -- marble = 1
+   -- },
+   return_on_dismantle = {
+      log = 1,
+      granite = 2,
+      marble = 1
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 41, 87 },
+      },
+      working = {
+         pictures = path.list_files(dirname .. "working_??.png"),
+         hotspot = { 41, 87 },
+         fps = 25
+      },
+   },
+
+   aihints = {
+
+   },
+
+   working_positions = {
+      empire_miller = 1
+   },
+
+   inputs = {
+      { name = "wheat", amount = 6 }
+   },
+   outputs = {
+      "flour"
+   },
+
+   programs = {
+      work = {
+         -- TRANSLATORS: Completed/Skipped/Did not start grinding wheat because ...
+         descname = _"grinding wheat",
+         actions = {
+            "sleep=5000",
+            "return=skipped unless economy needs flour",
+            "consume=wheat:2",
+            "play_sound=sound/mill mill_turning 240",
+            "animate=working 10000",
+            "produce=flour"
+         }
+      },
+   },
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/trainingcamp.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/trainingcamp.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/trainingcamp.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,182 @@
+dirname = "tribes/buildings/trainingsites/empire/trainingcamp/"
+
+tribes:new_trainingsite_type {
+   msgctxt = "empire_building",
+   name = "empire_trainingcamp1",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Training Camp"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "big",
+
+
+   return_on_dismantle = {
+      granite = 3,
+      planks = 2,
+      marble = 3,
+      marble_column = 1
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 82, 105 }
+      }
+   },
+
+   aihints = {
+      trainingsites_max_percent = 1
+   },
+
+   working_positions = {
+      empire_trainer = 1
+   },
+
+   inputs = {
+      { name = "fish", amount = 2 },
+      { name = "meat", amount = 2 },
+      { name = "empire_bread", amount = 2 },
+      { name = "spear", amount = 1 },
+      { name = "spear_advanced", amount = 1 },
+      { name = "spear_heavy", amount = 1 },
+      { name = "spear_war", amount = 1 },
+      { name = "armor_helmet", amount = 1 },
+      { name = "armor", amount = 1 },
+      { name = "armor_chain", amount = 1 },
+      { name = "armor_gilded", amount = 1 },
+   },
+   outputs = {
+      "empire_soldier",
+   },
+
+   ["soldier attack"] = {
+      min_level = 0,
+      max_level = 3,
+      food = {
+         {"fish", "meat"},
+         {"empire_bread"}
+      },
+      weapons = {
+         "spear",
+         "spear_advanced",
+         "spear_heavy",
+         "spear_war"
+      }
+   },
+   ["soldier health"] = {
+      min_level = 0,
+      max_level = 3,
+      food = {
+         {"fish", "meat"},
+         {"empire_bread"}
+      },
+      weapons = {
+         "armor_helmet",
+         "armor",
+         "armor_chain",
+         "armor_gilded"
+      }
+   },
+
+   programs = {
+      sleep = {
+         -- TRANSLATORS: Completed/Skipped/Did not start sleeping because ...
+         descname = _"sleeping",
+         actions = {
+            "sleep=5000",
+            "check_soldier=soldier attack 9", -- dummy check to get sleep rated as skipped - else it will change statistics
+         }
+      },
+      upgrade_soldier_attack_0 = {
+         -- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
+         descname = pgettext("empire_building", "upgrading soldier attack from level 0 to level 1"),
+         actions = {
+            "check_soldier=soldier attack 0", -- Fails when aren't any soldier of level 0 attack
+            "sleep=30000",
+            "check_soldier=soldier attack 0", -- Because the soldier can be expelled by the player
+            "consume=spear empire_bread fish,meat",
+            "train=soldier attack 0 1"
+         }
+      },
+      upgrade_soldier_attack_1 = {
+         -- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
+         descname = pgettext("empire_building", "upgrading soldier attack from level 1 to level 2"),
+         actions = {
+            "check_soldier=soldier attack 1",
+            "sleep=30000",
+            "check_soldier=soldier attack 1",
+            "consume=spear_advanced empire_bread fish,meat",
+            "train=soldier attack 1 2"
+         }
+      },
+      upgrade_soldier_attack_2 = {
+         -- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
+         descname = pgettext("empire_building", "upgrading soldier attack from level 2 to level 3"),
+         actions = {
+            "check_soldier=soldier attack 2",
+            "sleep=30000",
+            "check_soldier=soldier attack 2",
+            "consume=spear_heavy empire_bread fish,meat:2",
+            "train=soldier attack 2 3"
+         }
+      },
+      upgrade_soldier_attack_3 = {
+         -- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
+         descname = pgettext("empire_building", "upgrading soldier attack from level 3 to level 4"),
+         actions = {
+            "check_soldier=soldier attack 3",
+            "sleep=30000",
+            "check_soldier=soldier attack 3",
+            "consume=spear_war empire_bread:2 fish,meat",
+            "train=soldier attack 3 4"
+         }
+      },
+      upgrade_soldier_health_0 = {
+         -- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
+         descname = pgettext("empire_building", "upgrading soldier health from level 0 to level 1"),
+         actions = {
+            "check_soldier=soldier health 0",
+            "sleep=30000",
+            "check_soldier=soldier health 0",
+            "consume=armor_helmet empire_bread,fish,meat",
+            "train=soldier health 0 1"
+         }
+      },
+      upgrade_soldier_health_1 = {
+         -- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
+         descname = pgettext("empire_building", "upgrading soldier health from level 1 to level 2"),
+         actions = {
+            "check_soldier=soldier health 1",
+            "sleep=30000",
+            "check_soldier=soldier health 1",
+            "consume=armor empire_bread fish,meat",
+            "train=soldier health 1 2"
+         }
+      },
+      upgrade_soldier_health_2 = {
+         -- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
+         descname = pgettext("empire_building", "upgrading soldier health from level 2 to level 3"),
+         actions = {
+            "check_soldier=soldier health 2",
+            "sleep=30000",
+            "check_soldier=soldier health 2",
+            "consume=armor_chain empire_bread:2 fish,meat:2",
+            "train=soldier health 2 3"
+         }
+      },
+      upgrade_soldier_health_3 = {
+         -- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
+         descname = pgettext("empire_building", "upgrading soldier health from level 3 to level 4"),
+         actions = {
+            "check_soldier=soldier health 3",
+            "sleep=30000",
+            "check_soldier=soldier health 3",
+            "consume=armor_gilded empire_bread:2 fish,meat:2",
+            "train=soldier health 3 4"
+         }
+      },
+   },
+
+   soldier_capacity = 2,
+   trainer_patience = 12
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/well.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/well.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/well.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,64 @@
+dirname = "tribes/buildings/productionsites/empire/well/"
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_well1",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Well"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "small",
+   enhancement = "empire_well2",
+
+   buildcost = {
+      log = 2,
+      granite = 1,
+      marble = 1
+   },
+   return_on_dismantle = {
+      marble = 1
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 43, 43 },
+      },
+      working = {
+         pictures = path.list_files(dirname .. "idle_??.png"), -- TODO(GunChleoc): No animation yet.
+         hotspot = { 43, 43 },
+      },
+   },
+
+   aihints = {
+
+   },
+
+   working_positions = {
+      empire_carrier = 1
+   },
+
+   outputs = {
+      "water"
+   },
+
+   programs = {
+      work = {
+         -- TRANSLATORS: Completed/Skipped/Did not start working because ...
+         descname = _"working",
+         actions = {
+            "sleep=30000",
+            "animate=working 30000",
+            "mine=water 5 100 10 2",
+            "produce=water"
+         }
+      },
+   },
+   out_of_resource_notification = {
+      -- Translators: Short for "Out of ..." for a resource
+      title = _"No Water",
+      heading = _"Out of Water",
+      message = pgettext("empire_building", "The carrier working at this well can’t find any water in his well."),
+      productivity_threshold = 15
+   },
+}

=== added file 'data/campaigns/emp04.wmf/scripting/tribes/well1.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/well1.lua	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/well1.lua	2017-11-25 23:51:00 +0000
@@ -0,0 +1,63 @@
+dirname = "tribes/buildings/productionsites/empire/well/"
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_well2",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Well"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "small",
+
+   enhancement_cost = {
+      log = 2,
+      granite = 1,
+      marble = 1
+   },
+   return_on_dismantle_on_enhanced = {
+      log = 1
+   },
+
+   animations = {
+      idle = {
+         pictures = path.list_files(dirname .. "idle_??.png"),
+         hotspot = { 43, 43 },
+      },
+      working = {
+         pictures = path.list_files(dirname .. "idle_??.png"), -- TODO(GunChleoc): No animation yet.
+         hotspot = { 43, 43 },
+      },
+   },
+
+   aihints = {
+
+   },
+
+   working_positions = {
+      empire_carrier = 1
+   },
+
+   outputs = {
+      "water"
+   },
+
+   programs = {
+      work = {
+         -- TRANSLATORS: Completed/Skipped/Did not start working because ...
+         descname = _"working",
+         actions = {
+            "sleep=30000",
+            "animate=working 30000",
+            "mine=water 5 100 10 2",
+            "produce=water"
+         }
+      },
+   },
+   out_of_resource_notification = {
+      -- Translators: Short for "Out of ..." for a resource
+      title = _"No Water",
+      heading = _"Out of Water",
+      message = pgettext("empire_building", "The carrier working at this well can’t find any water in his well."),
+      productivity_threshold = 15
+   },
+}

=== added file 'data/campaigns/emp04.wmf/version'
--- data/campaigns/emp04.wmf/version	1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/version	2017-11-25 23:51:00 +0000
@@ -0,0 +1,11 @@
+# Automatically created by Widelands master-2416_Release_x64 (Release)
+
+[global]
+map_source_url=
+map_release=
+map_creator_version="master-2416_Release_x64"
+map_version_major="0"
+map_version_minor="1"
+map_version_timestamp="1504032035"
+packet_version="1"
+packet_compatibility="1"

=== modified file 'data/tribes/empire.lua'
--- data/tribes/empire.lua	2017-11-23 09:13:06 +0000
+++ data/tribes/empire.lua	2017-11-25 23:51:00 +0000
@@ -147,7 +147,8 @@
          "empire_weaponsmith",
          "empire_armorsmith",
          "empire_scout"
-      }
+      },
+
    },
 
    immovables = {

=== modified file 'data/tribes/init.lua'
--- data/tribes/init.lua	2017-09-15 12:33:58 +0000
+++ data/tribes/init.lua	2017-11-25 23:51:00 +0000
@@ -471,7 +471,7 @@
       include "tribes/buildings/partially_finished/constructionsite/init.lua"
       include "tribes/buildings/partially_finished/dismantlesite/init.lua"
    end)
-
+ 
    -- ===================================
    --    Tribes
    -- ===================================
@@ -480,4 +480,6 @@
       include "tribes/barbarians.lua"
       include "tribes/empire.lua"
    end)
+   
+
 end)


Follow ups