Attract-Mode Support > Scripting

Passing command line arguments within a layout [SOLVED]

<< < (2/3) > >>

keilmillerjr:

--- Quote from: BOXXMAN on June 10, 2017, 08:58:27 AM ---That gets me a bit closer  to results. I'm not sure how you are making those lower style closing ", and maybe that's why i'ts not working. As it is, I used "" to enclose everything, and it does partially pass the name now, but still with problems. For example, I tried it with Sony Playstation 2 as the system, and it outputs -sSony as the system. So, it is sending the -s as a string as well as the command line switch, and the system name is getting cut off as well. Any ideas?

--- End quote ---

Typing in safari on my Mac automatically reverses ending quotes. That's why I said to do something like that. I just moved this week and haven't even fully unpacked. Make sure you include a space after and before your param flags. As far as the system name being short, try printing it to terminal and see if it yields the same or different result.

BOXXMAN:

--- Quote from: keilmillerjr on June 11, 2017, 06:01:52 AM ---
--- Quote from: BOXXMAN on June 10, 2017, 08:58:27 AM ---That gets me a bit closer  to results. I'm not sure how you are making those lower style closing ", and maybe that's why i'ts not working. As it is, I used "" to enclose everything, and it does partially pass the name now, but still with problems. For example, I tried it with Sony Playstation 2 as the system, and it outputs -sSony as the system. So, it is sending the -s as a string as well as the command line switch, and the system name is getting cut off as well. Any ideas?

--- End quote ---

Typing in safari on my Mac automatically reverses ending quotes. That's why I said to do something like that. I just moved this week and haven't even fully unpacked. Make sure you include a space after and before your param flags. As far as the system name being short, try printing it to terminal and see if it yields the same or different result.

--- End quote ---

So, adding the spaces before and after the param flags did the trick as far as it passing. However, the problem is that it seems to cut off the system if it is more than one word, eg. Sony Playstation only sends Sony. I confirmed this, because it will work with mame, or other one name systems. There still seems to be a problem with the rom parameter though, as it doesn't seem to be sending anything. Would I need to wrap the (Info.System) command in quotes to stop it from cutting it off? Wait, I did get system and rom to pass properly now with one word names. It worked with "Colecovision" and "Evolution", as system and rom. So, the only problem now is figuring out how to get it to send names with spaces without cutting them off.

BOXXMAN:
I'll ask again if there's anyone who can help me figure this out. All I need to know is how to pass the full string without it cutting it off at the space. Thanks in advance for any help.

BOXXMAN:

--- Quote from: keilmillerjr on June 10, 2017, 03:25:51 AM ---Hyper Shlt was a pain in the @ss to try and set up. Thats why I initially switched to attract mode. Anyways…


--- Code: ---fe.plugin_command( executable, arg_string )
--- End code ---

The plugin command takes an argument string. Have you tried returning a function inside the string?

Not tested, but try something along these lines and let me know how you make out.


--- Code: ---fe.plugin_command("/Rocketlauncher/Rocketlauncher.exe", "-s „ + fe.game_info(Info.System) + " -r „ + fe.game_info(Info.Name) + " -p AttractMode -m pause");
--- End code ---

--- End quote ---

Ok, for what it's worth and if anyone else has struggled with this and cares, here's how I finally got this working on Windows. You have to use "\"" to enclose arguments with spaces and send the quotes as well. For example,

--- Code: ---"\"" + fe.game_info(Info.System) + "\""
--- End code ---
This will send system name with spaces wrapped in quotes to your command line. However, if using a literal string, it has to be wrapped in quotes inside of that, such as

--- Code: ---"\"" + "Sega Genesis" + "\""
--- End code ---
This will output literal with space and wrap it in quotes.
Each argument can be sent as a single terminated argument like this, and switches that are a single letter or word can be enclosed in single quotes such as "-s" for example
Forward slashes must also be used for escaping the quotes, as back slashes are interpreted as path delineators and won't work properly.

keilmillerjr:
Ahhhh... I didn't know that you were trying to include quotes in the Params. Glad it's up and working! :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version