Plugin creation needs more automated assistance

To create a plugin, there is two way - 1. Create a new project and modify it to be a plugin type and add to existing one / 2. Download the example plugin and modify and same.
Unfortunately, both way are cumbersome to configure and not documented well.

Official document describes what needed to be done to work project as a plugin, but explanation is not thorough, the change item is too many and can easily missed.

As far as I figured out :

  1. Copy Plugin project to {Project Dir}\Plugins\
  2. Open project’s .flaxproj with a text editor and add Reference conf string refer to the template
  3. Open project’s {Project Dir}\Source\Game\Game.Build.cs with a text editor and add options.PrivateDependencies.Add string refer to the template class name you want to configure
  4. Go to {Project Dir}\Plugins{Plugin Name}\ and delete Game.Gen.cs
  5. Go to {Project Dir}\Plugins{Plugin Name}\ and rename Game(Editor)Target.Build.cs files into {Plugin Name}(Editor)Target.Build.cs.
  6. Go to {Project Dir}\Plugins{Plugin Name}\Game\ and delete Game.Build.cs
  7. Go to {Project Dir}\Plugins{Plugin Name}\ and rename directory ‘Game’ into {Plugin Name}
  8. Open {Project Dir}\Plugins{Plugin Name}{Plugin Name}EditorTarget.Build.cs with a text editor and modify GameEditorTarget class declation into {Plugin Name}{Editor target class postfix name}
  9. Change string for Modules.Add(“Game”) into Modules.Add("{Plugin Name}") and add another line for editor module if you want to
  10. Open {Project Dir}\Plugins{Plugin Name}{Plugin Name}Target.Build.cs with a text editor and modify GameEditorTarget class declation into {Plugin Name}{target class postfix name}
  11. Change string for Modules.Add(“Game”) into Modules.Add("{Plugin Name}")
  12. Create your code inside plugin source
  13. Add _description fill code inside your GamePlugin class (C++) or create PluginDescription filled (C#) to be shown in Plugin window list (editor)

You can skip a few steps with Example Plugin repository, but still have to rename a lot of things manually by your hand.

As you see, the process just to “rename things to fit in the new name and un-standalonize” is to much fragmented into pieces and easy to miss. It is possible, but currently it is in very handcrafting way.

Engine needs utility to automatically generate ‘plugin-type’ project and fill the class names, module names, file and directory names from the Plugin name.

For Flax 1.7 we got cool improvements in this area:

2 Likes

Thanks, it’s promising!
Unfortunately master version engine does not run for me, but expecting next 1.7 release.

Tested with this officially supported item for Clone Plugin, but didn’t worked. it just created an empty directory inside ‘Plugins’ and nothing happens. No network activity appears in system monitor…

Tried ‘Run as Administrator’ but nothing was different. Not sure this is system specific problem. Too bad…

It works fine for me. Do you have git installed? It is a requirement for the clone plugin feature to work. Also it is set up so that there should be errors in the log if there is an issue with cloning, best to share those if you have an issue.

I am using external git, not merged into environment path. It might be the difference.

Possible ++ Requirement for editor : git executable installation, configured with system path

For record, I couldn’t see any log lines writing in log window when clicking ‘Clone Plugin’ button.
After that I installed the plugin manually, so didn’t watch log files directly.

Anyway I agree that git is the key