← Back to team overview

widelands-dev team mailing list archive

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

 

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

Commit message:
fixes 2 small bugs in lua related to AI behaviour
bug #1804039
bug #1801767

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1801767 in widelands: "Tutorial 2 (warfare): AI abandons sentry"
  https://bugs.launchpad.net/widelands/+bug/1801767
  Bug #1804039 in widelands: "Atlanteans AI deadlock due to no well in basic economy"
  https://bugs.launchpad.net/widelands/+bug/1804039

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

assign empty AI to p2 in warfare tutorial
add roads to p2 in warfare tutorial due to no AI can build them.

add one well to the atlantean basic economy as water is needed for crucial spidercloth production.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/lua_AI_fixes into lp:widelands.
=== modified file 'data/campaigns/tutorial02_warfare.wmf/player_names'
--- data/campaigns/tutorial02_warfare.wmf/player_names	2014-10-26 09:05:11 +0000
+++ data/campaigns/tutorial02_warfare.wmf/player_names	2018-11-20 20:35:50 +0000
@@ -12,5 +12,5 @@
 [player_2]
 name="Sparring Partner"
 tribe="empire"
-ai=
+ai="empty"
 closeable="false"

=== modified file 'data/campaigns/tutorial02_warfare.wmf/scripting/mission_thread.lua'
--- data/campaigns/tutorial02_warfare.wmf/scripting/mission_thread.lua	2017-12-19 17:04:30 +0000
+++ data/campaigns/tutorial02_warfare.wmf/scripting/mission_thread.lua	2018-11-20 20:35:50 +0000
@@ -78,7 +78,9 @@
 end
 
 function create_enemy()
-   prefilled_buildings(wl.Game().players[2],
+   local map = wl.Game().map
+   local p2 = wl.Game().players[2]
+   prefilled_buildings(p2,
       {"empire_barrier", 24, 7},
       {"empire_sentry", 29, 16},
       {"empire_tower", 30, 21},
@@ -88,7 +90,10 @@
          }
       }
    )
-   wl.Game().players[2]:forbid_buildings("all")
+   connected_road(p2,map:get_field(29,17).immovable,"tr,tl|tl,tl|tl,tl|tl,tl|tl,l")
+   connected_road(p2,map:get_field(31,22).immovable,"tr,tl|tl,tl,tl")
+   connected_road(p2,map:get_field(31,28).immovable,"tr,tr|tr,tl|tl,tl")
+   p2:forbid_buildings("all")
 end
 
 function attack()

=== modified file 'data/tribes/buildings/productionsites/atlanteans/well/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/well/init.lua	2018-05-24 10:19:21 +0000
+++ data/tribes/buildings/productionsites/atlanteans/well/init.lua	2018-11-20 20:35:50 +0000
@@ -31,6 +31,7 @@
    },
 
    aihints = {
+      basic_amount = 1,
       collects_ware_from_map = "water"
    },
 


Follow ups