Jump to content

engine.world.getName() return error


photo

Recommended Posts

When I load a level using the following two commands, engine.world.getName() will return two different strings as a result.

 

From script:

 

engine.console.run("world_load Level_01");

engine.world.getName() returns the string "Level_01"

 

From .bat file:

 

-console_command "editor_quit && world_load _Game/worlds/Level_01"

engine.world.getName() returns the string "_Game/worlds/Level_01"

 

This seems inconsistent and has caused problems with a couple of our scripts.

Link to comment

I wouldn't call it a bug. See details on UNIGINE file path handling here.

 

Usage of consistent world filepath specification between internal/external scripts would solve your insonsistency problem.

Link to comment

I personally feel that there should be two different engine.world functions to support this...

 

the first being engine.world.getPath() that would return "_Game/worlds/" (or similar) and engine.world.getName() that would return only "Level_01". I don't feel the path should be included in a getName() function for a world. I feel its a bug because if the same world was called in two different ways, the world "name" is different.

 

I have fixed the problem in our project, this is more of an opinion/suggestion now.

 

Thanks!

Link to comment
×
×
  • Create New...