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

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #61  
Old February 3rd, 2005, 11:04 PM
Master Belisarius's Avatar

Master Belisarius Master Belisarius is offline
Colonel
 
Join Date: Jul 2000
Location: Montevideo Uruguay
Posts: 1,598
Thanks: 0
Thanked 0 Times in 0 Posts
Master Belisarius is on a distinguished road
Default Re: SE4Batch status?

Quote:
geoschmo said:
Works magnificently MB. This is exactly what I was looking for. Thank you again.
Cool!
Reply With Quote
  #62  
Old February 4th, 2005, 01:29 AM
Nodachi's Avatar

Nodachi Nodachi is offline
First Lieutenant
 
Join Date: Mar 2002
Location: North Carolina
Posts: 720
Thanks: 0
Thanked 0 Times in 0 Posts
Nodachi is on a distinguished road
Default Re: SE4Batch status?

OK, after some research, experimentation, and a lot of cursing this is what I've come up with; three batch files that will ask you how many turns you want to run the game, run the game, and save each turn with the game date.

AITest.bat
Code:
@echo off  

set E4=2
set E3=4
set E2=0
set E1=0
set E0=1

set /p Turns=How many turns do you want to run?

call RunGame %Turns%


This sets the game date and asks you how many turns you want to run.

Counter.bat
Code:
@echo off
:: Increments a five digit number
:: Works by comparing each digit
:: E4=tenthousands, E3=thousands, E2=hundreds, E1=tens, E0=ones
if [%E4%]==[] set E4=0
if [%E3%]==[] set E3=0
if [%E2%]==[] set E2=0
if [%E1%]==[] set E1=0
if [%E0%]==[] set E0=0
:E0
if %E0%==9 goto E1
if %E0%==8 set E0=9
if %E0%==7 set E0=8
if %E0%==6 set E0=7
if %E0%==5 set E0=6
if %E0%==4 set E0=5
if %E0%==3 set E0=4
if %E0%==2 set E0=3
if %E0%==1 set E0=2
if %E0%==0 set E0=1
goto DONE
:E1
set E0=0
if %E1%==9 goto E2
if %E1%==8 set E1=9
if %E1%==7 set E1=8
if %E1%==6 set E1=7
if %E1%==5 set E1=6
if %E1%==4 set E1=5
if %E1%==3 set E1=4
if %E1%==2 set E1=3
if %E1%==1 set E1=2
if %E1%==0 set E1=1
goto DONE
:E2
set E1=0
if %E2%==9 set E2=0
if %E2%==8 set E2=9
if %E2%==7 set E2=8
if %E2%==6 set E2=7
if %E2%==5 set E2=6
if %E2%==4 set E2=5
if %E2%==3 set E2=4
if %E2%==2 set E2=3
if %E2%==1 set E2=2
if %E2%==0 set E2=1
goto DONE
:E3
set E2=0
if %E3%==9 set E3=0
if %E3%==8 set E3=9
if %E3%==7 set E3=8
if %E3%==6 set E3=7
if %E3%==5 set E3=6
if %E3%==4 set E3=5
if %E3%==3 set E3=4
if %E3%==2 set E3=3
if %E3%==1 set E3=2
if %E3%==0 set E3=1
goto DONE
:E4
set E3=0
if %E4%==9 set E4=0
if %E4%==8 set E4=9
if %E4%==7 set E4=8
if %E4%==6 set E4=7
if %E4%==5 set E4=6
if %E4%==4 set E4=5
if %E4%==3 set E4=4
if %E4%==2 set E4=3
if %E4%==1 set E4=2
if %E4%==0 set E4=1
goto DONE
ONE


This is what keeps the date.

RunGame.bat
Code:
@echo off   

if not [%Turns%]==[] goto Okay
echo Syntax: %0 %Turns%
goto End
:Okay
if [%2]==[::] goto 2nd time around
if [%3]==[::] goto 3rd time around
if [%4]==[::] goto 4th time around
if [%5]==[::] goto 5th time around

%comspec% /e:2048 /c %0 %Turns% ::
goto End
:2nd time around
for %%v in (0 1 2 3 4 5 6 7 8 9) do call %0 %1 %%v ::
goto End
:3rd time around
for %%v in (0 1 2 3 4 5 6 7 8 9) do call %0 %1 %2 %%v ::
goto End
:4th time around
for %%v in (0 1 2 3 4 5 6 7 8 9) do call %0 %1 %2 %3 %%v ::
goto End
:5th time around

if [%1]==[%4] exit
if [%1]==[%3%4] exit
if [%1]==[%2%3%4] exit

:filecheck1
IF EXIST Test. goto rungame ELSE goto filecheck1

:rungame
copy Test.gam RNTest.gam
start /w c:\SEIV\Se4.exe "C:\SEIV\Star Trek Mod\Savegame\Test.GAM" " " "0" "Star Trek Mod"

:filecheck2
IF EXIST RNTest. goto rename ELSE goto filecheck2
:rename
ren "RNTest.gam" "%E4%%E3%%E2%%E1%%E0%Test.gam"
echo %E4%%E3%%E2%%E1%.%E0%
call counter.bat

:End


This is where the work is done.

I put all three into the Savegame folder I was using for ease of use, of course you'll have to adjust the paths for your game. Once you've got them set up where you want set up your game the same way as explained earlier (use Test.gam for your save name) and just call AITest from the command prompt and you should be good to go. This runs under XP but I have no idea if it'll run under a different os.
Files attached in zip.
Have fun!
Attached Files
File Type: zip 329128-AITestBatch.zip (1.2 KB, 152 views)
__________________
This is the 21st century, right? Then where the hell is my flying car?
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 04:43 AM.


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