Currently Online

Latest Posts

Topic: Add-On System

Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1433
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-06-05, 20:12

Uploaded (with some minor i18n tweaks, goes without saying) face-smile.png


Top Quote
OIPUN
Avatar
Joined: 2020-11-17, 09:34
Posts: 97
Ranking
Likes to be here
Location: Czech
Posted at: 2021-06-09, 20:07

I packed 2 maps into an add-on. I tested it and it seams to work fine. Also one printscreen attached.


Attachment: white_summer_maps.wad.zip (966.7 KB)

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1433
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-06-09, 20:22

Uploaded


Top Quote
rmazurek
Avatar
Joined: 2021-07-06, 04:01
Posts: 5
Ranking
Just found this site
Posted at: 2021-07-06, 04:13

One thing is not clear to me about modding. Where can I find informations about variables names? Specifically I mean buildings.

I have an idea to change factions towers. Basically I think about towers as kind of watch post, something to see more land, not defend. I would like to decrease capacity to 1 soldier but for exchange increase conquer range and possibly visibility range.

I searched this forum and tried googling but did not found informations how could I possibly do it.

Thanks in advance for help.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2083
Ranking
One Elder of Players
Location: Germany
Posted at: 2021-07-06, 08:15

Hi rmazurek and welcome to the forums!

rmazurek wrote:

One thing is not clear to me about modding. Where can I find informations about variables names?

The documentation about modding and scripting is available at https://www.widelands.org/documentation/reference/, but ...

I have an idea to change factions towers. Basically I think about towers as kind of watch post, something to see more land, not defend. I would like to decrease capacity to 1 soldier but for exchange increase conquer range and possibly visibility range.

... this is not possible without much effort at the moment. The reason is that currently one has to change the settings you want at runtime of a game, but your idea should be applied during initialization of a game (changing the tribes militarysites). There is an open pull request to change some of the points in your idea during initialization. If this pull request get merged the new possibilities will be available in the developement version, but are not official yet.

Currently your idea can be scripted as an addon, but will possible lead to desyncs in multiplayer games. If you want to get some help anyway about scripting your idea, please open another topic face-smile.png


Top Quote
rmazurek
Avatar
Joined: 2021-07-06, 04:01
Posts: 5
Ranking
Just found this site
Posted at: 2021-07-06, 14:54

kaputtnik wrote:

Hi rmazurek and welcome to the forums!

rmazurek wrote:

One thing is not clear to me about modding. Where can I find informations about variables names?

The documentation about modding and scripting is available at https://www.widelands.org/documentation/reference/, but ...

I have an idea to change factions towers. Basically I think about towers as kind of watch post, something to see more land, not defend. I would like to decrease capacity to 1 soldier but for exchange increase conquer range and possibly visibility range.

... this is not possible without much effort at the moment. The reason is that currently one has to change the settings you want at runtime of a game, but your idea should be applied during initialization of a game (changing the tribes militarysites). There is an open pull request to change some of the points in your idea during initialization. If this pull request get merged the new possibilities will be available in the developement version, but are not official yet.

Currently your idea can be scripted as an addon, but will possible lead to desyncs in multiplayer games. If you want to get some help anyway about scripting your idea, please open another topic face-smile.png

Thank you for your reply face-smile.png

I could not find informations I need, so I asked here.

Usually such settings are defined in text files and it's easy for modding. I hope it will be this way in this game too, at some point.

I don't care about multiplayer face-smile.png


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 1952
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-07-06, 15:32

@rmazurek

if you just want tomod your own istallation by modifying the .lua files defining our tribes. They are scripts that can be edited easily with an text editor. Information about sysntax and content of them can be found in the link kaputtnik provided.
the files themselves can be found in the data directory of your installation. Most of them are in the tribes subfolder.
For modding you could simply copy the data directory and use the modded version while specifying the --datadir commandline option on startup. You may want to search the forum how to use it.


Top Quote
rmazurek
Avatar
Joined: 2021-07-06, 04:01
Posts: 5
Ranking
Just found this site
Posted at: 2021-07-06, 16:26

Thanks for advice :) I'll definitelly dig into it.


Top Quote
rmazurek
Avatar
Joined: 2021-07-06, 04:01
Posts: 5
Ranking
Just found this site
Posted at: 2021-07-06, 16:42

Wow, it's so freaking simple :D I mean I just edited game configs for now. I have to learn how to make it as mod, so I don't have to copy from backup after game's updates.

Thanks once again, it's so awsome face-smile.png


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1433
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-07-06, 18:35

Hi and welcome from me as well face-smile.png

Just to get back to your initial question, the relevant interface to adjust the properties of existing units by creating a Tribes add-on is this one function: https://www.widelands.org/documentation/autogen_wl/#wl.Descriptions.modify_unit
And the usage looks e.g. like this: https://github.com/widelands/wl_addons_server/blob/master/addons/the-x-mod.wad/barbarians/militarysites.lua
General information about add-ons is here: https://www.widelands.org/documentation/add-ons/

As kaputtnik said there is a bunch of more properties (including soldier capacity, conquer range, vision range) in review and will be available in the development version sometime soon. If there are any other properties of any units you'd like to be able to change via add-on scripting, please mention it here face-smile.png In the long run I intend to make all properties of all units modifyable like this, but I prefer to implement every aspect only when it's first needed, as unused code is bug-prone.


Top Quote