Scripting Faq

From TF2 Wiki

Jump to: navigation, search

Contents

Global Script Questions

HUD On/Off

Posted by Bolange
  • Q. Is there anyway to turn the HUD on or off for use in a script?
  • A. cl_hud_minmode set to "1" will give you a minimalist HUD view, you can also set this by going to your Options->Multiplayer. If you want to completely remove all HUD items though, you can use the commands cl_drawhud 0 to remove the HUD and r_drawviewmodel 0 to remove the gun (useful for screenshots), but Valve seem to have now classed these commands as cheats so they can only be used when sv_cheats is set to "1" --Aurora 01:00, 22 November 2007 (BST)

Reloading .cfg without closing the game?

Posted by Jabu2oz
  • Q. Is there a way of "refeshing" a .cfg file (e.g. autoexec.cfg) without closing/reopening TF2? This would be useful when trying out scripts. (NB, I have tried "exec autoexec" from the console (and restarting the server) but this didn't seem to work).

Edit: Thanks, "exec autoexec.cfg" worked, but I did have to start a server without commentary mode on (single player). --Jabu2oz 15:10, 19 December 2007 (CST)

  • A. Did you try "exec autoexec.cfg" from the console? You need to give it the full file name if memory serves. If you're working with a server, some settings require a map change to take effect (sv_pure comes to mind here). -- WanderingFox (Talk • Contribs) 15:15, 18 December 2007 (CST)

Class Specific Script Questions

Multiple Key Binds

Posted by Bolange
  • Q. Is it possible to make a variable to use the same key with multiple bindings depending on the class you are? e.g. In spy, press F1 to disguise in scout, in engineer, press F1 to build a sentry etc...
  • A. Yes, however you will need to create separate scripts for each class, i.e. spy.cfg and engi.cfg and put the binds in these, see the Class Config Community Scripts for more information. --Aurora 14:10, 21 November 2007 (BST)

CTF Getting -or not- Intelligence as Spy

Posted by Xerox
  • Q. Is there a way to bind a command for not to take enemies intelligence when you're in spy, unless you press a key? You might need it if a sentry is very near the case and you want to sap it first.

Personal tools