Setting Up The Plugin Descriptor

Prerequisite: Building Your First GameBuilder Plugin


Favorite This Post!
0 Votes
Posted by Lavon on March 25, 2013

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.

Descriptor Class

%STEP_TITLE%

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.

Plugin Loaded!

%STEP_TITLE%

My Custom Plugin UI Panel In GBS

%STEP_TITLE%

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.


Congratulations on finishing this tutorial! Found it helpful? Spread the word...


Comments

There are no comments yet!


Anyone can leave a comment!


You just need to signup for an account or log-in before you can comment.