Is it possible to define a custom win condition to a map? I tried looking at wl lua documentation, but after few moments of reading I am still unsure. A custom win condition could be used to make the issue with lack on naval invasions go away.
Jepp, that's exactly the way to go to handle the problem of islands completely owned by opposing players.
Basically you've got two ways to go:
- Create a dynamic win condition that takes care about the island problematic for every possible seafaring map - this would be great for widelands, but I fear it is much harder to create than the following.
- Create a scenario script for the map that does not really have to contain a story (but of course can, if you like), but the initial set up of the players and the win condition handling - this might be easier as creating a dynamic win condition, as you can be sure about the terrain, player position and all the other placements on your map.
Concering the scenario scripting: Widelands differs between singleplayer and multiplayer scripts (init.lua vs multiplayer_init.lua). For example take a look at "The green plateau" (Plateau.wmf) for an example of a single player script and at the maps in "maps/MP Scenarios" for multiplayer scenarios.
You can basically create either a single player, a multiplayer or both scenarios for a map. If you want the single player scenario to be the same as the multiplayer scenario, either copy the one file to the other one or save the logic to a third file (e.g. "win_condition.lua" and call that file from within the multiplayer_init.lua as well as from the init.lua (for how to call/include functions from another file, take a look at lines 52-53 of maps/MP Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua -> use("map", "texts") ... )