Prerequisite: Building Your First GameBuilder Plugin
Every plugin written for GBS needs to have a PluginConfig.xml file, a plugin descriptor that extends the PluginDescriptor class that is in the GBS Plugin lib swc that you can download from our site, a class list file of all the classes you want to include in the plugin, and a unique plugin id.
Above is a basic example of a plugin descriptor. A basic GBS plugin requires a few settings to be in place. The uid, class list, and objectDescriptors. The uid needs to be a random string so that it does not conflict with other plugins. The class list will just register all of the classes in your plugin with GBS so that it can be used in a final game later on. The reason this is needed is two fold. GBS needs to reference the classes in the final generated game and any class that is not defined in the class list will not be included in the resulting plugin SWC. The objectDescriptor vector will tell GBS what components exists in the plugin and allow you to pass things like a small thumbnail image description and set which game types the component is compatible with. Currently there are only two game types in GBS, basic 2D and isometric 2.5D. In the future there may be more game types. If you don't declare a component in the objectDescriptor list it will not show up in GBS for the end user to use.
Note that you have the ability to pass multiple component ui skins to the ObjectDescriptor to show more than one sections of properties. So you could define to different ui component skin classes for the same component.
Creating The Class List
The class list is where you list all of the classes in your plugin SWC. This is very important, because if you create a VO object or Event class that your component uses and you don't list it here. The final GBS game may throw errors when you try to run it because it kind find the necessary files.
You can also assign types to classes such as Actions, States, and State Transitions. This is useful for components that need to display a list of global actions or including a custom state in GBS.
Once you have your plugin files created and both of these descriptor classes created you're plugin should be ready to be loaded into GBS. If you setup your environment correctly and set the output folder to the GBS plugins folder, then you should be able to just launch GBS and see that your new plugin was loaded into GBS. You can check this by hitting the "~" key on your keyboard to open the hidden console.
My Custom Plugin UI Panel In GBS
The plugin you just built should appear in the components list in GBS and when you click on it, the properties panel should have a user input field with the value we hardcoded in the CustomGameEngineComponent.