Jump to content

LoadScene Help..


Chiblue
 Share

Recommended Posts

I am trying to ensure that my project only contains the files I need for the scene, I have added the script folder, model/entity folder and materials..

 

My scene is very simple, it's a terrain with a couple player start entity...

 

Thanks all I have but when I run my game, the loadscene returns a bad pointer to the entity..

 

m_eScene=LoadScene((str)m_cLevelPath.getFullPath().c_str());

 

(cLevelPath is the leve path name, i built a class to provide information on file names)...

 

m_cLevelPath.getFullPath() contains "abstract::t5est01.sbx"

 

which is what I expect...

 

I even removed abstractpath and qualified the path entirely.. but I still have a problem.. how do I trouble shoot this? some trapable error would help?

 

If I remove the script folder it fails.. so it seems to be trying the load... by the way I am using 2.40

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

For some reason. I find that using .c_str() doesn't seem to work even though it should.

 

std::string LevelName = "BlahBlahBlah.sbx";
char *OldStyleString = (char*) malloc(LevelName.size() + 1);
for(int x = 0; x < LevelName.size; x++)
  OldStyleString[x] = LevelName[x];
OldStyleString[LevelName.size()] = '\0';
TEntity MyScene = LoadScene(OldStyleString);
free(OldStyleString);

 

But since you say it seems to be trying to load, perhaps copy and paste this troublesome bit into a console project and run that. As you might know, for console projects, the log is printed to the console window in real time. So if you run that without debugging, the console window will stay open and you can read which object gave when trying to load

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...