Day of Defeat: Source Guide

Day of Defeat: Source Scripting for Day of Defeat: Source

Day of Defeat: Source Scripting

Overview

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:…steamsteamapps%youraccountname%Day of Defeat Sourcedodcfg%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.cfgThen to execute cfg only you have to do is type in game console exec configname.cfg.Let´s go.BindingBinding is assigning commands to keys. Code:bind “key” “command”If you want assing more than one command use ;Code:bind “key” “command; command; command”ExampleBind a key for jumping:bind “key” “jump”Bind a key for sprinting:bind “key” “+jump”IncrementvarThat 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″AliasingAlias 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 oneExample: 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 – commandslus 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 commandsBasic 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” SprintVoice commandsArea clear! – voice_areaclearCease fire! – voice_ceasefireDisplace – voice_displaceDrop your weapons! – voice_dropweaponsEnemy behind us! – voice_enemybehindFire in the Hole – voice_fireinholeFlank left! – voice_leftFlank right! – voice_right Get a grenade in there! – voice_usegrensGo, go, go! – voice_gogogoGrenade, take cover! – voice_grenadeHold this position! – voice_holdI need ammo! – voice_needammo I need backup! – voice_backupIncoming fire, left flank! – voice_fireleftIncoming fire, right flank! – voice_firerightMG position ahead! – voice_mgheadNegative! – voice_negativeNice shot! – voice_niceshotPanzerschreck(Bazooka)! – voice_bazookaspotted Prepare for assault! – voice_attackSmoke ’em! – voice_usesmokeSniper! – voice_sniperSquad, covering fire! – voice_coverStick together! – voice_sticktogetherThanks – voice_thanksUse the Bazooka(Panzerschreck)! – voice_usebazookaWe need an MG up here! – voice_moveupmgYes Sir! – voice_yessirDemo commandsNote: Shift+F2 brings demouiCode:”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 recordingMisc 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

SteamSolo.com