x
ETF2L is looking for new Staff to recruit! Are you interested in supporting the league? Then click here for more details on what we can offer and how to apply! 

Forum

4's Script Setup/Collection

Created 2nd June 2013 @ 13:09

Add A Reply Pages: 1

four

(copied from http://teamfortress.tv/forum/thread/8863)

Since I’ve a kinda advanced script setup I decided to post here what I scripted and what I does.

Zoom with viewmodel enable/disable
Normally if you write a zoom script like this it would simply change the value of r_drawviewmodel which wouldn’t allow you to turn fully viewmodels off because unzooming would reset them. So I wrote this alternative.

-------------------------
//Use viewmOn and viewmOff instead of r_drawviewmodel 1/0
//Use viewmT to toggle between both
alias viewmOn "alias viewmT viewmOff; alias viewmA r_drawviewmodel 1; viewmA"
alias viewmOff "alias viewmT viewmOn; alias viewmA r_drawviewmodel 0; viewmA"
alias viewmT "viewmOff;"
alias viewmA "r_drawviewmodel 1;"

//This is the zoom command + bind
alias +zoomt "fov_desired 70; r_drawviewmodel 0;"
alias -zoomt "fov_desired 90; viewmA;"
bind SHIFT "+zoomt"
-------------------------

Advanced weapon switch
I was annoyed that I always had to select the weapons in a specific order so I could select the right one with Q. I decided that always having that in mind keeps your attention away from the game for no reason so I wrote this to get an easier weapon switch. Put this into every classes’s file or into clear.cfg if you use the class specific scripts toggle.

Pressing F will select slot 1. If slot 1 is already selected then slot 2.
Pressing E will select slot 3. If slot 3 is already selected then slot 2.

-------------------------
alias mw "mw2"
alias mw1 "alias mw mw2; slot1;"
alias mw2 "alias mw mw1; slot2;"

bind F "mw" //TF2 default would be Q but I like this one more
bind E "mw2; slot3" //normally 3 or something
//I bound Q to saying medic
-------------------------

With this script I don’t even use the Mouse wheel anymore.

Advanced weapon switch (Spy)
On spy F will switch between slot1/slot3 instead of slot1 and slot2 and will disable viewmodels in slot 1. E will select the knife and holding MOUSE5 saps.

-------------------------
alias mw "mw2"
alias mw1 "alias mw mw2; slot1; viewmOff;"
alias mw2 "alias mw mw1; slot3; viewmOn;"
//Using viewmOff/viewmOn makes it fully compatible with the zoom script and will not reset viewmodels in slot1!
//If you don't want the viewmodel script above use r_drawviewmodel

alias +sap "slot2; +attack"
alias -sap "-attack; mw; mw;"

bind F "mw"
bind E "mw2"
bind MOUSE5 "+sap" //saps while holding this button
-------------------------

Change disguises selected weapon
This probably already exists a couple times but I’ll post it anyways. It relies on the advanced weapon switch script.

-------------------------
bind 1 "+redis1"
bind 2 "+redis2"
bind 3 "+redis3"

alias +redis1 "slot1; lastdisguise;"
alias +redis2 "slot2; lastdisguise;"
alias +redis3 "slot3; lastdisguise;"
alias -redis1 "mw; mw;"
alias -redis2 "mw; mw;"
alias -redis3 "mw; mw;"
-------------------------

Class specific scripts toggle
I don’t want my spy script to work on Randomizer servers. This is more of a setup than a single script. It allows you to toggle between executing class specific files or not.

So I put this in autoexec.cfg
-------------------------
alias adv "advOn"
alias advOn ""
alias advOff ""
alias advTOn "alias advT advTOff; alias adv advOn; setClass" //this enables scripts
alias advTOff "alias advT advTOn; alias adv advOff; setClass"//this disables scripts
alias advT "advTOff" //this toggles scripts
-------------------------

For the next step I recommend to use 4Script and batch add this to every class file:
-------------------------
alias setClass "exec {name}"
exec clear
alias advOn "exec {name}_adv"
adv
-------------------------

You can also add this to every file with the class name insted of {name} but it’s easier with 4Script. Then create a file called classname_adv.cfg and put the class specific code in there like this: http://puu.sh/35Uhd.png

You don’t need to create a class_adv.cfg if you don’t need it. You can also put the class specific code into advOn alias of the class.
You can bind “bind 7 “advT”” to switch between both.

I hope these scripts can help you, cheers :3


Last edited by four,

SHIN

neat

Add A Reply Pages: 1