RM command-line args

Is it possible to read command-line args from within RM?

For example, I launch the tool as

Code:
game.exe myArg1
And I want to read this via ARGV or something
Reading from this old topic, it seems that we can't.

Edit: Just tested it, the script won't pick up the arguments.
Hmm, that temp file seems like a good idea.


Just create a file with a custom launcher, have RM read it on start-up, and then delete the file when you're done with it.


We can make use of ENV["TEMP"].


This requires write-access.


What if we write the args in memory somewhere and then have RM pick it up from there.


Or, instead of command-line args, can we send data to RM via process-to-process techniques at run-time?
You can through the Windows API. its GetCommandLine in the kernel, it'll return a string that has the full file path of the game exe in quotes, then any additional arguments after that, such as the test or debug arguments used by RM.
Good find.

Basic solution, assuming no options:

# build our ARGVARGV = Win32API.new("Kernel32", "GetCommandLine", "", "P").call.split(" ")ARGV.shiftp ARGVThis isn't meant to be a opt parser of any sort. I just want to check if a certain argument exists. Someone can provide (or find) a proper opt parser if neededI put it in ARGV cause RM doesn't do it for us.

I've provided a utility script.

http://www.himeworks.com/2014/03/24/command-line-args-loader/

I just grabbed shell words to parse the arguments

http://www.ruby-doc.org/stdlib-1.9.3/libdoc/shellwords/rdoc/Shellwords.html

Might extend the script to support flags as well to change the behavior of RM (via scripts)

For example, using this

http://trollop.rubyforge.org/

Original thread: https://forums.rpgmakerweb.com/threads/rm-command-line-args.25336/