Autoexec.cfg

Copied and edited from http://tremulous.net/forum/index.php?topic=10945 for now:

Hey guys, this is my first tutorial so I'll do my best. I decided to make a tutorial on an autoexec.cfg because I feel that many people lack in this area, and I fell that I have a good understanding in it. I also added an example autoexec.cfg file that I commented for explaining what everything does. You can download that from: http://darkmattertrem.freehostia.com/autoexec.cfg. Just right-click that link, and then save it as autoexec.cfg.(make sure that the ending is .cfg not .txt or .cft.txt) In my tutorial I'm going to talk about how to bind keys, set up strings, and bind multiple commands to the same key. Anyway, here I go...

Ok, firstly an autoexec.cfg file is a .cfg file that tremulous reads on startup. It is only read once, and it can be very useful if used correctly. It is important that it is called "autoexec.cfg" and is placed in (where tremulous is installed)/base. If you have installed the tremulous server, you will see other files in the folder like server.cfg and maprotaion.cfg, if you see these 2 files, with others, then you are in the right folder. Once you have the autoexec.cfg in place, we can start editing it.

A autoexec.cfg is very useful for doing things like changing your name at startup and setting standard binds. If you haven't done so already, I would recommend downloading the attached autoexec.cfg that I created and placing it in your base folder. After you open it, you will see that it is quite lengthy, but it is still very important to read ALL of my comments, because they all explain important parts of editing tremulous code. I would also recommend reading through both the autoexec.cfg file and this tutorial to get the best understanding of autoexec.cfg files that you can. It is also worth mentioning that any line starting with "//" is commented and will not be run when you start tremulous. It is only there to explain what I have done with the code.

Once this is out of the way, you can see that we start by setting up some strings. The best way that I can describe a string as is a blank piece of paper that you can write anything you want to, and read anything on it. To get a basic understanding of using strings I will explain writing to them, and executing them. You use the command "set " to write to a string(ex. set string1 "say Lets Play Tremulous!"). You can then use the command "vstr "(ex. vstr string1 --> this will print "Lets Play Tremulous").

Now that you have a basic understanding of strings, you can see that the first few lines of code are setting strings to run different commands. If you notice, nothing is being binded, so all we've done is written commands to a "page". As you get to the "Start of String Setting" section, you see that we then put all of these strings under a string category(another string, what binds all the other strings to 1-9). We still haven't bound anything, we have only set up strings which will bind strings to keys when run.

As you move father down the code, you will see that we actually bind a few keys. These keys are the f1-f6 keys. We bind these 6 keys to run(vstr) the strings which bind more strings to the 1-9 keys. As a result, the f1-f6 keys will bind the 1-9 keys to different keys. This allows you to bind the 1-9 keys to 6 different sets of commands! This becomes very useful, when you have billions of binds that you can't fit on your keyboard.

And there you have a complex autoexec.cfg that overbinds the 1-9 key multiple times. There is much more that you can add and change, and this is just the basics that is meant to help you get a start in the world of Tremulous code. Feel free to add strings and more categories as you need them and remember to edit your F-Key binds accordingly.

You can find a huge list of tremulous commands that you can use in your autoexec.cfg file here. You should also look at this to find some more information of tremulous commands. Lastly, if you are looking to bind commands relating to gameplay look here. All of these commands that you now know can be added to your autoexec.cfg file in a string, bind, or to be run every time you start up tremulous.

If you have any questions or comments feel free to contact me at kiwitrem@yahoo.com.

--Kiwi 18:31, 1 March 2010 (UTC)