ENIGMA Forums
Outsourcing saves money => Programming Help => Topic started by: Darkstar2 on April 26, 2014, 02:28:07 pm
-
Example, I compile my game and call it game.exe.
I launch my game with game.exe /config
in this case my command line argument would be "/config".
IS it possible to pass along execution arguments to an ENIGMA program ?
I think this was possible with GM8.
If so, how do you do it ?
-
That's possible but you have to interpret the command line yourself, we are not and never will build anything that forces that on all games.
http://enigma-dev.org/docs/Wiki/Parameter_string
http://enigma-dev.org/docs/Wiki/Parameter_count
http://enigma-dev.org/docs/Wiki/Environment_get_variable
-
That's possible but you have to interpret the command line yourself, we are not and never will build anything that forces that on all games.
I don't understand what do you mean by that last part ? As far as the first part, by interpreting yourself do you mean the command line is passed as one string, and that I would have to manually isolate all commands and interpret them ?
example
GAME.EXE /cheat /secrets
would return a string "/cheat /secrets" and I would
have to isolate both /cheat and /secrets ?
If so that is not a problem.
As far as the second part, confused :D
BTW the show message does nothing for me in ENIGMA, displays nothing nowhere :D
-
Yes you'll have to parse the command line arguments yourself. And what do you mean show_mesage don't work? Look in ENIGMA settings and make sure Win32 widgets is set, it's working fine here.
-
GAME.EXE /cheat /secrets
That will return two parameters, so parameter_count() will return 2. Then parameter_string(0) will return "/cheat" and parameter_string(1) will return "/secrets".
-
That doesn't sound right. If it's compliant, parameter_count() should give 3, with parameter_string giving "GAME.EXE", "/cheat", and "/secrets" for 0, 1, and 2, respectively.
-
That doesn't sound right. If it's compliant, parameter_count() should give 3, with parameter_string giving "GAME.EXE", "/cheat", and "/secrets" for 0, 1, and 2, respectively.
Thanks ! Indeed Josh is correct.
Tested it, it does include the file you ran as string 0, followed by the rest. So this function is compliant and working as it should.