Latest Posts

Topic: encyclopedia data doesn't match actual behaviour / inconsitent lua file

Arty
Avatar
Joined: 2018-08-03, 12:14
Posts: 20
Ranking
Pry about Widelands
Posted at: 2018-08-12, 18:29

I noticed some info in an encyclopedia entry that doesn't match actual building behaviour. It matches an inconsistency in the lua file though, so am I correct to assume that encyclopedia entries for buildings etc. are automatically generated (at least partially) from the corresponding lua files (or maybe from the data generated by the lua files)?

The mentioned inconsistency is in the recent program version "master-3549-Release_x64" for the Frisian buidling "Training Camp". In short, the encyclopedia entry says that both health and defense training require Beer AND Bread while they actually require Beer OR Bread.

More detailed:

The encyclopedia entry lists as food requirements for both health training and defense training Smoked Fish or Smoked Meat | Beer | Bread (http://prntscr.com/khp55x), which is also what the lua file for the Training Camp lists in the parameter table of new_trainingsite_type:

   ["soldier health"] = {
      min_level = 0,
      max_level = 0,
      food = {
         {"bread_frisians"},
         {"beer"},
         {"smoked_fish", "smoked_meat"},
      },
      weapons = {
         "helmet",
      }
   },
   ["soldier defense"] = {
      min_level = 0,
      max_level = 0,
      food = {
         {"bread_frisians"},
         {"beer"},
         {"smoked_fish", "smoked_meat"},
      },
      weapons = {
         "fur_garment_studded",
      }
   },

This is different from what the lua file for the Training Camp lists in its programs table:

      upgrade_soldier_health_0 = {
         ...
         actions = {
            ...
            "consume=helmet bread_frisians,beer smoked_fish,smoked_meat",
            ...
         }
      },
      upgrade_soldier_defense_0 = {
         ...
         actions = {
            ...
            "consume=fur_garment_studded bread_frisians,beer smoked_fish,smoked_meat",
            ...
         }
      },

which - in both cases - is Smoked Fish or Smoked Meat | Beer or Bread.

Whether Beer AND Bread or Bear OR Bread is what it's supposed to be, one of those should be adjusted to match the other.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 2626
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-08-13, 10:13

Good catch! face-smile.png

I have created a branch: https://code.launchpad.net/~widelands-dev/widelands/fix-frisian-trainingsites-food-help


Busy indexing nil values

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 2626
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-08-16, 08:54

Fix has been merged with r8787. Thanks for reporting!


Busy indexing nil values

Top Quote