Introduction
Welcome!
- If you are reading this guide with the intent of developing plugins for The Known Galaxy, continue reading.
- If you are reading this guide with the goal of understanding how to use a specific plugin, refer to the
Guides > For Plugin Userssection and all its docs within.
Running the Project
Basically everything you could need to do is achieved through a Lune Module. There are 2 ways to run it:
- Run
source .commands.shto get a terminal function setup that runs the module with the aliasplugins. E.g.:
> source .commands.sh
> plugins
- Just run
lune run mainevery time you want to use. The above is faster for repeat usages. This one is faster for one off usages. E.g.:
> lune run main
Inside there are self-explanatory interactive options for:
- Running unit tests
- Running static analysis
- Building the Studio testing place and the plugin itself (optionally to your local Studio plugin folder on your computer).
- Automatically uploading any images the plugin uses to ROBLOX.
- Deploying the plugin to the Roblox Marketplace.
Development Workflow
Once you have started the studio (achieved by running start build/place.rbxl) and you are ready to work, go through the following steps:
- Start the doc-site (if you haven't already) with
docsitefromsource .commands.sh. - Ensure
Config.DevelopmentModeis turned on insidesrc/Config.luauso that you get hot reloading, which ensures you don't have to constantly rebuild the Studio or manually save the files as a local plugin to see changes. - Start the rojo service with
rojo serve place.project.jsonand connect to it from Studio.
Creating New Modules
Now that you have your development environment setup and the plugin hot-reloading, you're ready to create a new module!
New modules are stored inside src/PluginModules as files with the name YourSubModule.module.luau.
That .module suffix is especially important since that's how the system detects that file as a possible submodule that it should try to load.
Once inside, use this snippet to create all the boilerplate for the new submodule:
"Plugin SubModule": {
"prefix": [
"pluginsubmodule",
"plugin",
"submodule"
],
"body": [
"--!strict",
"local PluginSubModule = require(script.Parent.Parent.Modules.PluginSubModule)",
"local PluginFacade = require(script.Parent.Parent.PluginFacade)",
"",
"local ${TM_FILENAME_BASE/.module//g} = PluginSubModule.new({",
"\tButtonIcon = nil,",
"\tDisplayName = \"Name\",",
"\tTooltip = \"Tooltip\",",
"\tActiveByDefault = false,",
"\tOneClickExecution = false,",
"\tDevelopmentModule = false,",
"})",
"",
"${TM_FILENAME_BASE/.module//g}:OnPreLoad(function(_pluginFacade: PluginFacade.PluginFacade)",
"\treturn true",
"end)",
"",
"${TM_FILENAME_BASE/.module//g}:OnPostLoad(function(_pluginFacade: PluginFacade.PluginFacade)",
"\treturn true",
"end)",
"",
"${TM_FILENAME_BASE/.module//g}:OnActivate(function(_pluginFacade: PluginFacade.PluginFacade)",
"\treturn true",
"end)",
"",
"${TM_FILENAME_BASE/.module//g}:OnDeactivate(function(_pluginFacade: PluginFacade.PluginFacade)",
"\treturn true",
"end)",
"",
"${TM_FILENAME_BASE/.module//g}:OnPreUnload(function(_pluginFacade: PluginFacade.PluginFacade)",
"\treturn true",
"end)",
"",
"return ${TM_FILENAME_BASE/.module//g}",
],
},
When working, make sure you pay attention to Development Rules.
Thanks for working towards making the lives of TKG developers just that little bit better...
plugins Creator and Architect, ShadowEngineer