Author Topic: [TUTORIAL] What is an autoexec.cfg and how to use it?  (Read 26012 times)

Kiwi

  • Posts: 859
  • Turrets: +29/-9
[TUTORIAL] What is an autoexec.cfg and how to use it?
« on: May 02, 2009, 02:43:11 am »
Hey guys, this is my first tutorial so I'll do my best.  I decided to make a tutorial on an autoexec.cfg becuase I feel that many people lack in this area, and I fell that I have a good understanding in it.  I'm not sure if this is the right place to post this, but I guess an admin can move it if it's wrong.  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 <stringname> <text to write to the string>" to write to a string(ex. set string1 "say Lets Play Tremulous!").  You can then use the command "vstr <stringname>"(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 or post a reply here.

- Kiwi

Edit (19 June 2010): Fixed dead link
« Last Edit: June 20, 2010, 02:27:01 am by Kiwi »

Milean

  • Posts: 2
  • Turrets: +0/-0
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #1 on: May 06, 2009, 10:57:50 am »
Hey Kiwi, nice to see you trying to help new players!

First of all, normal people don't have server. cfg and maprotation. cfg in their base folder.  Those . cfg's only appear when you also have a server installed.
Secondly, I think you should link to several other binds files, and a set of trem commands.  Both can be found using the search.

Kiwi

  • Posts: 859
  • Turrets: +29/-9
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #2 on: May 06, 2009, 12:06:14 pm »
Alright, I added those links and corrected the base folder mistake.
Thanks for the feedback Milean.

Ryanw4390

  • Posts: 525
  • Turrets: +174/-20
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #3 on: May 22, 2009, 06:05:56 am »
Thanks a lot definitely helped me figure this out! Should have some fun playing around with this for the next few days :D
Clan {Jo|So} were clan {No|Shows} at todays war between them..

The Magma Warriors are pissed off you wasted our time, and I have decided I will DOS attack your server, I have a program for that. Unless you want to get your asses on, and do a 3 on 3 or 4 on 4.

Kiwi

  • Posts: 859
  • Turrets: +29/-9
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #4 on: May 23, 2009, 01:09:24 am »
Thanks a lot definitely helped me figure this out! Should have some fun playing around with this for the next few days :D
Thanks :)

Deadbeat Engineer

  • Posts: 105
  • Turrets: +9/-0
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #5 on: February 25, 2010, 07:53:08 pm »
This helped a lot. ;D Would've taken a long time using the commands within the game...
I herd u liek maras?

This most definitely. I cannot begin to express how This this is.

Demolution

  • Posts: 1198
  • Turrets: +157/-64
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #6 on: February 25, 2010, 10:13:13 pm »
Whenever I open my autogen.cfg file with notepad (using Vista), it's always a giant mess since for some reason the return characters are ignored and it looks something like the attached image.

I would reccomend that people try out Notepad++. It's an awesome little program that can format pretty much any type of text file correctly depending on its extension, and this makes editing your autogen.cfg file much easier.

Clan [AC] - For all your air conditioning needs please visit: http://s1.zetaboards.com/AC_NoS/index/
my brain > your brain.
and i am VERY stupid.

UniqPhoeniX

  • Spam Killer
  • *
  • Posts: 1376
  • Turrets: +66/-32
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #7 on: February 25, 2010, 11:11:07 pm »
You are supposed to edit autoexec.cfg not autogen.cfg. Trem overwrites autogen.cfg.

Demolution

  • Posts: 1198
  • Turrets: +157/-64
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #8 on: February 26, 2010, 04:44:01 am »
Correct you are. It's been a long day. :)
However I still recommend that people try the program since it's pretty helpful in editing both regular text and code.

Clan [AC] - For all your air conditioning needs please visit: http://s1.zetaboards.com/AC_NoS/index/
my brain > your brain.
and i am VERY stupid.

UniqPhoeniX

  • Spam Killer
  • *
  • Posts: 1376
  • Turrets: +66/-32
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #9 on: February 26, 2010, 09:51:03 am »
However I still recommend that people try the program since it's pretty helpful in editing both regular text and code.
Agreed.

Liskey

  • Posts: 112
  • Turrets: +7/-4
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #10 on: February 27, 2010, 09:32:21 pm »
You might want to create the tutorial on the Wiki - that is a better long-term solution for sticky documentation than the forum since anyone can edit it directly.  I just copied the [wiki]tips[/wiki] for newbies page over there, as an example.

P.S.
I haven't tried notepad++ and have nothing against it, but wordpad (built into Windows) will both display the file properly and fix the linefeeds so that the next time you open it with notepad, it will work.
« Last Edit: February 27, 2010, 09:39:44 pm by Liskey »

DraZiLoX

  • Posts: 844
  • Turrets: +24/-24
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #11 on: February 28, 2010, 08:37:29 am »
I dont like notepad++

I like SCITE :)

(http://www.scintilla.org/SciTE.html)

Kiwi

  • Posts: 859
  • Turrets: +29/-9
Re: [TUTORIAL] What is an autoexec.cfg and how to use it?
« Reply #12 on: March 01, 2010, 06:33:18 pm »
You might want to create the tutorial on the Wiki - that is a better long-term solution for sticky documentation than the forum since anyone can edit it directly.  I just copied the [wiki]tips[/wiki] for newbies page over there, as an example.
Done! [wiki]autoexec.cfg[/wiki], thanks.

I also prefer Notepad++