logo Scripting for Enemy Territory

Menu


Home
Tutorials
Downloads
Forum
Contact

Friends





Basic tutorial 2

Creating an autoexec.cfg and using downloaded scripts.

Autoexec

There is one special cfg file and it's called the autoexec file. As you can probably imagine by its name, this file automatically executes itself and thus running all the commands and scripts stored inside. This is why this file should be the basis of all your scripts. From this file you will execute all your other cfg files.

Creating the autoexec.cfg file is done in exactly the same way like any other cfg file, which we discussed in the previous thread. This time saving it as autoexec.cfg.

Using downloaded scripts

To use a script you do not need almost no knowledge about scripting. The only thing you need to know is how to make an autoexec, because all scripts you use can be executed from this file. Let's say you've made an autoexec file and you have downloaded 2 scripts called weapons.cfg and vsays.cfg. First thing you do is open your autoexec.cfg. In this file you have to type the 2 following lines to execute the 2 scripts you have downloaded:





You do not have to be Einstein to figure out that if you execute your autoexec file, your 2 scripts weapons.cfg and vsays.cfg will also be executed and thus your 2 scripts will work.

The next question is where to put the files. Well in most cases all cfg files go in your etmain directory. There are some exception, but those will be dealt with at a later stage.

Now that you have placed all the files in your etmain directory, we will have to execute them. So you start up the game and go onto your favorite server. You then pull down your console, which is done with the tilde key at the top left of your keyboard.



You now execute your autoexec by typing:
/exec autoexec (followed by an ENTER and no need to place the file extension .cfg behind the command).Just like you can see in the following image:



You can now start using your scripts. How to actually make your own scripts is discussed in the following threads.

Back to the tutorial list