Jump to content

Unigine loads invalid editor script?


photo

Recommended Posts

We were trying to use a modified Editor script for some custom functionality in the Unigine editor. But no matter what changes were made, they weren't getting reflected. I even tried an intentional syntax error, but even then the editor successfully loaded. Then I delete *all* editor.cpp files from my system and still the editor was successfully loaded! So I tried giving a bogus filename using the

"editor_script" console command

editor_script editor.ccf

and surprisingly unigine said

Loading "editor.ccf" 44 ms

when such a file doesn't even exist and the editor loaded up just fine.

So is the editor script cached somewhere? This is really confusing and how can I find out exactly which editor script file is being used so that I can modify that?

PFA the log.

-a.

log.html

Link to comment

Editor script is inside core.ung.

You can create core/editor path inside data directory and put modified editor files there.

In this case engine should take modified scripts, because packaged scripts have lower priority when searching for specific files.

Link to comment

Thanks for the reply anet, but the problem seems to be that Unigine doesn't pick up the custom editor script. Can you verify that this functionality works? And also it's showing wrong feedback like

Loading "editor.ccf" 44 ms

 

I just now tried putting a custom editor.cpp inside both data\core and data\core\editor directories. Neither was picked up by Unigine.

-a.

Link to comment

It might be the case that you modify some copy of data directory, while the engine is pointed to another one. Take a look at data_path value in the log file.

Link to comment

It might be the case that you modify some copy of data directory, while the engine is pointed to another one. Take a look at data_path value in the log file.

 

Hi binstream,

The data_path is setup correctly, and in fact, we are loading a custom System Sctipt file and custom Unigine.cfg file - those are working just fine.

It's just the custom editor script that fails to load.

 

AddCommandLineArgument( "-data_path");	

AddCommandLineArgument( "..\\media\\" );


AddCommandLineArgument( "-engine_config");
AddCommandLineArgument( "..\\media\\unigine.cfg" );

AddCommandLineArgument( "-system_script");	
AddCommandLineArgument( "..\\src\\UnigineScripts\\unigine.cc" );

AddCommandLineArgument( "-console_command" );
AddCommandLineArgument( "editor_script core\\editor\\editor.cpp && world_load worlds\\world1" );

 

I have a doubt that this might be related to an error I raised earlier in this forum, but nobody has responded yet to that.

16:14:37 Unigine~# editor_load
16:14:37 Loading "worlds\world1.cpp" 0ms
16:14:37 Image::load_dds(): can't skip mipmaps in "meshes/Gastank/Gastank_Diffuse.dds" file
16:14:37 Image::load_dds(): can't skip mipmaps in "meshes/Gastank/Gastank_Normal.dds" file
16:14:37 Image::load_dds(): can't skip mipmaps in "meshes/Gastank/Gastank_Specular.dds" file
16:14:37 Loading "materials/world1.mat" 3 materials 11ms
16:14:37 Mesh::info_mesh(): can't open "C:/dev/rpg/extern/Unigine/bin/test.mesh" file
16:14:37 Loading "worlds\world1.world" 188ms
16:14:37 Parser::setDefine(): "__EIDTOR_UTILS__" is already defined
16:14:37 Parser::preprocessor(): depth of stack is not zero
16:14:37 Parser::preprocessor(): can't load "core/editor/editor_utils.h" file
16:14:37 Parser::preprocessor(): can't include "core/editor/editor_utils.h" file
16:14:37 Parser::preprocessor(): can't load "core\editor.cpp" file
16:14:37 Loading "core\editor.cpp" 57ms
16:14:37 
16:14:37 ---- Editor ----

 

The " "__EIDTOR_UTILS__" is already defined" error is the one i mean.

 

-a.

Link to comment

I have checked setting editor_script console command. Everything works except of the case with invalid filename:

1. Put custom editor script inside data directory

2. Load engine application

3. print "editor_script <custom_editor_script>" console command

4. print "editor_load"

 

Also the workaround with putting custom editor script code inside <data_path>/core/editor/editor.cpp works fine for me too.

 

I have a doubt that this might be related to an error I raised earlier in this forum, but nobody has responded yet to that.

16:14:37 Unigine~# editor_load
16:14:37 Loading "worlds\world1.cpp" 0ms
16:14:37 Image::load_dds(): can't skip mipmaps in "meshes/Gastank/Gastank_Diffuse.dds" file
16:14:37 Image::load_dds(): can't skip mipmaps in "meshes/Gastank/Gastank_Normal.dds" file
16:14:37 Image::load_dds(): can't skip mipmaps in "meshes/Gastank/Gastank_Specular.dds" file
16:14:37 Loading "materials/world1.mat" 3 materials 11ms
16:14:37 Mesh::info_mesh(): can't open "C:/dev/rpg/extern/Unigine/bin/test.mesh" file
16:14:37 Loading "worlds\world1.world" 188ms
16:14:37 Parser::setDefine(): "__EIDTOR_UTILS__" is already defined
16:14:37 Parser::preprocessor(): depth of stack is not zero
16:14:37 Parser::preprocessor(): can't load "core/editor/editor_utils.h" file
16:14:37 Parser::preprocessor(): can't include "core/editor/editor_utils.h" file
16:14:37 Parser::preprocessor(): can't load "core\editor.cpp" file
16:14:37 Loading "core\editor.cpp" 57ms
16:14:37 
16:14:37 ---- Editor ----

 

The " "__EIDTOR_UTILS__" is already defined" error is the one i mean.

 

-a.

 

Probably there is some error in your custom editor script. Please attach a piece of your editor script code to reproduce this issue.

Link to comment
×
×
  • Create New...