WesMods

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
fendrin
Posts: 31
Joined: September 10th, 2009, 10:45 am

WesMods

Post by fendrin »

WesmereModule or short WesMod is a container format for WesScripts.

Since they are read by the WesGameServer they do not contain any images, music or sound files.
When an Add-on comes with extra (non core) image and music it goes into a "WesPack" which is read by the WesGameClient.

Each WesMod comes in a top-level directory, with an arbitrary name.
The convention is to write all directories and files which don't have a special meaning with a first lower case letter.

It's sub-directories are scanned for content with the sub-directory's name's scope.
This means the "Units" directory is scanned with all UnitsWSL functions available.
So far known scopes and thus sub-directories are:
Terrain, Units, Help, WSL and Scenario.

The engine makes sure to process the sub-directories in the correct order.
Terrain comes before Units to validate the unit_types' move_types for invalid terrain_type usage.

Files in the top-level directory are processed in the WesMod scope, containing functions for
root, core, era, or campaign declarations.

A special sub-directory is the WesMods one.
It contains sub-WesMods.

The WesGameServer only loads the WesMod itself, not the sub-modules.
Motivation
Wesnoth's add-on structure relies heavily on the usage of macros and file inclusion.
WSL code is not pre-processed, thus both concepts have to be replaced.

While Wesnoth emulates some kind of module system by reloading the WML tree with different set of pre-processor symbols defined, a WesGameServer relies on loading a set of WesMods.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
"The thing a project in the true spirit of open source has to fear is not forking, but clean-room re-implementation. When that happens, you know something is wrong."
Post Reply