Game Development Community

Another noob question... about the command line

by Kama · in Torque Game Engine · 01/22/2004 (11:51 am) · 25 replies

How do you launch TorqueDemo from the terminal so that you cn pass argument such as -show...? I tried doing it like they do on PC: TorqueDemo -show, doesn t work, so I tried the real app name: Torque\ Demo\ OSX.app/ -show, doesn t work either because of permission denied... when doing it in su i get an unknown command... thanks for helping the poor Torque noob I am :)
Page «Previous 1 2
#1
01/22/2004 (12:07 pm)
And another noob question... how do you use map2dif?? I ve seen how it s supposed to work but when typing map2dif test.map it says unknown command... I guess i have to compile Torque??? 'cause right now I got an error of undifined variable when compiling so I downloaded a precompiled version of Torque... I guess map2dif is not part of what I downloaded then? grrr... any hint?
#2
01/22/2004 (12:22 pm)
You should be able to put a text file named maccmdline.txt for your command line arguments. That info use to be in the ReadMe with the PB projects.
Map2dif is a separate project, and GG doesn't support it on Mac, so you don't have any projects for it.
#3
01/22/2004 (12:55 pm)
But they don t say anything as to how I m supposed to this .txt file... concerning map2dif what should I do...? using Quiver I created a .map file... how can I get it to be a .dif??? (well I should ask first "can I get it to be a .dif?")
#4
01/26/2004 (11:13 am)
Ok, lets take these 1 by 1.

1) launching mac apps from the command line, passing arguments. I'll assume you can use unix. First, cd to the directory your .app is in. The command is:
TorqueDemoApp.app/Contents/MacOS/TorqueDemoApp -show -game -whatever

2) You were getting permission denied because macosx .apps are special folders. The Terminal doesnt know how to execute a folder. The Finder is the only thing that knows how to execute that special folder. The program itself lives inside the folder, so we have the Terminal execute that.

3) There is no binary map2dif for mac distributed with torque. It has to be compiled. Unfortunately there is no target for map2dif in the project file distributed with TGE. You can either make one yourself, or use mine, here.

4) You get an unknown command when you try to execute map2dif because there is no program called 'map2dif' in the path. There is no program in the path because you havent set the path to the location of map2dif.

5) The text file you were told about has nothing to do with map2dif. It was for passing command line args. If you do not want to use the terminal to pass args, you can make a text file called 'MacCmdLine.txt', placing it beside the .app . Then type the args you want to use in that file, save, close, run the app.

6) The .map file you made with Quiver can be converted to a dif, yes. You must first build map2dif, set the path, then you can use map2dif to convert it.

7) please read all of the online documentation, here.
#5
01/26/2004 (5:02 pm)
Well Paul Scott THANKS A LOT... that s the kind of answer every forum-poster would like to have :) really :)
I couldn t figure out how the command line text file worked because I first had to use a precompiled version of Torque for which this text file meant nothing... when I finally manage to compile the last version of torque, the command text worked immediatly...
as for the TorqueDemoApp.app/Contents/MacOS/TorqueDemoApp -show -game -whatever
I didn t know, life is full of surprise ^_^, I learned something REALLY usefull...
and finally for the map2dif project you made... THANKS A LOT... I got many headachs trying to create the targets myself and couldn t do it (i m a beginner with Xcode ^_^)
one last question (i have a slight idea of the answer but just to be sure): how do you set the path for map2dif? (is something under the terminal like setenv $PATH/blahblah/?) or is it a path to be set in Xcode? (sorry for all the newb/dumb question but... ^_^ O_o)
#6
01/27/2004 (7:14 am)
The way you set your path depends on the shell you use in terminal.
best thing I can tell you to do, is get a good unix for macosx book. it will be your invaluable friend if you are new to osx and unix.

if tcsh:
set path = ( $path full/path/to/the/dir/that/contains/map2dif/folder )

if zsh ( the default in 10.3 ) -- I have no idea, try 'man zsh' for more info.
edit: here's how:
export PATH="$PATH:full/path/to/the/dir/that/contains/map2dif/folder"
#7
11/27/2004 (3:53 pm)
Hi

I can't get the showtool to work either. I've read all the documentation but I don't get it.

I made the MacCmdLine.txt

I've launched the program and nothing

maybe I typed the wrong thing into the text file? I you could help me out that would be great.
#8
11/27/2004 (4:59 pm)
I think I found something... At first, I used the Torque Demo one can get on the net... The MacCmdLine.txt doesn't work with it though... However, when I managed to compile Torque myself I got something a bit different from the online demo, and discovered that with this new app, the MacCmdLine.txt work, provided that you put it next to the app (same directory)...
If you're already doing that and it still doesn't work, then I don't know what to do :(
#9
11/28/2004 (12:36 pm)
Thanks for the info but my xcode still doesn't compile properly

I get the unidentified symbols:vorbis_info _blocksize error

so I can't open the main demo only the debug
#10
11/29/2004 (9:38 am)
You can also launch it from the terminal, instead of using MacCmdLine.txt.

cd to the directory where your Torque app lives.
type:
Name\ of\ Torque\ App.app/Contents/MacOS/Name\ of\ Torque\ App -show

replacing "Name\ of\ Torque\ App" with the name of your torque application. (The slashes escape out spaces in the name of the app, so the Terminal doesn't get confused.)

alternatively, I'm posting a resource with some scripts you can double click to run the show tool, and other things.
#11
11/29/2004 (12:16 pm)
You guys are all making this pretty hard.

From the OSX cmd-line,

open TorqueDemoApp.app -show blah

"open" is a magical OSX thing that's approximately equivalent to just double-clicking on whatever item you run it with.

Gary (-;
#12
11/29/2004 (5:29 pm)
Re the "I get the unidentified symbols:vorbis_info _blocksize error" prob:

try the steps listed here:

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5003

First: cd to the /lib/vorbis/macosx directory
Type: ranlib libogg.a libvorbis.a

that's it. this happened to me last night. i did the steps, and it compiled.

i am more of an artist then coder, so i am glad to see some patience with the likes of us in the forums.. :) i think the Mac forum is a good place to hang out on this count... ;)


- aqaraza
#13
11/30/2004 (10:35 am)
Hey heath,

Thanks anyways but I've tried that and it didn't work. A guy in another forum figured it out. It has something to do with a bunch of libb files in the usr/lib/vorbis/ folder that ffxmpeg installs on your system that clashes with the TGE or something.

I don't know I'm just an artist to, not a programmer. Any ways for the other stuff I tried the "open Torque\\Demo\\debug\\OSX.app -show " and it still didn't work from the terminal.

It did open the program but it didn't go into the showtool.

It doesn't matter I figured out another way.

FOR ANYONE WHO STILL CAN'T COMPILE OR FIGURE OUT THE TERMINAL COMMAND LINES:

All I did was change the name of the folder starter.fps to something else.

then change name of the show folder to starter.fps.

Because by default the program opens the starter.fps folder.

Now just throw in any player folder into that NEW starter.fps folder and voila!

tada no program lines just simple trickery
#14
12/01/2004 (10:51 am)
@Gary:
I tried using the 'open TorqueDemoApp.app -show' method, I can confirm that it did not work. The open command gave the error message: "No such file: /torqueFiles/-show". The torque demo opened, but with the default game, not the show tool. The man page for open says nothing about passing command line arguments. Can you confirm that this works, did I do something wrong?

@Sam:
Glad you found a work-around! Still, it's not really optimal. Perhaps my instructions about the command line were confusing... ?

In any case, I submitted the resource, I hope it'll be up soon.
I would host the file myself, but I might be about to lose my webspace, so.

In case the resource gets blackholed, here it is inna nutshell:

1) Make a plain text file named RunShowTool.command in the same directory as your torque executable.
2) Paste the following in the file:
#!/bin/tcsh

# if launched from the finder, we'll not be in the correct directory.
# get to the directory where this script file lives
cd 'dirname [[60c20eba13816]]'

#launch torque using the -show command line argument.
#change both instances of "Torque\ Demo\ OSX"
# to the name of the Torque app you want to run.
Torque\ Demo\ OSX.app/Contents/MacOS/Torque\ Demo\ OSX -show
3) Make it executable. You have to use the Terminal, or a 3rd party utility such as BatChmod, to set the executable permission on the file.
4) Don't forget to change both instances of "Torque\ Demo\ OSX" to the name of your app, in the above text.

To do all this from the Terminal, type:
cd /path/to/your/torque/folder
touch RunShowTool.command
chmod +x RunShowTool.command
open -e RunShowTool.command
then paste in the text of the file, provided above; be sure no lines wrapped; save the file.

you should now have a double-clickable script that will launch your torque app with the -show command line arg.

share and enjoy.
#15
12/11/2004 (1:30 pm)
I've found that works for the show utility, but shouldn't it work for the FPS and Racing starter kits as well? Using the same method I get the error:

.../runracing.command: Command not found.
logout
[Process completed]

Any suggestions? I'm a noobie by-the-way (Just got Torque a couple of days ago)
#16
12/11/2004 (2:57 pm)
Matt:
Are you using a RunRacing.command file that you made, or one from the resource I posted?
#17
12/14/2004 (6:44 am)
I created a RunRacing.command file based on the one you made for running Show because the RunRacing.command and RunFps.command that came with TGE won't run. I get the same error for both. I can run them from maccmdline.txt though. Not a big problem, but one I'd like to figure out.
#18
12/16/2004 (1:28 pm)
@Matt,

If you have both the old and new scripts, please post them both here, and I may just be able to tell you why one did not work.

I'd like to figure this out too.
#19
12/17/2004 (12:13 pm)
Actually I've been looking at all the scripts and they're each essentially the same. The only difference is:

Torque\ Demo\ OSX.app/Contents/MacOS/Torque\ Demo\ OSX -show

vs.

Torque\ Demo\ OSX.app/Contents/MacOS/Torque\ Demo\ OSX -game starter.racing


I'm beginnning to wonder if maybe I don't have something setup correctly or if I need to recompile TGE for some reason.
#20
12/21/2004 (9:38 am)
@Matt
You did not say, I guess I forgot to ask, what *exactly* was the error you got when you tried the racing one?
Page «Previous 1 2