Add setup.bat and instructions for compiling models using the ep1 SDK (2006) tools

This commit is contained in:
squeek 2016-06-06 23:14:32 -07:00
parent dd79791cc0
commit f4e2c3355a
2 changed files with 111 additions and 1 deletions

View file

@ -1,4 +1,32 @@
# fortressforever-models
The model source files of Fortress Forever
*Note:* The files in this repository are **not** guaranteed to be up-to-date with the compiled models that are currently distributed with the game.
*Note:* The files in this repository are **not** guaranteed to be up-to-date with the compiled models that are currently distributed with the game.
## Setting up Studiomdl
1. **Install Source SDK**
* In Steam, go to the Library tab and select *Tools* from the dropdown
* Find *Source SDK* in the list and install it
2. **Setup Source SDK**
* Run Source SDK once (it will install some misc files and set the `sourcesdk` environment variable for you). Close it once it is finished.
* Download and run [`setup.bat`](https://raw.githubusercontent.com/fortressforever/fortressforever-models/master/setup.bat)
3. **Set The Current Game**
* Open Source SDK
* Select *Source Engine 2006* as the *Engine Version* and *Fortress Forever* as the *Current Game*
* You can now close Source SDK as it's no longer needed
## Compiling a Model
To compile a model, use `studiomdl.exe` found in `Steam/steamapps/common/SourceSDK/bin/ep1/bin`. When you launch Source SDK (see setup instructions), an environment variable named `SourceSDK` will get set to the `Steam/steamapps/common/SourceSDK` directory path, so you can use `%SourceSDK%/bin/ep1/bin/studiomdl` as a shortcut to studiomdl that will work across different machines.
Example commands to compile the tranquilizer viewmodel:
```
cd weapons/tranq/viewmodel
%SourceSDK%/bin/ep1/bin/studiomdl v_tranq.qc
```
Assuming you followed the setup instructions above, the compiled models will be output into the `Steam/steamapps/common/Fortress Forever/sdk` directory (**not** into the main mod directory), so you'll need to copy the newly compiled files into `Steam/steamapps/common/Fortress Forever/FortressForever`
For more information about studiomdl, see https://developer.valvesoftware.com/wiki/Studiomdl

82
setup.bat Normal file
View file

@ -0,0 +1,82 @@
@echo off
FOR /f "tokens=1,2*" %%E in ('reg query "HKEY_CURRENT_USER\Software\Valve\Steam"') DO (
IF "%%E"=="SteamPath" (
set SteamPath=%%G
)
)
IF "%SteamPath%"=="" (
echo Not able to determine Steam install path. Make sure you have Steam installed
pause
exit /B
)
IF "%sourcesdk%"=="" (
echo SourceSDK environment variable is not set. Run Source SDK once before executing this script
pause
exit /B
)
set GameDir=%SteamPath%/steamapps/common/Fortress Forever
set ModDir=%GameDir%/FortressForever
IF NOT EXIST "%GameDir%" (
echo "%GameDir%" does not exist. Make sure Fortress Forever is installed
pause
exit /B
)
set Ep1BinDir=%sourcesdk%\bin\ep1\bin
set SteamConfigFile=%SteamPath%\config\SteamAppData.vdf
set Ep1ConfigDir=%Ep1BinDir%\config
set Ep1ConfigFile=%Ep1ConfigDir%\SteamAppData.vdf
set GameInfoDir=%GameDir%/sdk
set GameInfoFile=%GameInfoDir%/gameinfo.txt
IF NOT EXIST "%SteamConfigFile%" (
echo "%SteamConfigFile%" does not exist. Try launching Steam
pause
exit /B
)
IF NOT EXIST "%GameInfoDir%" mkdir "%GameInfoDir%"
echo(
echo Writing "%GameInfoFile%"...
(
echo "GameInfo"
echo {
echo game "Fortress Forever"
echo title "Fortress Forever"
echo name "Fortress Forever"
echo type multiplayer_only
echo(
echo FileSystem
echo {
echo SteamAppId 215
echo ToolsAppId 211
echo SearchPaths
echo {
echo Game ^|gameinfo_path^|..\FortressForever
echo Game ^|gameinfo_path^|..\hl2
echo Game ^|gameinfo_path^|..\platform
echo }
echo }
echo }
) > "%GameInfoFile%"
echo -^> Done
:: Need to copy SteamAppData.vdf from Steam/config/ to bin/ep1/bin so that studiomdl
:: doesn't throw a 'Can't find steam app user info' error
echo(
echo Writing "%Ep1ConfigFile%"...
IF NOT EXIST "%Ep1ConfigFile%" (
IF NOT EXIST "%Ep1ConfigDir%" mkdir "%Ep1ConfigDir%"
XCOPY /R /Y /V "%SteamConfigFile%" "%Ep1ConfigDir%"
echo -^> Done
) ELSE (
echo -^> File already exists
)
echo(
echo Source SDK setup completed successfully.
echo(
pause