Pages: 1
  Print  
Author Topic: Does ENIGMA support command-line args ?  (Read 1331 times)
Offline (Unknown gender) Darkstar2
Posted on: April 26, 2014, 02:28:07 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
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 ?
Logged
Offline (Male) Goombert
Reply #1 Posted on: April 26, 2014, 04:52:57 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
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
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Darkstar2
Reply #2 Posted on: April 26, 2014, 09:40:52 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
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
Logged
Offline (Male) Goombert
Reply #3 Posted on: April 26, 2014, 11:15:42 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
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.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #4 Posted on: April 27, 2014, 05:45:55 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Quote
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".
Logged
Offline (Male) Josh @ Dreamland
Reply #5 Posted on: April 27, 2014, 10:22:10 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2960

View Profile Email
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.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) Darkstar2
Reply #6 Posted on: April 27, 2014, 11:42:51 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
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.
Logged
Pages: 1
  Print