Currently Online

Latest Posts

Topic: Enhancement / Upgrade buildings via lua-code.

MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 349
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-07-07, 20:01

How far is the program code to force a building upgrade in Lua using a command? I submitted the proposal to Github a few weeks ago. -> https://github.com/widelands/widelands/issues/4931

I need the code to fix a bug in the Europeans. The AI does not upgrade the training sites on its own, so I will force it to do so using a timer in the starting conditions.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2057
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-07-07, 20:13

If nothing's changed in the issue yet then nothing has happened so far. We are very short of developers at the moment. However I had labelled it Good First Issue because this is an issue that can be worked on with minimal knowledge of C++ and the codebase required. Most of the implementation would be duplicating the function LuaBuilding::dismantle (using enhance_building instead of dismantle_building) which is found in src/scripting/lua_map.*.

The AI does not upgrade the training sites on its own, so I will force it to do so using a timer in the starting conditions.

Won't this also affect human players?


Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 349
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-07-07, 20:19

Nordfriese wrote:

If nothing's changed in the issue yet then nothing has happened so far. We are very short of developers at the moment. However I had labelled it Good First Issue because this is an issue that can be worked on with minimal knowledge of C++ and the codebase required. Most of the implementation would be duplicating the function LuaBuilding::dismantle (using enhance_building instead of dismantle_building) which is found in src/scripting/lua_map.*.

The AI does not upgrade the training sites on its own, so I will force it to do so using a timer in the starting conditions.

Won't this also affect human players?

If there's a way to evaluate if a player is an AI, it don't. Then the script can simply switch off this timer in the starting condition.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 349
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-07-07, 20:21

I have rudimentary knowledge of C ++, it is enough to understand your code to some extent. Maybe I should get down to it and do something about it.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2745
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-07-07, 20:28

MarkMcWire wrote:

How far is the program code to force a building upgrade in Lua using a command? I submitted the proposal to Github a few weeks ago. -> https://github.com/widelands/widelands/issues/4931

Well, the expectation that every filed issue is solved within weeks is simply not right. there are much mor even older issues that aren't solved yet, due to the lack of somebody wanting to work on this. Shouting at the developers won't help the motivation to do so.
So either be patient or go learn some basic c++ and providre a PR to implement the code you need.

I need the code to fix a bug in the Europeans.

Exactly. You need it. But the rest of the game or the community does not necessarily need it.


Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 349
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-07-07, 20:30

I dont shouting at the developers, its only a question or reminder. I've create a piece of code and will make an request.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2745
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-07-07, 20:36

MarkMcWire wrote:

I dont shouting at the developers, its only a question or reminder. I've create a piece of code and will make an request.

Ok, Sorry for the misunderstanding then.


Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 349
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-07-07, 20:59

I've posted the code snippets on Github.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2745
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-07-07, 21:05

MarkMcWire wrote:

I've posted the code snippets on Github.

that is suboptimal in terms of workload. Please clone the repository, create a branch with your changes, upload it ither to the master repository or your forked repository and create a PR to merge the changes into the main trunk.
If you need help with github to do this please feel free to ask.
otherwise somebody of us needs to do allthee steps and implement changes during the review process.


Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 349
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-07-07, 21:18

I will test it und if it works, I will make it so.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote