.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   SEV command line execution (http://forum.shrapnelgames.com/showthread.php?t=33017)

Fyron January 28th, 2007 11:11 PM

Re: SEV command line execution
 
No tricks are necessary; the script just has to wait for the SE4 process to exit. Most exec functions in programming languages have a way to do that directly. Dunno about batch, but its a 3 line python script (plus the import os line). I forget exactly what the command line parameters are, so you'll have to put the exact commands in. Assuming you have python installed, set the range to the number of turns you want to wait, save as something.py in the se4 folder, and run it (DOS prompt is easiest way).

<font class="small">Code:</font><hr /><pre>import os
for i in range(20):
print "Executing turn " + str(i+1) + "..."
os.spawnl(os.P_WAIT, 'se4.exe', 'savegame', 'player', 'password')
</pre><hr />

Suicide Junkie January 28th, 2007 11:18 PM

Re: SEV command line execution
 
Sigh, Fy.

Just running with command line parameters is trivial.
Running multiple turns one after the other is the hard part.

Using Python vs a Batch file, for example.
And of course, difficulty is relative.

se5a January 29th, 2007 02:01 AM

Re: SEV command line execution
 
that code should run multiple turns.

screw batch files, python FTW

Fyron January 29th, 2007 02:58 AM

Re: SEV command line execution
 
I don't know why anyone would want to do something like this with DOS batch... Doing pretty much anything in DOS batch is just asking for trouble. Python is several orders of magnitude easier to learn than batch.

Phoenix-D January 29th, 2007 04:35 AM

Re: SEV command line execution
 
Well, you could use the batch to call the script, skipping the DOS prompt. http://forum.shrapnelgames.com/image...ies/tongue.gif

Atrocities January 29th, 2007 04:45 AM

Re: SEV command line execution
 
I don't know enough about any of this to really use it. I just wanted to know so that I could run 100 turn AI test for both SE V and SE IV.

Fyron January 29th, 2007 05:29 AM

Re: SEV command line execution
 
Phoenix-D said:
Well, you could use the batch to call the script, skipping the DOS prompt. http://forum.shrapnelgames.com/image...ies/tongue.gif


Or you could double click on the script. http://forum.shrapnelgames.com/images/smilies/laugh.gif

Atrocities January 29th, 2007 05:51 AM

Re: SEV command line execution
 
I just read that SE V has a feature added recently that allows you to execute X amount of turns. http://forum.shrapnelgames.com/images/smilies/laugh.gif


All times are GMT -4. The time now is 04:45 PM.

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