ufna / VaRest

REST API plugin for Unreal Engine 4 - we love restfull backend and JSON communications!
https://www.unrealengine.com/marketplace/en-US/product/varest-plugin
MIT License
1.07k stars 292 forks source link

Error with varesteditorplugin in standalone (4.12) #69

Closed jcageman closed 8 years ago

jcageman commented 8 years ago

Hi,

I am getting the following error when running my project with VaRest standalone in 4.12:

[2016.06.11-14.01.37:385][ 1]LogLinker:Warning: Can't find file '/Script/VaRestEditorPlugin' [2016.06.11-14.01.37:386][ 1]LogUObjectGlobals:Warning: Failed to load '/Script/VaRestEditorPlugin': Can't find file '/Script/VaRestEditorPlugin' [2016.06.11-14.01.37:386][ 1]LogLinker:Warning: Can't find file for asset '/Script/VaRestEditorPlugin' while loading NULL. [2016.06.11-14.01.37:386][ 1]LogUObjectGlobals:Warning: Failed to load '/Script/VaRestEditorPlugin': Can't find file for asset '/Script/VaRestEditorPlugin' while loading NULL.

I using the following .bat for standalone: @echo off

REM Start client with uncooked content.

start "" "C:\Program Files\Epic Games\4.12\Engine\Binaries\Win64\UE4Editor.exe" "%~dp0\MyGame.uproject" -game -log -verbose

After investigation i noticed that it works fine if i change the configuration of the loading of the plugin to: "Name": "VaRestEditorPlugin", "Type": "Runtime", "LoadingPhase" : "PreDefault"

I.e. the errors are there because the UE4 code expects the plugin to be loaded. Note: i am using the "break json" functionality from VaRestEditorPlugin.

ufna commented 8 years ago

Hi @jcageman ,

It's not the bug of the VaRest, that's just how plugins work in UE4 for today (I hope Epic will fix it once).

If you're launching your project in Standalone mode (not packaged one) it doesn't load editor modules, but they are required in some cases because game really is not built for standalone usage. So, to test it in this mode without packaging you should change editor module to runtime - it's a hack, but it works.

But please note that you have to change it back to Editor once you'll begin to package your project!

jcageman commented 8 years ago

Thanks for your quick response :+1: Its a shame that they implemented in that way, i had similar issues before with packaging, but didn't expect the same could happen in standalone. Thanks for the info and for this great plugin!

ufna commented 8 years ago

@jcageman You're welcome! :)

jcageman commented 8 years ago

One small question: i found out that if i set the option to Developer plugin it loads both in standalone/editor and works fine in packaging. Isn't that the correct solution approach?

ufna commented 8 years ago

@jcageman As it mentioned in documentation,

Developer modules will only be loaded in development runtime or editor builds, but never in shipping builds.

So I think I should test it with Shipping build then to check that it will work :)

ufna commented 8 years ago

Fixed in https://github.com/ufna/VaRest/commit/51778b4e505138045e07f6194442501b57d836d8