Radiant Project Files Radiant stores project specific settings in project files which are usually stored under …\smokinguns\scripts. In general, there are two types: a template file (called default_project.proj) and user files (called user#.proj where # is a number). The user project file contains the configuration settings of the current Radiant project. This one is loaded during startup and mainly controls any paths settings Radiant requires to execute other programs.
The default_project.proj file looks like this:
- Code: Select all
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "dtds/project.dtd">
<project>
<key name="version" value="2"/>
<key name="basepath" value="$TEMPLATEenginepath$TEMPLATEbasedir/"/>
<key name="rshcmd" value=""/>
<key name="remotebasepath" value="$TEMPLATEenginepath$TEMPLATEbasedir/"/>
<key name="entitypath" value="$TEMPLATEtoolspath$TEMPLATEbasedir/scripts/entities.def"/>
<key name="texturepath" value="$TEMPLATEenginepath$TEMPLATEbasedir/textures/"/>
<key name="autosave" value="$TEMPLATEuserhomepath$TEMPLATEbasedir/maps/autosave.map"/>
<key name="mapspath" value="$TEMPLATEuserhomepath$TEMPLATEbasedir/maps/"/>
<key name="bsp_Q3Map2: (single) BSP -meta" value="! "$TEMPLATEapppathq3map2" -v # -game quake3 -fs_basepath "$TEMPLATEenginepath" -meta $"/>
<key name="bsp_Q3Map2: (single) -vis" value="! "$TEMPLATEapppathq3map2" # -game quake3 -fs_basepath "$TEMPLATEenginepath" -vis $" />
... snipped several other declarations ...
A typical user0.proj like this
- Code: Select all
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "project.dtd">
<project>
<key name="user_project" value="1"/>
<key name="brush_primit" value="0"/>
<key name="bsp_Q3Map2: (simulate old style -light -extra) BSP -meta, -vis, -light -super 2" value="! "C:/Programme/GtkRadiant-1.4/q3map2" -v # -game quake3 -fs_basepath "C:/Programme/Quake III Arena/" -meta $ && ! "C:/Programme/GtkRadiant-1.4/q3map2" # -game quake3 -fs_basepath "C:/Programme/Quake III Arena/" -vis -saveprt $ && ! "C:/Programme/GtkRadiant-1.4/q3map2" -v # -game quake3 -fs_basepath "C:/Programme/Quake III Arena/" -light -super 2 $"/>
... snipped several other declarations ...
</project>
It is important to understand the following relationshop between these files: Radiant checks for a user project file each time it starts up. If there is one, it will load it and configure itself to the settings therein. In case there is no user project file, Radiant processes the default_project.proj file and creates a new user project file. Thus, any changes we are doing in default_project will be applied to every new user project file. We can simply delete the existing user files in order to get a new one (of course, this also means that the user file can be edited directly).
We will only change the default_project.proj fie for the purpose of the tutorial since I am trying to come up with a better version for our (i.e. SG) needs. You can probably make things easier (but less generic) when changing your user project settings.
Note: project files do not contain any “settings”. If you are after that, you should open “local.pref” which is located in your mapping tools directory (typically ..\Smokin’ Guns Development\Radiant-1.4.0\ or similar). In case you ever “lost” your default_project.proj file you can recover it from your radiant installation since Radiant comes with a default default_project.proj so to say.
Lets take a closer look at default_project.proj now:
- Code: Select all
... snip
<key name="mapspath" value="$TEMPLATEuserhomepath$TEMPLATEbasedir/maps/"/>
<key name="bsp_Q3Map2: (single) BSP -meta" value="! "$TEMPLATEapppathq3map2" -v # -game quake3 -fs_basepath "$TEMPLATEenginepath" -meta $"/>
... snip
The general structure is fairly simple. Basically, these are declarations that set a specific variable to specific setting. The thing is that anything with the dollar in front is a variable which expands to a concrete value when processed by Radiant. For instance, the variable $TEMPLATEapppath represents “c:\Programme\ Zero Radiant\” in my installation. Note: the values are taken from the sg.game file.
The variable “$” is a special case: it represents the current map file (including the path to it). Thus, when you are working on your project “thegreatestsgmapever.map” the dollar sign will equate to something like “c:\Programme\Smokin’ Guns Development\smokinguns\maps\ thegreatestsgmapever.map”. It is important to note that this variable is NOT replaced whenever the user project files are created. To sum up this whole business is about creating “strings” that execute programs with proper parameters.
This sounds more difficult than it’s actually is. So lets get to some examples.