commandline on mac os x

edited 2010 Feb 1 in Technical Support
Hello, I am trying to start doom.wad using the following command in an applescript:

do shell script "/Applications/Games/Doomsday/Doomsday\\ Engine.app/Contents/MacOS/Doomsday\\ Engine -game jdoom -iwad /Applications/Games/Doomsday/wads/doom.wad"

All it does is open SnowBerry. What am I doing wrong?

1.9.0-beta5.1-universal-macosx on 10.5.8

BTW, the game runs beautifully! And SnowBerry is really nice, just want to run the game directly. Thanks in advance!

Comments

  • point to the deng binary inside the .app?
  • Hi KuriKai,

    Do you refer to Doomsday.app? I have tried this:

    do shell script "/Applications/Games/Doomsday/Doomsday\\ Engine.app/Contents/Doomsday.app/Contents/MacOS/Doomsday -game jdoom -iwad /Applications/Games/Doomsday/wads/doom.wad"

    And I get this error:

    DD_InitDGL: Loading of drOpenGL.bundle failed.
    (null).

    Any ideas? Thanks.
  • Some pointers:
    • Doomsday expects a specific working directory upon launching. If it says the loading of a bundle has failed it means that the working directory was not correct and the plugin bundles could not be found.
    • To see the command line used by Snowberry, select the profile to launch and press Option-P. (Or select "Preview command line" from the menu.)
    • The -basedir option is important as well as it controls the location where Doomsday loads its resources (doomsday.pk3 in particular).

    Here's an example command line that should work (when executed in /Applications/Doomsday Engine.app/Contents):
    Doomsday.app/Contents/MacOS/Doomsday -game jDoom.bundle -iwad ~/IWADs/Doom.wad -file Doomsday.app/Contents/Resources/doomsday.pk3 jDoom.bundle/Contents/Resources/jDoom.pk3 -bd Doomsday.app/Contents/Resources/
    

    (Naturally substitute the IWAD path with one that suits your setup.)
  • Thanks for the help skyjake. I can now run a specific wad from the command line. However, there are a few concerns - it creates a "savegame" directory in the working directory (Contents) instead of saving games in my runtime/savegame directory. And I had to reconfigure the graphics, mouse, etc. from scratch, so I am afraid it is saving those settings in an inappropriate place as well. I have tried adding the -savegame switch with variable path sdir:

    set sdir to "$HOME/Library/Application Support/Doomsday Engine/runtime/savegame/doom1-ultimate"
    ... -basedir Doomsday.app/Contents/Resources/ -savedir \"" & sdir & "\" -sfxchan 16 ...

    That just creates an Application directory at the same level as my ~/Library/Application Support directory, which tells me it's the spaces. But when I try

    set sdir to "$HOME/Library/Application\\ Support/Doomsday\\ Engine/runtime/savegame/doom1-ultimate"

    it does the same thing. Adding quoted forms, posix paths, etc. only make it save the game in Contents again, or not at all. Please advise.

    I hate to keep asking questions on this board, but there is a complete dearth of Mac commandline instructions for the Doomsday engine. Thanks for your time.
  • Well, Doomsday was never intended to be started directly from the command line -- it has always been accompanied by a GUI launcher. Thus the command line options and the way it handles working directories are a bit complex.

    You should use the -userdir option to define where the engine will save your config files, savegames, etc. For example:
    -userdir \"/Users/jaakko/Library/Application Support/Doomsday Engine/runtime\"
    

    Here's a shell script that can be run from anywhere. This is equivalent to what Snowberry does when it launches the game (modify to suit your system):
    #!/bin/sh
    
    pushd .
    cd "/Applications/Doomsday Engine.app/Contents/MacOS"
    "../Doomsday.app/Contents/MacOS/Doomsday" \
        -appdir ".." \
        -file }doomsday.pk3 \
        -basedir \"/Applications/Doomsday Engine.app/Contents/Doomsday.app/Contents/Resources\" \
        -userdir \"/Users/jaakko/Library/Application Support/Doomsday Engine/runtime\" \
        -file }../../../jDoom.bundle/Contents/Resources/jdoom.pk3 \
        -notexcomp \
        -wh 1024 768 \
        -wnd \
        -game jDoom.bundle \
        -iwad \"/Users/jaakko/IWADs/Doom.wad\"
    
    popd
    
  • Hey, sorry - got quite busy with other things for a bit - tried your script and it works great, so thanks skyjake! I must say, OS X aliases suck when compared to linux or Windows app shortcuts - not being able to simply add commandline switches was a major shocker for me.

    Any plans to build more commandline support into future versions? A simple switch method like "doomsday -plutonia" (like scummvm uses, for example) that could go into an applescript (instead of a shell script) would be awesome. Is there a way to sponsor a feature like this? I would be happy to donate, especially after your excellent help for this free app.

    Thanks again!
Sign In or Register to comment.