.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

The Star & the Crescent- Save $9.00
winSPWW2- Save $6.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

Reply
 
Thread Tools Display Modes
  #1  
Old January 14th, 2007, 02:09 PM
Psientist's Avatar

Psientist Psientist is offline
Sergeant
 
Join Date: Apr 2004
Location: Tampa Bay, Florida, USA
Posts: 327
Thanks: 5
Thanked 33 Times in 11 Posts
Psientist is on a distinguished road
Default Command Line Switches - revisited

It's been posted that to get a list of command line switches, one needs only to run (from the command line):
Quote:
> dom3 -h
However, I'm having trouble generating command line options in the Mac OSX.

To run an application from the command line in OSX (Terminal), one types (for example):
Quote:
> open /Applications/Games/Dominions3/Dominions3.app
However, the following throws an error:
Quote:
> open /Applications/Games/Dominions3/Dominions3.app -h
Any suggestions on how to do this on the Mac? And if it works, how to set it as a permenant command-line setting whenever the game is run?
Reply With Quote
  #2  
Old January 14th, 2007, 03:35 PM
Olive's Avatar

Olive Olive is offline
Sergeant
 
Join Date: Nov 2004
Location: Montpellier, France
Posts: 208
Thanks: 3
Thanked 2 Times in 2 Posts
Olive is on a distinguished road
Default Re: Command Line Switches - revisited

Doesn't seem to work on windows too.
Reply With Quote
  #3  
Old January 14th, 2007, 04:33 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: Command Line Switches - revisited

Short answer: You should find a stdout.txt in your dominions3 directory that has the -h output

Long answer: It does work but windows doesnt handle putting it to the screen the same way Linux does. Or actually I should say that WinNT or WinXP dont (Im guessing thats what you have since nothing showed up). The networking aspect of those two versions of windows, and no dos beneath them, sends the results to stndout.txt and stnderr.txt
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #4  
Old January 14th, 2007, 04:54 PM
Psientist's Avatar

Psientist Psientist is offline
Sergeant
 
Join Date: Apr 2004
Location: Tampa Bay, Florida, USA
Posts: 327
Thanks: 5
Thanked 33 Times in 11 Posts
Psientist is on a distinguished road
Default Re: Command Line Switches - revisited

I understand that theory, but it doesn't appear to work. Here is the full contents of the Dominions3 directory, including hidden files:

Quote:

/Applications/Games/Dominions 3$ ls -al
total 24
drwxr-xr-x 7 psientist admin 238 Jan 9 16:37 .
drwxr-xr-x 7 psientist admin 238 Jan 1 19:18 ..
-rw-r--r-- 1 psientist admin 6148 Jan 9 16:37 .DS_Store
drwxr-xr-x 3 psientist admin 102 Aug 29 14:46 Dominions3.app
dr-xr-xr-x 5 psientist admin 170 Aug 29 14:46 doc
The problem is that OSX is also throwing an error; the application never runs the command switch at all:

Quote:

/Applications/Games/Dominions 3$ open Dominions3.app -h
2007-01-14 14:51:33.735 open[4128] No such file: /Applications/Games/Dominions 3/-h

Now, we can try to be more savvy, and open up the OSX Dominion3.app executable (which is actually a directory bundle), and navigate to the application's core MacOS resource:

Quote:
cd Dominions3.app/Contents/MacOS
but the core executable there throws the exact same error:

Quote:
/Applications/Games/Dominions 3/Dominions3.app/Contents/MacOS$ open Dominions3 -h
2007-01-14 14:54:21.612 open[4132] No such file: /Applications/Games/Dominions 3/Dominions3.app/Contents/MacOS/-h

So apparently neither the Windows nor the MacOS command lines are behaving the way you expect. In fact, it *looks* like the Doms3 app is interpreting the "-h" flag as a filename argument, based upon the error response.
Reply With Quote
  #5  
Old January 14th, 2007, 06:36 PM
Olive's Avatar

Olive Olive is offline
Sergeant
 
Join Date: Nov 2004
Location: Montpellier, France
Posts: 208
Thanks: 3
Thanked 2 Times in 2 Posts
Olive is on a distinguished road
Default Re: Command Line Switches - revisited

@Gandalf Parker : Thanks, it works.
Reply With Quote
  #6  
Old January 15th, 2007, 12:46 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: Command Line Switches - revisited

I can't say about Mac OSX, but on Windows standard descriptors work the same way as on Linux/UNIX if the application is built as "console" application. If application is built as "Windows" application, standard output isn't going anywhere. The programmer need to reopen descriptors into some file. That's what Dom3 must be doing.
Reply With Quote
  #7  
Old January 15th, 2007, 03:57 AM
Arralen's Avatar

Arralen Arralen is offline
Major General
 
Join Date: Nov 2000
Location: 500km from Ulm
Posts: 2,279
Thanks: 9
Thanked 18 Times in 12 Posts
Arralen is on a distinguished road
Default Re: Command Line Switches - revisited

Windows
On my W2kSP4 box, running dom3.exe -h at the command prompt does provide me with a stdout.txt containing the info about the command line options ... :

Attached Images
File Type: png 487570-cmdline.png (10.8 KB, 138 views)
__________________
As for AI the most effective work around to this problem so far is to simply use an American instead, they tend to put up a bit more of a fight than your average Artificial Idiot.
... James McGuigan on rec.games.computer.stars somewhen back in 1998 ...
Reply With Quote
  #8  
Old January 15th, 2007, 04:34 AM
Ygorl's Avatar

Ygorl Ygorl is offline
Captain
 
Join Date: Jun 2004
Location: Rhode Island
Posts: 822
Thanks: 0
Thanked 0 Times in 0 Posts
Ygorl is on a distinguished road
Default Re: Command Line Switches - revisited

Psientist, you don't want to use the "open" command. Just type /Applications/Games/Dominions 3/Dominions3.app/Contents/MacOS/Dominions3 -h
and you'll get your list.
Note that if you want to run the game this way, say if you like using a nonstandard resolution, you have to run it from a slightly different location (search the forum for other posts by me and others to see how) - but if you just want to run the command-line version (to get help, verify turns, host a turn, etc.) this works fine.
I don't know if open has support for command-line switches to the program you're opening (open is really designed for opening files, not running applications) but even if it doesn you'd probably have to put it in quotes. Anyway, you don't want or need it in this case. Hope this gets you what you need.
Reply With Quote
  #9  
Old January 15th, 2007, 11:49 AM
Psientist's Avatar

Psientist Psientist is offline
Sergeant
 
Join Date: Apr 2004
Location: Tampa Bay, Florida, USA
Posts: 327
Thanks: 5
Thanked 33 Times in 11 Posts
Psientist is on a distinguished road
Default Re: Command Line Switches - revisited

Ygori:

Thanks for the assist. I figured it out, finally. Although I had tried a few times to run the Dominions3 app inside the bundle by *navigating* to that directory (e.g., "cd /Applications/Dominions 3/Dominions3.app/Contents/MacOS/") before running it, it never worked.

But just establishing the current working directory outside of the application bundle, and then running the core app with the entire path specified, did the trick.


So, to repeat for every OSX user's benefit:
1. open terminal.
2. run the following command, adjusting the path to specify the location of your Dominions 3 game folder:
Quote:
/Applications/Games/'Dominions 3'/Dominions3.app/Contents/MacOS/Dominions3 -h
Thanks, Ygori. I'll probably make a script file to execute that without having to go to terminal first, or for setting command-line switches I wish to load every time.
Reply With Quote
  #10  
Old January 15th, 2007, 04:51 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: Command Line Switches - revisited

I was thinking that from what I read when I tried to google an answer, but I couldnt test it so I kept my mouth shut (for once). The "open" said it opened a gui console. That would seem to be oppossing the result desired for -h and -T. I found examples using open and some that didnt use open but nothing clearly saying why use one and not the other.

Does using the "open" make ALL switches ignored? Do switches such as nofade or nomusic work?
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:46 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.