Important Dates

Latest Posts

Topic: Add-On System

Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 18:07
Posts: 2021
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-11-26, 17:23

Widelands version 1.0 and newer has an add-on system. Many different add-ons are available for download on the server. They can be downloaded using the in-game add-ons manager.

Versions newer than 1.0 additionally offer other features such as uploading content, writing comments, and voting on add-ons.

How to develop and package add-ons

https://www.widelands.org/documentation/add-ons/

How to submit a new add-on or an update

  • In Widelands 1.1 and newer, upload it via the in-game add-ons manager.
  • With older Widelands versions, or if this does not work for various reasons, upload it as a zip file here and I or someone else will upload it for you.

Translating

https://www.transifex.com/widelands/widelands-addons/

Reporting Bugs and Feature Requests

Bugs related to a specific add-on should not be reported against the official game but against the add-ons server (https://github.com/widelands/wl_addons_server/issues). The Widelands development team does not officially support any specific add-ons, so only their authors are responsible for fixing bugs and implementing enhancements.
Issues related to the add-on system or backend itself should be reported on the main bugtracker (https://github.com/widelands/widelands/issues).

Happy modding face-smile.png

Edited: 2021-08-24, 17:26

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2508
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-11-27, 08:45

I'll try to make an addon with my shallow water terrains allthough they have some culprits.

What is meant with 'home directory' in the readme:

Add-ons have to be placed in the addons subdirectory of the home directory to be found by the game.

As a linux user 'home directory' refers to ~/ but i guess this is not the correct directory?


Top Quote
Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 18:07
Posts: 2021
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-11-27, 10:42

The one where your savegames, replays, config and stuff is stored: ~/.widelands/addons/shallow_water.wad


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2098
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-11-30, 18:35

Very good that the add-on-system is implemented, it fits extremely well to Widelands. While the player base has huge amounts of ideas how to change the game, consensus is rather rare. So, new ideas can implemented as add-on and they will not bother anyone.


Wanted to save the world, then I got widetracked

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2508
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-12-07, 09:38

It would be preferable if the maps section here on the home page gets a new entry "Created with addon: xy". So players knows which addon is needed to play this map.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2508
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-12-07, 09:40

Here is my addon for impassable water


Attachment:
impassable_water.zip (348.0 KB)

Top Quote
Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 18:07
Posts: 2021
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-12-07, 10:04

Uploaded face-smile.png

FYI there are a few warnings:

[00:02:35.083 real] WARNING: Unused key "editor_category" in LuaTable. Please report as a bug.
[00:02:35.084 real] WARNING: Unused key "editor_category" in LuaTable. Please report as a bug.
[00:02:35.086 real] WARNING: Unused key "editor_category" in LuaTable. Please report as a bug.

Looks like we'll need a coding change somehow to recognize this terrain as a kind of water so roads can be replaced with bridges.


Regarding maps with add-ons, I am in favour of prohibiting them on the maps upload page and asking people to make an add-on instead. I am going to write a utility to package your own maps as an add-on fully automatically from inside the add-on manager, and downloading maps as add-ons means much easier dependency handling for everyone who wants to use the map.

Edited: 2020-12-07, 10:05

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2508
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-12-08, 19:05

Another question: Is there some sort of compatibility check against a widelands version?

Background: The lua interface changed a lot in the past. Since i have an own datadir for testing purposes, some changes lead to additional work and time to keep my datadir in sync with the changes. Some distributions bundles old(er) versions of widelands (e.g. Debian and derivates) and other distributions have the actual version bundled or a user uses the ppa. There might be incompatibilities for addons in the future if the lua interface changes from version to version.


Top Quote
Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 18:07
Posts: 2021
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-12-08, 19:19

Currently there are no such checks yet. In the future this will be necessary of course, e.g. an add-on designed for Widelands v1.1 will likely not work with 1.0, and an add-on for 1.0 will probably but not necessarily work with 1.1. And the compatibilities of add-ons designed with master are unpredictable. But I decided not to implement any supported-version checking before we have a proper server for add-ons, to save the effort of having to implement it twice.

Internally I see two ways to make this work: Every add-on could have optional config properties for minimum and maximum supported Widelands versions, or the server could keep separate add-on lists for every stable version from 1.0 on (plus one list for master). I am undecided which one would be better though I slightly favour the first one…


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2508
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-12-09, 08:33

I forgot to say thanks for uploading and correcting my addon: THANKS face-smile.png


Top Quote