Day of Defeat: Source

Day of Defeat: Source

36 ratings
Day of Defeat: Source Scripting
By fuchu is old!
Hi all, this guide helps you to understand how create and manage dod:s scripts.
For editing or create cfg files I recommend Notepad for example.
To use your own cfg files, you must put files in next location:
...\steam\steamapps\%youraccountname%\Day of Defeat Source\dod\cfg
%youraccountname% is your Steam login.

To save your config as a cfg file when you are saving file pick from file type dropdown All files (*.*), but when you are using this method you need to type

file name and extension. For exapmle myconfig.cfg

Then to execute cfg only you have to do is type in game console exec configname.cfg.

Let´s go.

Binding

Binding is assigning commands to keys.
Code:
bind "key" "command"

If you want assing more than one command use ;
Code:
bind "key" "command; command; command"

Example
Bind a key for jumping:
bind "key" "jump"

Bind a key for sprinting:
bind "key" "+jump"

Incrementvar

That command allows you cycle between specified values on chosen range.
Code:
bind "key" "incrementvar command 1 12 3"
(where 1 and 12 is range and 3 is jump between values).

Example: changeing sensitivy from 1 to 20 by 2.
bind "key" "incrementvar sensitivity 1 20 2"

Aliasing

Alias command allows you to shorten very long commands into one short alias. It could be difficult at the beginning.
Code:
alias nameofyourscript "firstalias"
alias firstalias "command; command; alias nameofyourscript secondalias"
alias secondalias "command; command; alias nameofyourscript thirdalias"
alias thirdalias "command; alias nameofyourscript firstalias" //last alias should point to first one

Example: Duck script. Second example will be a duck script that will allow you to duck without holding a key.
Code:

alias duck "duckON"
alias duckON "+duck; alias duck duckOFF"
alias duckOFF "-duck; alias duck duckON"
bind "key" "duck"


+ and - commands
lus and Minus commands are commands that have 2 states.
Plus part is executed when you press a key and it's execute until key is released. When key is released it goes into minus state.
Example:
Code:

bind "mouse1" "+attack"



You aren't limited to commands that developers created. You can create your own using alias command.
Code:

alias +minigun "+duck; +attack"
alias -minigun "-attack; -duck"
bind "key" "+minigun"

As you probably noticed, there is no need to bind minus command, it's executed automatically after you stop holding key that you bound it to.

Usefull commans:

"wait" Stop command parsing until next frame.(if you put a value ex: wait 30 it will wait 30 frames)
"exec" Executes user config
"bind" Binds command to key (bind "F1" "kill")
"unbind" Unbinds command (unbind "F1")

Console commands

Basic gameplay

"+forward" Move forward
"+back" Move back
"+moveleft" Move left
"+moveright" Move right
"+jump" Jump
"+duck" Duck
"+moveup" Swim up
"+movedown" Swim down
"+attack" Primary attack
"+attack2" Secondary attack
"+reload" Reload weapon
"slot1" Weapon category 1
"slot2" Weapon category 2
"slot3" Weapon category 3
"slot4" Weapon category 4
"slot5" Weapon category 5
"invprev" Previous weapon
"invnext" Next Weapon
"lastinv" Last used weapon
"drop" Drop
"dropammo" Drop muntion
"+alt1" Go prone
"changeteam" Change team menu
"changeclass" Change class menu
"+speed" Sprint


Voice commands

Area clear! - voice_areaclear
Cease fire! - voice_ceasefire
Displace - voice_displace
Drop your weapons! - voice_dropweapons
Enemy behind us! - voice_enemybehind
Fire in the Hole - voice_fireinhole
Flank left! - voice_left
Flank right! - voice_right
Get a grenade in there! - voice_usegrens
Go, go, go! - voice_gogogo
Grenade, take cover! - voice_grenade
Hold this position! - voice_hold
I need ammo! - voice_needammo
I need backup! - voice_backup
Incoming fire, left flank! - voice_fireleft
Incoming fire, right flank! - voice_fireright
MG position ahead! - voice_mghead
Negative! - voice_negative
Nice shot! - voice_niceshot
Panzerschreck(Bazooka)! - voice_bazookaspotted
Prepare for assault! - voice_attack
Smoke 'em! - voice_usesmoke
Sniper! - voice_sniper
Squad, covering fire! - voice_cover
Stick together! - voice_sticktogether
Thanks - voice_thanks
Use the Bazooka(Panzerschreck)! - voice_usebazooka
We need an MG up here! - voice_moveupmg
Yes Sir! - voice_yessir

Demo commands

Note: Shift+F2 brings demoui
Code:

"cl_demoviewoverride" Override player view when you are playing a demo
"demoui" Show hide demo controlling interface
"demoui2" Show hide demo controlling interface(diffrent look than normal one)
"demolist" Show list of demos
"record demoname" Records a demo (replace demoname with name of your demo)
"stop" Stops demo recording

Misc useful commands

"exit" hmm... Closes game?
"kill" Kills yourself
"explode" Kills yourself(you explode)
"hud_fastswitch" Turns fastswitch (0 disables 1 enables 2 disables [consoles style])
"showmapinfo" Shows info about map
"+showscores" Shows scroreboard
"impulse 201" Sprays your logo
"toggleconsole" Opens console
"screenshot" Makes a screenshot (TGA)
"jpeg" Makes a screenshot (JPEG)
"fps_max" Limits your FPS
"mat_bumpmap" Enables/Disables bumpmapping
"mat_compressedtextures" Enables/Disables textures compression
"mat_dxlevel" Sets DirectX level
"mat_specular" Enables/Disables spectacular lighting
"cl_showfps" Shows fps, but not netgraph statistics (upper left)
"mat_picmip" (-10 min., 4 max) - Changes texture quality, -1 = Very High.
"cl_drawhud" Disalbes the hud, useful for taking screenshots.
"hidepanel all" Hides the panels, useful for taking screenshots.
"jpeg_quality" (0-100) - Changes the qualtiy of jpeg screenshots, 90 = default.


Sources:
TF2 Steam Forums by AciD
   
Award
Favorite
Favorited
Unfavorite
8 Comments
bagel monster Apr 17 @ 2:19pm 
how do i refill my grenades? i wanna make lineups and stuff but i don't want to kill myself every time
What's App Aug 24, 2023 @ 12:37am 
this works for all other source games, thanks
ziplap Nov 1, 2021 @ 2:41am 
@._.Frischfleisch scripting is manipulating the game by using vscript files programmed in the Squirrel language.
calm down officer
Viktor06 Jan 15, 2018 @ 2:13pm 
How do i open consle
Julie (Opti) Jan 13, 2018 @ 2:09am 
To add bots to either team;
American Soldier Bots; Bot
German Soldier Bots; Bot team -ger
There ya go.
{|BC|} Divided79 May 31, 2016 @ 11:50am 
Ultimate: "sv_cheats 1; bot"
ultimatehunt Jul 30, 2015 @ 2:54pm 
HOW DO WE ADD BOTS
ZeNix Mar 5, 2015 @ 10:23am 
This is "configuration" not "scripting"
Scripting is something about changing your own 'hitbox' and so on, which is illegal in all games. So if you could change the title to "Day of Defeat: Source Config" or something, it would be great.