RM command-line args

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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
 
Last edited by a moderator:

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
Reading from this old topic, it seems that we can't.

Edit: Just tested it, the script won't pick up the arguments.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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?
 
Last edited by a moderator:

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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/
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,864
Messages
1,017,056
Members
137,573
Latest member
nikisknight
Top