Is there anyway to read the commandline string used to execute a game from within ags?
Quote from: Monsieur OUXX on Tue 13/07/2010 13:19:50
No it's not. (...)
It would be nice if AGS could fetch the commandline within the game. That way you can specify switches or arguments to the game which can be useful in some occasions.
Game1.exe -slow
I've made a plugin that returns the commandline (
GetCommandLine()) for now. It can be downloaded here:
http://wyz.agser.me/dl/plugins/agsGCL.zip
But native support would really be swell. :D
No it's not. At the moment, the workaround used by some modules is to have an external tool (either a batch or a vbscript or...) that's run instead of the actaul game. that tool puts the argument in a file that's read by the game afterwards.
EDIT: Damn, what's wrong with me. I keep reading too fast these days. I would have sworn that you actually asked the question rather than offered a suggestion.
EDIT2: Oh, what a relief. It's actually you who edited your post. Well, that still demonstrates that I'm reading too fast!
Would anyone else find this useful?
I didn't explicitely say it in my post, but I'd find that very useful. And Monkey would also probably find it useful if he were still alive.
Just coz I didn't have interwebz didn't mean I died. :P
And what? This seems silly and useless to me..nobody uses command line arguments. ::)
There's other suggestions I'd rather see implemented first..but sure this could potentially lend itself to interesting possibilities.
Yes, I would find it very handy for many things.
This would be useful. And monkey, the average might not type in "GameName.exe -param1", etc., but your game's installation program might create two different shortcuts, one pointing to "GameName.exe -something" and the other to "GameName.exe -somethingelse", for instance. There are tons of uses for this feature.
Don't have any immediate use for it, but it sounds like a sensible suggestion if it doesn't require too much work to implement. I guess at the moment Terran's multiple shortcuts example could be worked around using different startup .exe's, each of them calling RunAGSGame and passing a different paramenter to the main game exe.