In CRYENGINE, it is possible to create a custom Flow Graph node by using C++ to generate a .dll file that can be introduced to CRYENGINE as a plugin. This technique offers another solution for the users who prefer creating a custom node without having to create it from scratch. For more information about creating a Flow Graph node, please refer to the Creating a New Flow Node section.
The following applications will need to be installed in order to compile projects and the Engine itself.
Latest Supported Version
|Visual Studio||2015 (All Editions), vc140 compiler||2017 (All Editions), vc141 compiler|
Early installations of Visual Studio 2015 may have installed 10.0.10150.0 instead.
Please note that you have to restart your computer after installing the Windows SDK before attempting to compile the engine.
Create a Plugin CPP project and open the project folder.
For more information about creating a project, please refer to the Creating, Importing & Upgrading Projects page.The project files are stored separately from the engine. A .cryproject file will be generated for you; this can be right-clicked to reveal helper functionality or opened with a text editor to reveal JSON detailing the project.
Next, in the project folder, right-click on the Plugin.cryproject file and choose Generate solution;
Go to the solution file that has been generated and open the Plugin.sln file; e.g: \MyProject\solutions\win64\Plugin.sln
In the Solution Explorer, open project\Plugin\Plugin.cpp and paste the class & macro shown below just before the last line of the code block, which is CRYREGISTER_SINGLETON_CLASS(CPlugin):
In this example, the node will be called String:Substring, as indicated in the last line of the code block above.The last line of this block should be CRYREGISTER_SINGLETON_CLASS(CPlugin).
After copying the code, go to the Plugin.h → CPlugin class on the Solution Explorer and paste the following two lines at the bottom of the public section:
When the process is finished, the code block should look as follows:
These two lines will make sure that the Flow Graph node is registered/unregistered and they only need to be included once in total.
After confirming the code position is correct, proceed to the next steps:
- Build the solution by choosing Build → Build Solution on the Visual Studio menu bar. This will generate a .dll file in the MyPlugin\bin\win_x64 folder;
- Copy that .dll file to the \bin\win_x64 folder of any existing CRYENGINE project in which you want to use your plugin.
In this example, the GameSDK project is being used, so the .dll file is coped to \GameSDK\bin\win_x64;
Right-click on the GameSDK.cryproject file and Edit it in a plain text editor to add the following reference of the .dll file in the plugins section; keep in mind that the reference code shown below can be different based on the path of the project's bin folder:
}.If the new line is not the last line of the plug-in, make sure it ends with a comma.
Open the GameSDK.cryproject file in the Sandbox editor. Then proceed to Flow Graph to use the new node;You may also want to use visual panels to communicate related information, tips or things users need to be aware of.