❄️🎁⛄ The Winter Games Tournament is Live! 🎄🎅❄️
Jump to content

Recommended Posts

Posted

Hi all,

Apologies if this is a fairly straigtforward question, but can someone explain to me how the ParseCommandLine function works?  I can see the -devmode parameter and I also wanted to add other parameters, including the -map parameter, but when I try to provide a value for the -map parameter, I can't seem to yield it using the standard commandLine[] method.

Basically, I need to know the correct format of the command line that has the key "-map" and the name of the map to use.

Is it "-map:mapname" or "-map mapname" or "-map=mapname" etc.?

Thank you.

Paul.

[EDIT] I know this can be done simply by interpreting the string myself, but why rewrite code that has already been done for me?

Posted

Let's consider this command line:

+map "Maps/level1.map" -fullscreen

If you have a word that starts with +, it takes the next parameter as the value:
+map "Maps/level1.map"

Values can be strings, numbers, or booleans.

If you have a word that starts with it just sets the value to true:
-fullscreen

So in the returned table, the value "map" would be "Maps/level1.map" and the value "fullscreen" would be true.

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...