**NOTE** This was done mainly for Ubuntu users. Ubuntu changed the naming structure that Lua itself uses in its packages, which often creates conflicts. This should work on any other *nix system as well, but you may not need to simlink your libraries. Gentoo, for example, can skip the simlinking step.
Firstly, You will need the following installed.
**NOTE** Since I do not know what libs you have installed on your system, you may need to get other needed libs. I have a ridiculous amount of libs installed on my computer for whatever reason, so I rarely need a new lib file for anything =/
CODE
autoconf lua5.1 liblua5.1-0 liblua5.1-0-dev
This can easily be installed with (for Ubuntu users...)
CODE
sudo apt-get install autoconf lua5.1 liblua5.1-0 liblua5.1-0-dev --assume-yes
Now to get around the Ubuntu issue which will cause ./configure errors in TF later you will want to do this in a terminal...
CODE
sudo cp /usr/include/lua5.1/* /usr/include/
cd /usr/lib
sudo ln -s liblua5.1.so liblua.so
cd /usr/lib
sudo ln -s liblua5.1.so liblua.so
Now you have what is NEEDED for the install... next let us get those files! First things first is to make sure your system is nice and fresh!
CODE
sudo apt-get remove tf
**NOTE** You will NEED to have TF removed from your system to compile lua in properly. If you are using the package "tf5" then remove it as well. You are removing tf so that you will not have an old binary conflicting with your new one. This will prevent problems such as loading tf and not having your lua help files present even though the install went ok (yes this happened to me TWICE!)
Now you need to get the required files.
[tf-5/0beta8, the latest tf as of now
[add-lua.patch, the lua patch file
Just to make both of our lives easier, you WILL download these to your Desktop. If they are not on your Desktop, I will not be responsible for the consequences.
Now let us get started! Back to our beloved terminal... (or you can unpack the files with archive manager or whatever you use, it is fine, in fact I recommend archive manager...)
CODE
tar -xzvf tf-50b8
cd tf-50b8
patch -p2 < ../add-lua.patch
cd tf-50b8
patch -p2 < ../add-lua.patch
Assuming the patch goes in ok... You now need to run autoconf!!!!! THEN do...
CODE
./configure --enable-lua --prefix=/usr
make
sudo make install
make
sudo make install
Assuming that goes well, you have your lua enabled tf installed. You will more than likely need to logout and log back in for your $PATH to be rebuilt (so you can run tf by using "tf"). You are now free to remove the patch and folder from your desktop and enjoy.
Lua help can be accessed from inside of TF with /help lua. The Lua patch gives you 3 new commands...
CODE
/loadlua
/calllua
/purgelua
/calllua
/purgelua
All of which are documented in TF with /help blah
THANKS GOES OUT TO: Telek of irc.freenode.net #Lua for helping me get this to work properly and in a portable manner and to goblin for writing the patch for tf. Thanks all, couldn't have done it without you!













