Latest Posts

Topic: Weapon reuse?

Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-15, 20:28

The buildings and their count belonging to basic economy are defined by this entry: http://bazaar.launchpad.net/~weedfreak/widelands/recycling_centre/view/head:/data/tribes/buildings/productionsites/barbarians/recycling_centre/init.lua#L38

I agree these building does not need to be part of basic economy, but there are some considerations applied to all productionsites:

  • Is output needed? (considers amount of output ware on stock)
  • Are there producers for inputs? (BTW what buildings produce scrap?)
  • Are some input wares on stock currently?

Once the branch will work properly I might spend some time debugging why the building is not built... If it is matter of training, or some modification to code is needed....


Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-12-16, 09:43

So removing that line "basic_amount = 1," will remove the buiding from the basic economy, I am not sure why it was only in the barbarians building, but I will do that now..

The only producers of scrap are training sites that upgrade weapons, some recycling centres also occasionally produces scrap metal when dismanting armour.

Branch 8517 should work now. I am not sure if the recycling centres are not built by the AI, I do not remember seeing any but due to seg faults I currently have I cannot run a game long enough to see if any are built now.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-12-16, 11:29

AI hints are documented: https://wl.widelands.org/docs/wl/autogen_ai_hints/

When did you last update your Widelands version? We fixed quite a number of crashes during the last few weeks.

If you have a current version, we would be very much interested in what those segfaults are.

Edited: 2017-12-16, 11:30

Busy indexing nil values

Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-12-16, 13:26

Thanks for the link.

WL version is the latest, the seg faults seem to be time related but I get no other messages that seem to relate.

Just before the last crash I did notice that Empire and Barbarians both built recycling centres at the same time as they built smelters.

Edited: 2017-12-16, 13:48

Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-16, 17:29

One of issues in AI code is that it does not expect that trainingsites can have outputs, I will modify this...


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-16, 18:10

When trying to update AI code I got:

defaultai.cc:843:41: error: ‘const class Widelands::TrainingSiteDescr’ has no member named ‘output_wares’; did you mean ‘input_wares’?

So perhpas TrainingSiteDescr has to be updated as well..


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-12-16, 18:55

You need to use ProductionSiteDescr::output_ware_types() and ProductionSiteDescr::output_worker_types(). TrainingSiteDescr inherits from ProductionSiteDescr, so it has all the same public functions.

The naming scheme for input and output is inconsistent, so please feel free to refactor that.


Busy indexing nil values

Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-16, 20:24

Now I get:

Could not read tribes information: [/var/widelands2/BZR/recycling_centre/src/scripting/lua_errors.cc:22] [/var/widelands2/BZR/recycling_centre/src/scripting/lua_errors.cc:22] The script 'campaigns/emp04.wmf/scripting/Custom_entities/new_well1.lua' was not found!

on any map... (I tried 2)


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-12-17, 09:25

Me too. Looks like you are basing your branch on an outdated version of an Empire Mission 4 branch.

Best make a copy of your data directory, get a fresh version of trunk and just add your new buildings.


Busy indexing nil values

Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-12-17, 10:07

No idea how that got in, I have never pulled that branch. I am putting it down to this cold I have.

With regard to not building recycling until after training sites would a prohibited_till that is the same or greater than the training site be enough to delay the buildings? Or would it be better to make the recycling a helper for training sites?


Top Quote