Manual:Mudlet Packages

From Mudlet
Jump to navigation Jump to search

What is a Mudlet package

It's a archive file that ends with .mpackage or .zip that contains xml files to import along with any resources a package might have (images, sounds and etc). Packages can be installed / uninstalled via a window in Mudlet.

The system is backwards-compatible and existing .xml files will also be recognized as packages.

How to install a Mudlet package

manually

Toolbox→Package Manager will open the window where you can 'Install' to install a package.

from the MUD

Packages can also be auto-installed from the MUD server via ATCP - the server should send "Client.GUI\n<url>", ie "Client.GUI\nhttp://blahblahblah.com/SomeGameUI.zip" and Mudlet will offer the user an option it downloading and using it automatically.

How to create a Mudlet package

Create a zip file - the name of the file will be the name of the package - that ends with either .mpackage (preferred) or .zip. Include all xml's that you'd like to be installed in the top level folder of the package (that is, don't have them within a folder in the archive - just have them be upfront).

If you'd like to include other folders or files in the package, you can - they will be copied into getMudletHomeDir().."/"..packagename upon installation, so your scripts can use them - or example, if your package is called "sipper" (thus you have sipper.mpackage as the file) and you have health.png as an image in it, you can place on a label like so:

<lua> -- you don't have to worry about \ versus / for file paths - use / everywhere, Lua will make it work on Windows fine

setBackgroundImage("my health", getMudletHomeDir().."/sipper/health.png") </lua>