ken.mayfield Posted June 15, 2011 Posted June 15, 2011 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.
ulf.schroeter Posted June 16, 2011 Posted June 16, 2011 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.
ken.mayfield Posted June 16, 2011 Author Posted June 16, 2011 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!
manguste Posted June 16, 2011 Posted June 16, 2011 You can always use basename() function for that. It returns only the name.
Recommended Posts