reepblue Posted March 10, 2019 Share Posted March 10, 2019 I've noticed that when using the shell scripts, the argument list doesn't work correctly. The last flag set (ex: -smallwindow) doesn't save correctly. My test snip: //Load command-line parameters System::ParseCommandLine(argc, argv); for (auto& p : System::Arguments) { System::Print("Key: " + p.first + " = " + p.second); } Results: steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh -devmode = 1 devmode steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh +devmode 1 Key: devmode = 1 steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh -devmode +sw 1800 Key: devmode = 1 Key: sw = 1800 steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh -devmode -smallwindow Key: devmode = 1 = 1 smallwindow 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...
Josh Posted March 10, 2019 Share Posted March 10, 2019 I just tested by setting the command line arguments in Visual Studio to "-devmode -smallscreen" and it worked exactly as expected, with the values "devmode" and "smallscreen" both being set to "1". My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted March 10, 2019 Author Share Posted March 10, 2019 I'm pretty sure with Windows this works fine, it's with Linux I've found the issue. Not sure what's going on here, might be the use of the shell script. What's also weird is that with my example, "Key" vanishes, so not exactly sure what's going on here. 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...
Josh Posted March 10, 2019 Share Posted March 10, 2019 I can't remember how to show the debugger in Code::Blocks and it doesn't let you view printed output, so I have no way to view what the parsing results are right now. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 10, 2019 Share Posted March 10, 2019 Okay, I found it. You need the "call stack" and "watches" windows open. I tried testing with the command line "-devmode -smallscreen" and it worked perfectly. Now I am testing your print code... My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 10, 2019 Share Posted March 10, 2019 std::string cl; for (auto& p : System::Arguments) { cl += std::string("Key: " + p.first + " = " + p.second + "\n"); } Seems to work fine. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted March 10, 2019 Author Share Posted March 10, 2019 Tried this, still the same results. The application still launches in fullscreen unless a bogus flag is added at the end before "-devmode" so that's evidence that the flag is not registering correctly. Quote steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh -devmode = 1 devmode Next time you're compiling on Linux, please take a look if you're not doing so already. I don't have this issue on Windows ether. 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...
Josh Posted March 10, 2019 Share Posted March 10, 2019 I think the problem lies in the SH file. Have you tried running the executable directly? ./CodeLiteTest -devmode My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted March 10, 2019 Author Share Posted March 10, 2019 I'm unable to as the application refuses to launch without that Library path bit. Quote steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest -devmode ./CodeLiteTest: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory Tried hard setting flags within the script. export LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" ./CodeLiteTest -devmode -flag -flag2 Same results: steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh Key: devmode = 1 Key: flag = 1 = 1 flag2 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...
Admin Posted March 10, 2019 Share Posted March 10, 2019 Can you find out the size of the System::Arguments map? It does not make sense that "Key: " is getting skipped in the last line. Link to comment Share on other sites More sharing options...
Admin Posted March 11, 2019 Share Posted March 11, 2019 Can you print out the contents of argv to verify it is correct? for (int n=0; n<argc; ++n) { Print(argv[n]); } Link to comment Share on other sites More sharing options...
reepblue Posted March 17, 2019 Author Share Posted March 17, 2019 Used the code above: With the dummy flag steven@blackbox:~/Documents/Leadwerks/Projects/ActorTest$ ./ActorTest.sh -devmode -l Reep Softworks - (ActorTest) Initializing Lua... Warning: Lua sandboxing disabled. Executing file "/home/steven/Documents/Leadwerks/Projects/ActorTest/Scripts/Error.lua" ./ActorTest -devmode -l Installing Game: SDK Initializing OpenGL graphics driver... Without: steven@blackbox:~/Documents/Leadwerks/Projects/ActorTest$ ./ActorTest.sh -devmode Reep Softworks - (ActorTest) Initializing Lua... Warning: Lua sandboxing disabled. Executing file "/home/steven/Documents/Leadwerks/Projects/ActorTest/Scripts/Error.lua" Installing Game: SDK Initializing OpenGL graphics driver... 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...
Josh Posted March 17, 2019 Share Posted March 17, 2019 This indicates that the arguments are not being passed from the launch script to the executable. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 25, 2019 Share Posted March 25, 2019 Any luck? My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted March 25, 2019 Author Share Posted March 25, 2019 Haven't tried since the 17th, but I'll look at it again with the latest RC. I can't test executing without a launch script as that's needed to function. 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...
Josh Posted March 25, 2019 Share Posted March 25, 2019 I thought we determined the launch script was where the error was? The argc, argv values are C++ stuff, and they were missing parameters. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts