大家好,我叫人宅
加载自己做的引擎插件报错
PrimaryGameModuleCouldntBeLoaded", "The game module '{0}' could not be loaded. There may be an operating system error or the module may not be properly set up.
先讲解一下关于加载的简单流程:
{
int32 ErrorLevel = GEngineLoop.PreInit( CmdLine );
}
int32 FEngineLoop::PreInit( const TCHAR* CmdLine )
{
...
if ( !LoadStartupModules() ) // 引擎加载到71%- 75%
{
// At least one startup module failed to load, return 1 to indicate an error
return 1;
}
...
}
//开始加载插件
bool FProjectManager::LoadModulesForProject( const ELoadingPhase::Type LoadingPhase )
{
...
//加载
FModuleDescriptor::LoadModulesForPhase(LoadingPhase, CurrentProject->Modules, ModuleLoadFailures);
...
}
这个时候出现了
首先要检查是不是加载 了该模块
在.uproject里面 在项目里面
"Plugins": [
{
"Name": "MD_SqlTool",
"Enabled": true
},
如果确定没什么问题
再检查.uplugin 里面
"Type": "Runtime",
"LoadingPhase": "PreDefault"
PreDefault:是在引擎未加载Uobject时候开始加载该插件
一下是引擎源代码
{
FScopedSlowTask SlowTask(3);
// Load any modules that want to be loaded before default modules are loaded up.
if (!IProjectManager::Get().LoadModulesForProject(ELoadingPhase::PreDefault) || !IPluginManager::Get().LoadModulesForEnabledPlugins(ELoadingPhase::PreDefault))
{
return false;
}
// Load modules that are configured to load in the default phase
if (!IProjectManager::Get().LoadModulesForProject(ELoadingPhase::Default) || !IPluginManager::Get().LoadModulesForEnabledPlugins(ELoadingPhase::Default))
{
return false;
}
// Load any modules that want to be loaded after default modules are loaded up.
if (!IProjectManager::Get().LoadModulesForProject(ELoadingPhase::PostDefault) || !IPluginManager::Get().LoadModulesForEnabledPlugins(ELoadingPhase::PostDefault))
{
return false;
}
}
如果关于插件制作商有什么问题欢迎留言:
如果对独立游戏感兴趣也可以
http://www.aboutcg.org/course/tut_ue4programming_180119/