Skip to content

3.5.X 3.6.X Version

Hendrik Polczynski edited this page Oct 11, 2015 · 1 revision

C++ Integration (3.5.x-3.6.x)

Follow these steps to integrate the Plugin SDK into your GameDLL.

Repository Setup

  • Clone the repository to your local machine to your Code directory e.g. C:\CryENGINE_PC_vX.X.X\Code or C:\Program_Files_(x86)\Steam\steamapps\common\CRYENGINE\Code (when using EaaS).
  • Use a github UI version like Github for Windows or the VS2013 integration
  • or if you already have git installed
git clone https://github.com/hendrikp/Plugin_SDK.git

Compiler Settings

  • Open the Solution CryEngine_GameCodeOnly.sln
  • Open CryGameSDK Properties
  • Set the Dropdowns to All Configurations, All Platforms
  • Add to C/C++ -> General -> Additional Include Directories (Important to add it as last directory):
;$(SolutionDir)..\Plugin_SDK\inc
  • Apply those properties and close the dialog

Modify CryEngine GameDLL Source Files

  • Inside the CryGameSDK project (Solution Explorer) open the following file: Startup Files / GameStartup.cpp
  • Add behind the existing includes the following:
#include <IPluginManager_impl.h>
  • Find the function CGameStartup::Init
  • Add in the middle of the function (after InlineInitializationProcessing("CGameStartup::Init LoadLocalizationData");) the following:
InlineInitializationProcessing("CGameStartup::Init LoadLocalizationData"); // <--

PluginManager::RememberStartupParams(startupParams);
  • Add at the end of the function (before return pOut;) the following:
PluginManager::InitPluginsLast();
return pOut; // <--
  • Inside the CryGameSDK project (Solution Explorer) open the following file: Game Files / Game.cpp
  • Add behind the existing includes the following:
#include <IPluginManager_impl.h>
  • Find the function CGame::RegisterGameFlowNodes
  • Add at the end of the function the following:
    PluginManager::RegisterPluginFlownodes();
} // <--
  • Find the function CGame::Init(IGameFramework *pFramework)
  • Add in the middle of the function (after RegisterGameObjectEvents();) the following:
    RegisterGameObjectEvents(); // <--

    PluginManager::InitPluginManager();
    PluginManager::InitPluginsBeforeFramework();

Attention:

You already downloaded the latest Plugin_SDK version during repository setup. Now you need to build it once before building the CryGameSDK project. Open an additional visual studio and build the Plugin_SDK project once, after this you can now build the CryGameSDK without errors. (This requires the CrySystem.dll to be in the correct relative directory to the Plugin SDK, If you have renamed/moved your Gamefolders etc. it will not work and the build scripts will need to be adjusted manually)


At this point no plugin is using this, but its integrated in the prebuilt version: