Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: RaEnDy on Mon 17/01/2005 03:14:37

Title: I cannot run AGS games from the cmd or batch file in Windows XP [SOLVED]
Post by: RaEnDy on Mon 17/01/2005 03:14:37
I have encountered a strange problem regarding AGS.
I use often batch files, but they seem not to work with the windows versions of AGS games on my Windows XP.
There is no error message or else when the batch file wants to start the AGS game.  It simply doesn't start at all. The same problem occurs when I try to run the game from cmd.
But it seems not to be an XP problem at all, since all other programs execute fine through batch file commands.
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: Gilbert on Mon 17/01/2005 03:37:27
Did they run when you launch the game directly from explorer?
Note that some XP systems has a glitch, that affects batch files, making them unable to run the applications in the desired directory.
For the command line part, did you change to the correct directory before running the programmes?


Last of all, did you unzip the games correctly to separate folders? Zipped AGS games won't run in general.
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: Scorpiorus on Mon 17/01/2005 07:29:46
And what does your BAT-file look like?
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: RaEnDy on Mon 17/01/2005 13:10:14
@Gilbot V7000a

Did they run when you launch the game directly from explorer?
> Yes, they did run perfectly.

Note that some XP systems has a glitch, that affects batch files, making them unable to run the applications in the desired directory.
> I have read about that in various forums, but in my case the problem occurs ONLY with AGS games and only with windows executables. The DOS based AGS games work fine with batch files.

For the command line part, did you change to the correct directory before running the programmes?
> Yes, I did.


@Scorpiorus

And what does your BAT-file look like?
> I tried a lot of different settings, but even the most minimalistic didn't work.
For example, if the game file is called 'agsgame.exe' I have a batch file with only agsgame.exe inside and it is in the same directory.


THX for your help
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: Scorpiorus on Mon 17/01/2005 15:14:55
QuoteFor example, if the game file is called 'agsgame.exe' I have a batch file with only agsgame.exe inside and it is in the same directory.
Try running it using a windows' "start" command and see if it helps:

start agsgame.exe

EDIT:

Also, if that doesn't help, try using a simple path (like C:\MYGAME) for agsgame.exe

By the way, the "start" command has a set of parameters you can optionally pass into it. Try "start /?" for the whole list.
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: RaEnDy on Mon 17/01/2005 18:47:24
@ Scorpiorus

I tried the start command already and it didn't work.
I tried a simole path like D:\ and it didn't work either.

Maybe there is no solution at all? It's only strange that I seem to be the only one with this problem!

THX
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: Gilbert on Tue 18/01/2005 02:09:16
I have a question, why did you want to run a windows game with a batch file? Can't you just launch it with a shortcut?
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: RaEnDy on Tue 18/01/2005 13:05:14
@Gilbot V7000a

The problem with shortcuts is that they only work with absolute paths,
e.g. c:\games\agsgame\game\agsgame.exe. The problem is that everybody using this shortcut has to copy his game files in the above mentioned directory. When using batch files I can run an application whithout caring about it's absolute location, I only neet to know where it's relative position is. So if for example the batch file is in c:\games\agsgame\ I can use the change directory command (cd game) to change to the rigt directory and then start the game (agsgame).
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: Pumaman on Tue 18/01/2005 23:36:41
I just tried a simple batch file with just "game.exe" in it and it launched fine (Windows 2000). Note that you do have to include the ".exe"; on 2000/XP systems AGS games won't run from the command line if you just type "game".
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: RaEnDy on Wed 19/01/2005 10:31:22
@Pumaman
I use Windows XP with SP2 installed and neither the batch file, nor command line as you mentioned do work on my computer.
Thanks for your help.
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: Scorpiorus on Fri 21/01/2005 18:36:40
Yep, that's strange.

I too gave it a test (Win2000) and it worked fine for me.

Don't know what else to suggest but at least as a last resort try running it as follows:

start agsgame.exe agsgame.exe
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: RaEnDy on Sat 22/01/2005 15:05:37
@Scorpiorus

Thank you very much !!!
It worked perfectly....  :D

I think to understand why it works:
with the first agsgame.exe you only start the ags application itself, and with the second agsgame.exe you tell ags what game file it should run... it seems that this is due to the structure of the self running ags games which includes the ags runtime as well as the game file itself....

Tell me if I got this wrong...


I'm very glad that the problem is solved AND I understood why it didn't work...
Because, despite of a lot of statements I found on other forums saying that batch files don't work properly on Win XP, I experienced them to work allways well. And I knew it was a AGS relates issue because all other applications worked very well with batch files.

Thank you....  ;D :D ;D

PS: I found out it works not with all AGS files... most of the RON games don't work with it, but I don't care any more...
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: Scorpiorus on Sat 22/01/2005 16:03:44
I'm glad you sorted it out :)

QuoteI think to understand why it works:
with the first agsgame.exe you only start the ags application itself, and with the second agsgame.exe you tell ags what game file it should run... it seems that this is due to the structure of the self running ags games which includes the ags runtime as well as the game file itself....
Yeah, from what I know, that's how it seems to work: theoretically, if the game file parameter is not specified the executable file should search for the data resources within itself. Or at least that's how I get it. :)

By the way, you can have the resource data file separated from the engine:

After compiling you get a "ac2game.ags" file in your game folder - it's your game but without the engine.

Then you can use the dos (acdos.exe) or the windows engine (acwin.exe) to run "ac2game.ags".

startdos.bat:
acdos.exe ac2game.ags

startwin.bat:
start acwin.exe ac2game.ags

and your final release could then include the follwing files:
startdos.bat
startwin.bat
acdos.exe
acwin.exe
ac2game.ags

Two engines and a single resource file. :)
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: RaEnDy on Sat 22/01/2005 18:32:55
@Scorpiorus  :=

Thanks for the information!
I hope your post is as helpful for all the other people experiencing this problem as it was for me.

Thanks for your big help !!!  8)




Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: Scorpiorus on Tue 25/01/2005 17:19:41
You're welcome

I just mentioned it because it makes clear why something like "start agsgame.exe agsgame.exe" works. :)
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP
Post by: TerranRich on Thu 27/01/2005 02:55:39
Now BFAQ'ed (finally): http://bfaq.terran-x.com/#editor13

Strange, I thought I already did this, and I kept getting delayed in posting this.
Title: Re: I cannot run AGS games from the cmd or batch file in Windows XP [SOLVED]
Post by: RaEnDy on Thu 27/01/2005 03:18:42
@TerranRich

thanks