General > User modifications
how to apply a mod (Win 7)
homunculus:
Maybe for some people this +set fs_gamedir seems confusing, and they might use some background info to feel more confident about what they are doing.
Disclaimer
=======
I am not a C programmer, nor a Windows programmer or expert. I have just been using some Windows, UNIX and Linux for some time, including some programming. However, I hope an explanation by a casual user might be easier to understand by other casual users.
Ancient History
=========
Once upon a time there were no smartphones, not even mobile phones, and 10 kilobytes hard drive (compared to 10 terabytes nowadays) was a luxury.
Commands on computers had a limit of 6 letters. Same for variable names and function names in, say, Fortran77 (a programming language).
So, you want a command SetEnvironmentVariable? You abbreviate it to setenv.
MakeDirectory? mkdir (Folders were called directories back then).
ChangeDirectory? chdir.
BasicInputOutputSystem? bios.
Sometimes things can get funny, like I myself have invented function names like simsym and symsum because they were the most meaningful abbreviations (SimulateSymmetry, and SumOfSimulatedSymmetry).
I mean, the abbreviations were created with best intentions of being easy to understand, but with 6 letters you can only do so much.
Later, when this 6 letter limit was not necessary, people still understood that ch means change, mk means make and dir means directory.
It is like nowadays Application is called App even without the 6 letters limit and everybody should understand what it means (not Apparition).
Command Prompt
===========
People are talking about command prompt or command line interface or cmd. Back then, the little command prompt window was your whole screen that you had. But the monitors were not that small? It is because the resolution was lower.
So, in this command line interface you would navigate (by using chdir) to the folder (directory) where ufo.exe is.
.exe means ufo.exe is an executable, or in other words, a program that you can run.
You wouldn't need to type ufo.exe to run it just ufo is enough.
So, congratulations, you have managed to run ufo from command line.
Command Line Parameters
=================
Those +set fs_gamedir things are command line parameters. When ufo.exe runs, the program also knows what those command line parameters are.
set (most likely) means set like in English.
fs (most likely) means file system.
gamedir (most likely) means game directory.
Additional Game Directory
================
If you run ufo.exe (without command line parameters), you can mod the game by putting files and folders in the directory where ufo.exe is, and if those folders and files have the same directory structure as in the source code of the game, they get used instead of the corresponding originals.
But putting mods in that directory is a bit invasive.
So, when you run ufo.exe for the first time, it also creates another directory, on Windows 10 it would be
C:\Users\<your user name>\AppData\Roaming\UFOAI\2.6-dev
(note that AppData is a hidden folder, you need to set 'show hidden folders' to see it)
(and you need to have run the game at least once to have the UFOAI\2.6-dev folder created at all)
This directory is (most likely) also treated as the game directory where ufo.exe is.
Also, you have folder 'base' there where the game stores your configurations and save files.
A Folder for a Mod in User Data Directory
==========================
The directory
C:\Users\<your user name>\AppData\Roaming\UFOAI\2.6-dev
is (most likely) called the user data directory.
You can create a folder 'mods' in that directory, next to the 'base', and tell ufo.exe to treat the directory 'mods' as an additional game directory by starting ufo.exe from command line as
ufo +set fs_gamedir mods
(there is no need to get confused if someone writes '.\ufo +set fs_gamedir mods', the dot just means current directory and can be omitted, same goes for the full path if you are already in the directory where ufo.exe is)
Organizing Mods
==========
But what if you want to try one mod today and another mod tomorrow, meaning, you want several mods?
Then you might create a subfolder of the folder 'mods' for each mod.
Like, you might create 'mods\lazy_hud_v2' and 'mods\lazy_hud' and 'mods\radar_mod' and put the mods in their own folders.
And now, when you want to play ufo with a mod, say, lazy hud version 2, you open the command line interface and navigate to the folder where ufo.exe is and type
ufo +set fs_gamedir mods\lazy_hud_v2
I have not tried this, but most likely you could run two mods at the same time by passing multiple game directories as command line parameters like this:
ufo +set fs_gamedir mods\lazy_hud_v2 mods\radar_mod
Creating a Batch File
=============
Navigating to the ufo.exe folder in Command Prompt and typing all those command line parameters can be tedious.
You can create a plain text file (extension .txt) where you write
ufo +set fs_gamedir mods\lazy_hud_v2
and you save it not with the extension '.txt' but with extension '.bat' (say, lazy2.bat).
Then you can move the batch file to the folder where ufo.exe is (Windows will ask for admin password).
.bat means batch, like a batch of commands. You could put multiple commands in a batch file, and if you run the batch file (same way you run an executable) all those commands get executed.
Now you could navigate to the folder where ufo.exe and lazy2.bat are and type
lazy2
and you have executed the command in the .bat file which is
ufo +set fs_gamedir mods\lazy_hud_v2
Creating a Shortcut to the Batch File
=======================
You can skip the command line altogether.
Just like .exe can be run by double-click, a .bat can also be run by double-click.
If you want to edit the .bat file you choose Edit from right mouse button menu (Open will just run the commands in the .bat).
And you can create a shortcut of the batch file and place it on your desktop.
Then you can run
ufo +set fs_gamedir mods\lazy_hud_v2
in the directory where ufo.exe is by double-clicking the shortcut on your desktop.
You can also change the icon of the shortcut by opening Properties (in right mouse click menu on the shortcut) and pressing 'Change Icon...' button in the 'Shortcut' tab. Then you can navigate to UFOAI-2.6-dev folder and choose ufo.exe file as the "icon".
Now you should have a nice looking clickable shortcut on your desktop.
Summary
======
Please put your mods in a separate folder in AppData rather than in the folder where ufo.exe is.
Like, say,
C:\Users\<your user name>\AppData\Roaming\UFOAI\2.6-dev\mods\lazy_hud_v2
and run the modded game as
ufo +set fs_gamedir mods\lazy_hud_v2
Now, after writing all of this, I am wondering if I clarified things or if I made it even more confusing.
Navigation
[0] Message Index
[*] Previous page
Go to full version