Introduction to Add-on libraries: Difference between revisions
(made stub of page) |
m (added categories) |
||
Line 1: | Line 1: | ||
{{stub}} | {{stub}} | ||
[[Category:Tutorial]] | |||
[[Category:Beginner]] | |||
== What Is An Add-on Library? == | == What Is An Add-on Library? == |
Revision as of 20:29, 19 September 2023
This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
What Is An Add-on Library?
An Add-on library is an extension to Maptool that may contain code, images or more. they generally are distributed as .mtlib files, but they actually are just a zip file with a specific structure.
First Add-on Library
firstly you will need a text editor there are many of them mentioned below if in doubt just use VS Code.
after choosing a text editor create a new directory to hold your Add-on. Top level files in the add-on are metadata files, they hold information about your add-on. the only file your add-on needs to be accepted by Maptool is library.json. You may have other non metadata files in a subdirectory which must be named library. for macro code you may have a mtscript directory inside library, both of those subdirectories may have a public directory which must be named public.
Creating library.json
the only required fields are
- a name string
- a authors array
- a short description string
- a namespace string
the other fields are described in Creation of add-on libraries #Configuration File Format: library.json most of these are self explanatory just remember bad things will happen if you use the same namespace as someone else so try to use at least 3 words or a reversed host name.
an example of a minimal library.json could be
{ "name": "test", "authors": ["you"], "namespace": "test.test.test", "shortDescription":"test" }
and that is it. you made an add-on those 6 lines are enough, just zip this file and then it rename so that it ends with .mtlib and have fun.