View Full Version : #How to: Make your own config.
Celine
04-20-2010, 11:46 AM
Allot of you use configs which they got from other people but it is best to adjust your config to your computer and to your liking.
So everything posted here should be tried out one at a time just to make sure you are happy with the result:
Never use someone elses config in total!
---------------------------------------
Scripts for increasing FPS:
---------------------------------------
//FPS increase settings
seta r_picmip "3"
seta r_lodBias "2"
seta r_lodCurveError "60"
seta r_roundImagesDown "1"
seta r_drawSun "0"
seta r_fastSky "1"
seta r_facePlaneCull "0"
seta r_detailTextures "0"
seta r_textureMode "GL_NEAREST"
seta r_mode "4"
seta r_subdivisions "999"
seta r_lodscale "5"
seta r_lodcurveerror "250"
seta r_stencilbits "0"
seta r_colorbits "16"
seta r_texturebits "16"
seta r_gamma "1.7"
seta r_simpleMipMaps "0"
seta cg_atmosphericEffects "0"
seta cg_wolfparticles "0"
seta cg_coronas "0"
seta cg_gibs "0"
seta cg_brassTime "0"
seta b_muzzleflash "0"
----------------------------------
FPS script 2
----------------------------------
seta r_Dipslayrefresh "85" //must be set at the same hz as your monitor
seta r_intensity "1.5"
seta r_picmip "3"
seta r_gamma "3"
seta r_ignorehwgamma "1"
seta r_overBrightBits "2"
seta r_mapoverbrightbits "3"
seta r_subdivisions "20"
seta r_lodbias "1"
seta r_lodCurveError "60"
seta r_texturemode "GL_LINEAR_MIPMAP_NEAREST"
seta r_dynamiclight "0"
seta r_drawSun "0"
seta r_fastsky "1"
seta r_simpleMipMaps "0"
seta r_detailtextures "0"
seta r_roundImagesDown "1"
seta r_ignoreFastPath "0"
Next up: a tutorial of creating your very own config.
Celine
04-20-2010, 11:49 AM
Basic tutorial 1
Creating a cfg file.
Before you start learning to script you have to know in what kind of a file you place your script. These files are known as config files or cfg files. Cfg stands for the extension of the file, e.g. weapons.cfg.
You do not need any expensive software to create these files. You can use a text editor like notepad, wordpad or notepad++. Most people use notepad, so I will also be using it in my examples in all the tutorials.
The tricky part is in the saving of the file. We will now create an empty cfg file called test.cfg. Open notepad and just, like you always would when saving a file, go to:
File --> Save as
http://www.2createit.nl/images/tuts/saveas.jpg
Now there are 2 ways of saving this file correctly:
1. Change the file type to "All files" and set your file name to weapons.cfg, like you can see in the image below
http://www.2createit.nl/images/tuts/test1.jpg
2. Leave the filetype as "Text Documents (*.txt)" and set your file name as "weapons.cfg". It is important that you place your filename in between the " ", just like in the image below.
http://www.2createit.nl/images/tuts/test2.jpg
You now have an empty cfg file in which you can place a script. Of course you decide where you save the files.
Celine
04-20-2010, 11:52 AM
/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:
http://www.2createit.nl/images/tuts/execscripts.jpg
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.
http://www.2createit.nl/images/tuts/tilde.jpg
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:
http://www.2createit.nl/images/tuts/execautoexec.jpg
You can now start using your scripts. How to actually make your own scripts is discussed in the following threads.
Celine
04-20-2010, 11:54 AM
Basic tutorial 3
Using more than one cfg file.
Why not only use your autoexec.cfg file? Well there are 2 answers in my opinion:
* The maximum file size and
* Creating clarity and structure in your config.
I'll discuss both!
Maximum file size
The file size of a cfg file cannot exceed 16kb. Since it is no more than a simple text file(, but with another extension), you can add a lot of stuff to it before you reach that maximum.
Clarity and structure
Instead of putting everything in one file it's better if you try to divide all your settings, binds and scripts over different cfg files, instead of putting everything into 1 cfg file. Let's say you put everything into 1 file and after a perioid of time you have produced over 200 lines of code in that file. Wouldn't it be hard to find a certain line of code in all that text? Now if you were searching for a certain script and it was in a seperate cfg file, you would not have a problem finding it.
We talked about creating an autoexec file in the second tutorial and about executing it. All the commands inside will be executed. Now your next question would probably be: "Do I have execute all the scripts in console, like I have to do with the autoexec file, explained in the second tutorial? Well of course all cfg files have to be executed, but not manually in your console. Only your autoexec is executed from your console and all the other cfg files are executed from the autoexec.cfg, also explained in the second tutorial(in the part of using downloaded scripts).
Let me just give you one more simple example. Say you have 3 cfg files:
* settings.cfg
* controls.cfg
* scripts.cfg
You execute these files from your autoexec.cfg with the following lines:
exec settings.cfg
exec controls.cfg
exec scripts.cfg
If you then execute your autoexec.cfg in console, your autoexec will execute the other 3 cfg files. Piece of cake!
Celine
04-20-2010, 11:55 AM
Basic tutorial 4
Binding.
In order to assign a command to a key, you have to bind a key to that command. This is done as followed:
bind key "command"
For example:
bind x "vsay hi"
The binded key in this example is x and the command is vsay hi (We will discuss the vsay command later in tutorial 5). Now if you would press x in the game, you would say hi.
The quotation marks(" ") are only obligatory if you use multiple commands for 1 bind. So this would also do:
bind key command
If you start binding more than 1 command to 1 key, then it has to be:
bind key "command1; command2"
As you can see all commands are seperated by a semicolon( ; ).
This is how you bind a key. In the following threads we will discuss all the things you can actually bind to a key.
Celine
04-20-2010, 11:58 AM
Basic tutorial 5
The say and vsay commands.
In the game of Enemy Territory there are 2 types of chats: say and vsay. Let's discuss them both.
say
The say command is nothing but an ordinary chat. Just like when you type a line of text to say to your friends in the chat area. For example, when you enter your favorite server you might wanna say something like: "Hello everyone!". Instead of typing that every time you enter the server, you could bind a key to that say command.
Let's say you want to use x as your key for this bind, it would look like this:
bind x "say Hello everyone!"
Now every time you press x, you will say "Hello everyone!" in the chatarea.
So when binding a say, you first type the command say followed by what you want to appear in the chatarea.
vsay
There are also recorded voice messages in ET. These are accessible through the vsay menu when you press v. With this menu you can say things like: hi, bye, thank you, you're welcome, etc. These vsay messages can also be binded to a key. In the previous tutorials I gave you the following example:
bind x "vsay hi"
When pressing x you would hear the recorded voice message hi. So when binding a vsay, you first type the command vsay followed by the command for the voice message you want to hear. Of course you have to know what the commands are for these voice messages. So here is the list with all the possible vsay commands. This list first states the voice chat you would hear and behind the - what the command is for this voice chat:
1.Statements
Path cleared. - PathCleared
The enemy is weakened. - EnemyWeak
All clear. - AllClear
Incoming! - Incoming
Fire in the hole! - FireInTheHole
I'm defending. - OnDefense
I'm attacking. - OnOffense
Taking fire! - TakingFire
Mines cleared. - MinesCleared
Enemy in disguise. - EnemyDisguised
2. Requests
Medic! - Medic
I need ammo! - NeedAmmo
I need backup! - NeedBackup
We need an engineer! - NeedEngineer
Cover me! - CoverMe
Hold fire! - HoldFire
Where to? - WhereTo
We need Covert Ops! - NeedOps
3. Commands
Follow me! - FollowMe
Let's go! - LetsGo
Move! - Move
Clear the path! - ClearPath
Defend our objective! - DefendObjective
Disarm the dynamite! - DisarmDynamite
Clear the mines! - ClearMines
Reinforce the offense! - ReinforceOffense
Reinforce the defense! - ReinforceDefense
4. Talk
Yes! - Affirmative
No! - Negative
Thanks a lot! - Thanks
You're welcome. - Welcome
Sorry! - Sorry
Oops! - Oops
5. Global
The enemy is weakened. - EnemyWeak
Hi! - Hi
Bye. - Bye
Great shot! - GreatShot
Yeah! - Cheer
Hold your fire! - HoldFire
Good game! - GoodGame
6. Function
I'm a soldier. - IamSoldier
I'm a medic. - IamMedic
I'm an engineer. - IamEngineer
I'm a field ops. - IamFieldOps
I'm a covert ops. - IamCovertOps
7. Objectives
Command acknowledged! - CommandAcknowledged
Command declined! - CommandDeclined
Command completed! - CommandCompleted
Destroy the primary objective! - DestroyPrimary
Destroy the secondary objective! - DestroySecondary
Destroy the construction! - DestroyConstruction
Construction underway! - ConstructionCommencing
Repair the vehicle! - RepairVehicle
Destroy the vehicle! - DestroyVehicle
Escort the vehicle! - EscortVehicle
8. Fire team chats
Attack! - FTAttack
Fall back! - FTFallBack
Cover me! - FTCoverMe
Disarm the dynamite! - FTDisarmDynamite
Fall back! - FTFallBack
Soldier, covering fire! - FTCoveringFire
Deploy mortar! - FTMortar
Heal the squad! - FTHealSquad
Heal me! - FTHealMe (will show a medic icon over head)
Revive team mate! - FTReviveTeamMate
Revive me! - FTReviveMe (will show a medic icon over head)
Destroy objective! - FTDestroyObjective
Repair objective! - FTRepairObjective
Construct the objective! - FTConstructObjective
Deploy landmines! - FTDeployLandmines
Disarm landmines! - FTDisarmLandmines
Call airstrike! - FTCallAirStrike
Call artillery! - FTCallArtillery
Resupply squad! - FTResupplySquad
Resupply me! - FTResupplyMe (will show a ammo icon over head)
Explore area! - FTExploreArea
Check for land mines! - FTCheckLandMines
Destroy satchel objective! - FTSatchelObjective (same file as FTDestroyObjective)
Infiltrate! - FTInfiltrate
Go undercover! - FTGoUndercover
Provide sniper cover! - FTProvideSniperCover
So one more example. If yu would like to bind x to the vsay Command Acknowledged!, the you bind it as followed:
bind x "vsay CommandAcknowledged"
Teamchat
The say and vsay command are global chats and will be seen/heard by everyone. In some cases you might not want your enemy to see/hear something. This can be avoided by adding _team to your say or vsay command. So the following examples will only be seen/heard by your team:
bind x "vsay_team NeedAmmo"
bind y "say_team The enemy is coming! Fall back!"
Celine
04-20-2010, 12:02 PM
Using colours for your name and binded chats.
The most common use for colours is to make your gaming name and your binded chats look better. Why say "Hi everyone!", when you can say "Hi Everyone!".
Colour codes
Colours are made with colour codes. A colour code consists of a ^ followed by a letter or number. Each letter or number represents a certain colour. In the following images you can see the number/letter with their corresponding colours:
http://www.2createit.nl/images/tuts/colours.png
Binded chats
Let's get back to the example in the previous thread, where we made a bind to say "Hi everyone!". Now let's make that bind again, but in blue text. The colour code for blue is ^4, so the bind has to be:
bind x "say ^4Hi everyone!"
So everything that follows the ^4 will appear in blue.
Name
When we started of playing the game, most of us started with a white name. Your name can easily be changed in the menu, when pressing escape. The only drawback is that you cannot add colours to your name this way. There are 2 other ways in setting your name: using the console and placing it in one of your cfg files e.g. your autoexec.cfg.
Console
In the second tutorial I explained how to pull down your console. In your console you can also type single commands you want to execute e.g. setting your name. Important to know is that all commands you type in console have to be preceded by a forward slash(/) and always an ENTER after entering a command! The command for setting your name is of course name. So changing your name in console is done as followed:
/name YourName
Let's say you would like to change your name to:
*NoobZor
In there we use blue (^4) and red (^1). Our command in console would have to be:
/name ^1*^4N^1oob^4Z^1or
In a cfg file
As I will explain more elaborately later on, it is useful to store all your settings (including your name) in a cfg file. Let's say you would like to add your name to your autoexec.cfg. In the second tutorial we discussed how to create it. Now we are going to add our name to it. So start by opening your autoexec.cfg.
In general if you want to store a setting in your cfg file, the command should look like this:
set setting value
So if you want to store your name in your autoexec file, it should be like this:
set name ^1*^4N^1oob^4Z^1or
I will talk about different settings, also known as cvars, later on. Another example of a setting is the sensitivity of your mouse. Let's just say you would like to set your sensitivity to the value 1. Then the following command should be in your autoexec file:
set sensitivity 1
In your autoexec the 2 examples above look like this:
http://www.2createit.nl/images/tuts/settings.jpg
If you want to try and see what your name looks in certain colours, you can try Easyrider's Nickname Generator at www.enemy-territory.com. If you have tried and found the perfect name, you can easily copy and paste the code to your cfg file.
One more important note. As you can see in any cfg file commands are not preceded by a forward slash(/). That's only when you enter commands in your console.
Celine
04-20-2010, 12:04 PM
Variables (vstr).
Before you can actually start scripting you have to know how to use variables. In scripting we use variables to store information in, so that when we call that variable, we access the information stored in that variable. So logically we have to store something in a variable, before we can use it. We store something in a variable by using the set command as followed:
set VariableName "command1; command2; ..."
The only thing the code above does is store the commands in that variable. This means the commands are not yet executed. You execute them by calling the variable using the vstr command, which is done as followed:
vstr VariableName
Now all the commands in that variable will be executed.
You also bind the calling of a variable to a key:
bind x "vstr VariableName"
Important note: mind the caps in your variable name. Case sensitive!
Let's do an example. In the previous tutorial we discussed how to set your name. Let's try to do that by first storing it in a variable. I'm going to call that variable myName. Here goes:
set myName "name ^1*^4N^1oob^4Z^1or"
bind x "vstr myName"
So now my name will not be changed into *NoobZor until I press x. This construction might not make any sense at this point, cause this could have also been done by 1 line of code, not using the variable construction at all:
bind x "name ^1*^4N^1oob^4Z^1or"
This does exactly the same, but the variable construction is important for when we want to make a toggle, which is nothing more than a loop. In this loop we can rotate between multiple variables. The toggle will be explained in the eighth tutorial.
Celine
04-20-2010, 12:05 PM
Key pressed down scripts (+vstr).
For scripts that require an action when a key is kept pressed down we use the +vstr command. Let me first show you how to use this command properly. Binding a key to a +vstr command should look like this:
bind key "+vstr var1 var2"
As you can see you need 2 variables, one for each situation: when the key is pressed down and when the key is not pressed down. Var1 should state what should happen when the key is pressed down and var2 should state what should happen when the key is not pressed down. So you will also have to state the actions set to these 2 variables, as talked about in the seventh tutorial. In total it should look like this:
bind key "+vstr var1 var2"
set var1 "command1, command2, ..."
set var2 "command1, command2, ..."
Let's clarify this with an example. One of the most requested scripts is the sprint while shooting script. This script automatically makes you sprint while you are shooting. A perfect example of a key pressed down script, cause you are firing your gun as long as you keep your mouse1 (left mouse button) pressed down.
You need to use 2 cvars to make this script work. The first is +attack and the second is +sprint. Of course these are the commands to enable firing your gun and sprinting. These again have 2 cvars to disable these actions: -attack and -sprint. When you keep mouse1 pressed down, you want to enable sprinting and firing your gun and of course when you let go of mouse1, you want to disable firing your gun and sprinting. This would result in the following script:
bind mouse1 "+vstr shootOn shootOff"
set shootOn "+attack; +sprint"
set shootOff "-attack; -sprint"
In theory this script should work, but in practice you will find out that it sometimes does not. It could keep on firing when you let go of mouse1. That's why you should always use the disable commands twice, like this:
bind mouse1 "+vstr shootOn shootOff"
set shootOn "+attack; +sprint"
set shootOff "-attack; -attack; -sprint; -sprint"
This way you make sure the disable commands always work.
Note: Again it does not matter what names you choose for the 2 variables. Just use specific names that make sense to you.
Celine
04-20-2010, 12:06 PM
Advanced tutorial 1
Two commands under one key.
I often hear a lot of people complaining about having so many binds, but they still want to add more. Well you can. You'll need to know how to use the +vstr command explained in the tenth tutorial of the basic scripting tutorial section.
Let's say you have 6 basic vsay commands in your config at this moment:
bind 1 "vsay hi"
bind 2 "vsay bye"
bind 3 "vsay sorry"
bind 4 "vsay Affirmative"
bind 5 "vsay Negative"
bind 6 "vsay Oops"
These are all global chats and thus heard by everyone. Maybe you sometimes want use these for your team only. If you have a lot of scripts and binds, you might not even have another 6 keys left. You actually only need 1 extra, so we can make a key combination. Just like being able to cut text in Word with CTRL + x.
For this example I'll use CTRL as that extra key. So we want to create a script that makes it possible to use the 6 binds in combination with CTRL and make the binds teams vsays instead of vsays. My way of doing this is the easiest imo, but not the only way.
First we start of by placing the vsays above in a seperate cfg file. Let's call it vsay.cfg. We also place all the team vsays in a seperate cfg file. We will call that vsayteam.cfg. So we now have 2 files with the following content:
vsay.cfg
bind 1 "vsay hi"
bind 2 "vsay bye"
bind 3 "vsay sorry"
bind 4 "vsay Affirmative"
bind 5 "vsay Negative"
bind 6 "vsay Oops"
vsayteam.cfg
bind 1 "vsay hi"
bind 2 "vsay_team bye"
bind 3 "vsay_team sorry"
bind 4 "vsay_team Affirmative"
bind 5 "vsay_team Negative"
bind 6 "vsay_team Oops"
Now we have to make the script to activate these cfg files. We want vsay.cfg to be activated when CTRL is NOT pressed down and we want vsayteam.cfg to be activated when CTRL is pressed down. So we have to bind CTRL to a +vstr command. This little script can either be placed in your autoexec.cfg or in a seperate cfg file which you of course then exec from your autoexec file as well. This script is as followed:
bind CTRL "+vstr ctrldown ctrlup"
set ctrldown "exec vsayteam.cfg"
set ctrlup "exec vsay.cfg"
So now when you keep CTRL pressed down, the vsayteam.cfg file is executed and thus all binds in that cfg are activated. If you let go of CTRL again, vsay.cfg will be executed and thus all binds in vsay.cfg will be activated. That's all there is to it.
Post your own tutorials now, how did you start making your own config and remember: :signs_worthlesswith
GEEKJR
04-20-2010, 09:17 PM
You have too much time on your hands....lol
vBulletin® v3.7.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.