Jump to content

C++ - Can't find map file.


Dogarooski
 Share

Recommended Posts

Hello. I'm having a strange issue when trying to load a map through C++. It appears that when I run the game through Visual Studio, it can't locate my map file. The game just starts up and closes. However, when running the game through the editor or by double clicking the EXE in the project directory it works perfectly fine.

 

The code I'm using to load the map is very simple. I have this in the App::Start method:

/* Load Map */
std::string map = "Maps/main.map";
if (!Map::Load(map)) return false;

 

One thing to note is that when I change map to "../../Maps/main.map" it works when running through Visual Studio but not if I run it via the editor or EXE.

 

I think it's most likely a problem with the working directory of the application, but I don't know how I could address it. I guess for now I'll just have to build the project and run it through the editor. I'm on version 4.2 if that helps.

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...