Dogarooski Posted January 17, 2017 Share Posted January 17, 2017 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. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted January 17, 2017 Share Posted January 17, 2017 You're right; you need to change your working directory. You can right-click on your project name on the left, Properties and I think it's under Debugging - could be off a bit; just going from memory. But there's a post on the forums if you can find it. 1 Quote Link to comment Share on other sites More sharing options...
Dogarooski Posted January 17, 2017 Author Share Posted January 17, 2017 It worked perfectly. Thank you so much! 1 Quote Link to comment Share on other sites More sharing options...
cassius Posted January 17, 2017 Share Posted January 17, 2017 This problem came with le 4.2 and vs 2015. It was automatic before. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
reepblue Posted January 19, 2017 Share Posted January 19, 2017 Here. Josh saw it, so I think it's fixed/will be fixed in 4.3. http://www.leadwerks.com/werkspace/topic/15487-issues-in-visual-studio-projects-and-the-fixes/ Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Recommended Posts
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.