How can I run batch file?


(Arcanis) #1

I have wrote this batch file:

@rem to use this batch file, drop a .map file on it or run it from a dos window:
@rem > compile <nautilus>

@set Q3MAP_PATH="D:\SDRadiant\sdmap2.exe"
@set ET_PATH="D:/wolfet"
@set MAP_PATH="D:/wolfet/etmain/maps/%1.map"
@set GEN_OPTIONS=-fs_basepath D:/wolfet -game et

@rem
%Q3MAP_PATH% -meta -mv 1024 -mi 6144 %GEN_OPTIONS% -v %MAP_PATH%

@rem
%Q3MAP_PATH% -vis -saveprt %GEN_OPTIONS% %MAP_PATH%

@rem
%Q3MAP_PATH% -light -fast -samples 2 -filter -patchshadows -external -lightmapsize 256 -approx 8 %GEN_OPTIONS% -v %MAP_PATH%

(I have changed the C:\ directory to D:\ directory because I have onstalled Wolfenstein and GtkRadiant to D:)

(nautilus is the map name, it require the .map or not??)

I dont know how to run batch file in DOS and I cant drop my map to the batch file

Its all ok with batch file or require some changes?


(lennyballa) #2

the answer is in the topline of the code


(Arcanis) #3

I open the DOS and wrote:
rem > compile <nautilus>

whats wrong? :???: :???:

I cant drop my map on the batch file :angry: :angry: :angry:

PLZ help me


(Mlehliw) #4

Change the path for q3map unless of course you do have sdmap2. Q3map2 can be found in your gtkradiant directory. Instead of the %1.map put nautilus.map. Then double click on the batch file and it should run.


(cremator) #5

the way i did it is like this: i made that batch file, fixed the paths, and dropped the .bat in my maps folder. then i go to start -> run -> cmd

in cmd, i type cd… then cd… again to get to C:\ then i type cd progra~1 to get to program files, then i type cd wolfen~1 to get to the enemy territory directory. then cd etmain, then cd maps (where the actual bat is located) i named my bat file compile.bat, so in cmd, i type compile mymap and it compiles, and makes a bsp. there are other ways where you dont have to change directories, but since i know how, i really dont mind. mabey that will give you some help on command and some functions of it.

Edit: here is the full path to my compile.bat

C:\Program Files\Wolfenstein - Enemy Territory\etmain\maps\compile.bat


(Arcanis) #6

I do this changes but it still dont work :banghead: :banghead:

@rem to use this batch file, drop a .map file on it or run it from a dos window:
@rem > compile <nautilus>

@set Q3MAP_PATH="D:\GTKRadiant-et-1.3\q3map2.exe"
@set ET_PATH="D:\Program Files\Wolfenstein - Enemy Territory" 
@set MAP_PATH="D:\Program Files\Wolfenstein - Enemy Territory\etmain\maps
autilus.bsp" 
@set GEN_OPTIONS=-fs_basepath "D:\Program Files\Wolfenstein - Enemy Territory" -game et 

@rem
%Q3MAP_PATH% -meta -mv 1024 -mi 6144 %GEN_OPTIONS% -v %MAP_PATH%

@rem
%Q3MAP_PATH% -vis -saveprt %GEN_OPTIONS% %MAP_PATH%

@rem
%Q3MAP_PATH% -light -fast -samples 2 -filter -patchshadows -external -lightmapsize 256 -approx 8 %GEN_OPTIONS% -v %MAP_PATH%

whats wrong :???:


(chavo_one) #7

Well it looks to me like you are trying to compile your bsp file. :huh:


(lennyballa) #8

remove the <> in 2nd line


(chavo_one) #9

maybe, but even if he does that, he’s still trying to compile a bsp file instead of a map file.


(lennyballa) #10

True True, rename nautilus.bsp to nautilus.map, it should work then


(cremator) #11

@rem to use this batch file, run it from a dos window:
@rem > compile <mapname> without the .map extension

@set Q3MAP_PATH=“C:\Program Files\GtkRadiant-ET-1.3\q3map2.exe”
@set ET_PATH=“C:\Program Files\Wolfenstein - Enemy Territory”
@set MAP_PATH=“C:\Program Files\Wolfenstein - Enemy Territory\etmain\maps%1.map”
@set GEN_OPTIONS=-fs_basepath “C:\Program Files\Wolfenstein - Enemy Territory” -game et

@rem
%Q3MAP_PATH% -meta -mv 1024 -mi 6144 %GEN_OPTIONS% -v %MAP_PATH%

@rem
%Q3MAP_PATH% -vis -saveprt %GEN_OPTIONS% %MAP_PATH%

@rem
%Q3MAP_PATH% -light -fast -samples 2 -filter -patchshadows -external -lightmapsize 256 -approx 8 %GEN_OPTIONS% -v %MAP_PATH%

@pause

that should be the correct code (not counting the path names, you fill those in)


(Arcanis) #12

I have made all the changes but when I double click to my batch file it open in text mode instead to start compile my map.

Anyone know how to run batch file in DOS :???:

Is there something that I must change instead of %MAP PATH% or not

my batch file :

@rem to use this batch file, run it from a dos window: 
@rem > compile nautilus

@set Q3MAP_PATH="D:\Program Files\GtkRadiant-ET-1.3\q3map2.exe" 
@set ET_PATH="D:\Program Files\Wolfenstein - Enemy Territory" 
@set MAP_PATH="D:\Program Files\Wolfenstein - Enemy Territory\etmain\maps
autilus.map" 
@set GEN_OPTIONS=-fs_basepath "D:\Program Files\Wolfenstein - Enemy Territory" -game et 

@rem 
%Q3MAP_PATH% -meta -mv 1024 -mi 6144 %GEN_OPTIONS% -v %MAP_PATH% 

@rem 
%Q3MAP_PATH% -vis -saveprt %GEN_OPTIONS% %MAP_PATH% 

@rem 
%Q3MAP_PATH% -light -fast -samples 2 -filter -patchshadows -external -lightmapsize 256 -approx 8 %GEN_OPTIONS% -v %MAP_PATH% 

@pause 

(lennyballa) #13

just put drag your map in the bat file


(chavo_one) #14

Make sure the filename of your script does NOT end with .txt. When saving a new file with notepad, it appends .txt to the filename.

So if you have compile.bat.txt, change it to compile.bat.


(cremator) #15

I already told you how to run a bat in command. (Command might = dos in your version of windows)


(Arcanis) #16

I have tryed to compile my map in DOS:
D:\Program Files\Wolfenstein - Enemy Territory\etmain\maps> ??and??

I have tryed: compile nautilus
compile nautilus.map
rem > compile nautilus.map

but no one still work!!!

I have tryed to drag my map on the batch file and batch file on the map but DONT WORK!!!

The name of my batch file is: compile.bat
but when I open the properties of the batch file it say:

Type of file: Text Document

PLZ HELP ME :frowning:


(cremator) #17

Do you have show file extensions on for your windows (if using windows?)

if not turn it on the name it compile.bat .


(SoulRebel) #18

@set Q3MAP_PATH=“C:/games/GtkRadiant-ET-1.3/q3map2.exe”
@set ET_PATH=“C:/games/rtcwET”
@set MAP_PATH=“C:/games/rtcwET/etmain/maps/%1.map”
@set GEN_OPTIONS=-fs_basepath C:/games/rtcwET -game et

when you using the batch file from the reference then do not forget to modify the paths

you can see my directories above…

then run the cmd (dos) and run the batch

try not using the backslash… use the normal slash

maybe: @set MAP_PATH=“D:\Program Files\Wolfenstein - Enemy Territory\etmain\maps
autilus.map”
-> you have fixed you batch file to the map nautilus… when you have done this you do not need to start the compiler with “compile nautilus” because nautilus is fixed… us the %1 to set a variable … but if you use this way then you have to use this line:

@set MAP_PATH=“D:\Program Files\Wolfenstein - Enemy Territory\etmain\maps%1.map”

-> start with compile <mapname> = this mapname will be the %1

and dont start (when u using windows) the batch file from the explorer… first run cmd … (dos-eingabeaufforderung) and then use cd… , cd <dir>… to change to the right path and then execute the file from the dos-line
(this is the small black window with the dos-prompt)


(Arcanis) #19
@rem to use this batch file, drop a .map file on it or run it from a dos window:
@rem > compile nautilus

@set Q3MAP_PATH="D:/GtkRadiant-1.3/q3map2.exe"
@set ET_PATH="D:/Program Files/Wolfenstein - Enemy Territory"
@set MAP_PATH="D:/Program Files/Wolfenstein - Enemy Territory/etmain/maps/%1.map"
@set GEN_OPTIONS=-fs_basepath D:/Program Files/Wolfenstein - Enemy Territory -game et

@rem
%Q3MAP_PATH% -meta -mv 1024 -mi 6144 %GEN_OPTIONS% -v %MAP_PATH%

@rem
%Q3MAP_PATH% -vis -saveprt %GEN_OPTIONS% %MAP_PATH%

@rem
%Q3MAP_PATH% -light -fast -samples 2 -filter -patchshadows -external -lightmapsize 256 -approx 8 %GEN_OPTIONS% -v %MAP_PATH%

this is my batch file

and then execute the file from the dos-line
(this is the small black window with the dos-prompt)

how can I execute the the file from dos-line :???:

In DOS I open this: D:\Program Files\Wolfenstein - Enemy Territory\etmain\maps>

but I dont know what to don now?


(skinner) #20

grow a braincell perhaps? or two if you really have some time to spare, or alternatively you could actually read what these people have written and do it