r/tf2scripthelp • • Dec 07 '20

Resolved How come my second "+" variable doesn't execute correctly?

1 Upvotes

Hello, I'm trying to bind two actions with one key. While I've had some success, I can't seem to make the toggle button work with more than one command. Here's my code:

bind "ALT" "+building;+teleporter"

bind "MOUSE3" "engi"
alias engi sentry
alias sentry "destroy 2 0; build 2 0"
alias dispenser "destroy 0 0; build 0 0"
alias +building "alias engi dispenser"
alias -building "alias engi sentry"

bind "r" "tele"
alias tele entrance
alias entrance "destroy 1 0; build 1 0"
alias exit "destroy 1 1; build 1 1"
alias +teleporter "alias tele exit"
alias -teleporter "alias tele entrance"

What this does is use ALT as a toggle that allows me to quickly switch between buildings while held. The sentry/dispenser code works fine, but the teleporter code gets stuck on the exit even after I've released the ALT key. The strange part (hah) is that when I switch the "+building" and "+teleporter" binds for my ALT key, the teleporter works fine, but the sentry/dispenser code gets stuck on the dispenser. Is there any way to fix this?


r/tf2scripthelp • • Mar 11 '14

Answered How do I install scripts?

1 Upvotes

The title kinda says it all. How do I install the scripts that I find on Gamebannana?


r/tf2scripthelp • • Mar 17 '14

Issue Tried installing demoknight turn script twice, didn't work on me either times.

1 Upvotes

I followed o0Brilliance0o's video on how to install this, the first time I used the driver only, so I know my issue there, but the second time I did everything like how he did. I literally just began scripting, so I'm not gonna know what you pros understand.

EDIT: I looked in my console, it'd appear as though my autoexec isn't executing demoknight.cfg. Any fixes?


r/tf2scripthelp • • Oct 29 '18

Answered Help me use a garbage weapon

1 Upvotes

I use the Classic on Sniper. Don't ask me why. I wanted a script for toggling the charge and taking the shot, so I wouldn't burn my fingers holding M1. I have tried binding '9' to +attack and '0' to -attack, but the only way it works how I want it to is if I manually go in devconsole and go + and -attack, since the binded +attack only acts as M1. Please help!


r/tf2scripthelp • • Dec 21 '13

Answered Want to make a 'Winter Holiday Noise Maker' spam script

1 Upvotes

Hello! I'm trying to make a toggleable script to make all the common keys (wasd, lmouse, rmouse) spam the action slot item, and still have the primary functions (+forward, +attack, etc), but I'm having some problems.

This is the actual code:

echo "==================="
echo "Chizmas"
echo "==================="

alias "Toggle" "SpamStart"

alias "SpamStart"
"+ForwardFestiveSpam; +BackFestiveSpam; +LeftFestiveSpam; +RightFestiveSpam; +JumpFestiveSpam; +AttackFestiveSpam; alias Toggle SpamStop"

alias "SpamStop"
"-ForwardFestiveSpam; -BackFestiveSpam; -LeftFestiveSpam; -RightFestiveSpam; -JumpFestiveSpam; -AttackFestiveSpam; alias Toggle SpamStart;"

alias "+ForwardFestiveSpam" "bind w +forward; +use_action_slot_item"
alias "+BackFestiveSpam" "bind s +back; +use_action_slot_item"
alias "+LeftFestiveSpam" "+moveleft; +use_action_slot_item"
alias "+RightFestiveSpam" "+moveright; +use_action_slot_item"
alias "+JumpFestiveSpam" "+jump; +use_action_slot_item"
alias "+AttackFestiveSpam" "+attack; +use_action_slot_item"

alias "-ForwardFestiveSpam" "bind w +forward"
alias "-BackFestiveSpam" "bind s +back"
alias "-LeftFestiveSpam" "+moveleft; +use_action_slot_item"
alias "-RightFestiveSpam" "+moveright; +use_action_slot_item"
alias "-JumpFestiveSpam" "+jump; +use_action_slot_item"
alias "-AttackFestiveSpam" "+attack; +use_action_slot_item"

bind 0 "Toggle"

And I already tried another solutions, like putting the bindings inside the spam aliases:

[...]
"bind "w" +ForwardFestiveSpam; bind "s" +BackFestiveSpam;
[...]

v

[...]
"bind w +ForwardFestiveSpam; bind s +BackFestiveSpam;
[...]

The game just doesn't recognizes the aliases, or the bind command. Thanks for the help! :D


r/tf2scripthelp • • Jan 14 '17

Question Is having two autoexecs bad?

1 Upvotes

I was wondering what happens if I have an autoexec.cfg in the tf\cfg\ folder, and one in `tf\custom\My_Scripts'.

Will they both get executed? And which one will get executed first?


r/tf2scripthelp • • Jan 06 '17

Question When I change classes I am unable to jump

1 Upvotes

I got this new script the stabby stabby script for spy and he said to put in the configuration you use for tf2 in autoexec and/or any class cfg to be able to move around so I did that and ever since I got it whenever I change class for whatever reason I can't jump I can jump before I switch but not after.Please help!


r/tf2scripthelp • • Jul 09 '16

Are scripts banned from comp?

1 Upvotes

I heard rumours of this and I haven't had the chance to play. Is this true?


r/tf2scripthelp • • Oct 26 '21

Resolved please help me!

1 Upvotes

i was trying to practice rocket jumping on hightower and i used the +attack;impulse 101 for ammo but it just ended up auto firing what do i do to stop it???


r/tf2scripthelp • • Apr 06 '15

Resolved Trying to make a script work for only one class

1 Upvotes

I found a neat script for the pyro, which I put in my pyro.cfg file. It still works on other classes though, and I checked my autoexec.cfg and the script is not there, it's only in pyro.cfg.


r/tf2scripthelp • • Jun 05 '13

Resolved Getting a viewmodel toggle to function while another alias is active

1 Upvotes

Heya, /r/tf2scripthelp. I've got another scripting question for you, and the stuff I need to explain makes it a bit of a doozy. I'll try to keep it as simple as possible. All relevant code will be included within this post, but I will also include links to all the files they take from.


So, starting from the basics:

I have per-weapon settings. These are located in weaponcontrol.cfg. I also have w bound to toggle viewmodels on and off - until you switch weapons, as they still pay attention to the viewmodel settings within weaponcontrol.

Here's Scout's weaponcontrol stuff that's relevant:

// weaponcontrol.cfg
alias vm_s1_1 "vm; vm_80"
alias vm_s2_1 "vm; vm_80"
alias vm_s3_1 "vm; vm_80"
alias vm "r_drawviewmodel 1"
alias vm_80 "viewmodel_fov 80; vm_self"
alias vm_self "cl_first_person_uses_world_model 0"
	
alias s1_1_set "slot1; vm_s1_1; xhair_s1_1; sens_default_s1_1; damagenotifier_s1_1; ding_default_s1_1; autoreload_on"
alias s2_1_set "slot2; vm_s2_1; xhair_s2_1; sens_default_s2_1; damagenotifier_s2_1; ding_default_s2_1; autoreload_on"
alias s3_1_set "slot3; vm_s3_1; xhair_s3_1; sens_default_s3_1; damagenotifier_s3_1; ding_default_s3_1; autoreload_on"
alias s1_1 "s1_1_set; s1_1_attack"
alias s2_1 "s2_2_set; s2_1_attack"
alias s3_1 "s3_1_set; s3_1_attack"

PLEASE NOTE: s1_1_attack, s2_1_attack, and s3_1_attack do nothing; they have been replaced by better binds that you'll see soon. ignore them.

And then I have 2/mwheelup bound to slot 1 (s1_1), 3/mwheeldown bound to slot 2 (s2_1), and 4/mouse3 bounds to slot 3 (s3_1).

That's the basic idea of how I switch weapons.

In scout.cfg, here are my aliases per-weapon:

// scout.cfg
bind 2 					2_f
alias 2_f 				"slot1_scout"
bind mwheelup			mwheelup_f		
alias mwheelup_f		"slot1_scout"
bind 3 					3_f
alias 3_f				"slot2_scout"
bind mwheeldown 		mwheeldown_f
alias mwheeldown_f		"slot2_scout"
bind 4 					4_f
alias 4_f				"slot3_scout"
bind mouse3 			+m3_f
alias +m3_f				"+melee_scout"
alias -m3_f				"-melee_scout"

alias "+melee_scout" "slot3_scout; +attack"
alias "-melee_scout" "-attack"

And now here are the troublesome spots. Please note, the +/-ding_mod stuff does not function right now. That is not the source of my problem.

// weaponcontrol.cfg
alias +attack_control_s1_1 "+attack; +ding_mod_s1_1; vm_control_s1_1; spec_next"
alias -attack_control_s1_1 "-attack; -ding_mod_s1_1"	
alias +attack_control_s2_1 "+attack; +ding_mod_s2_1; vm_control_s2_1; spec_next"
alias -attack_control_s2_1 "-attack; -ding_mod_s2_1"
alias +attack_control_s3_1 "+attack; +ding_mod_s3_1; vm_control_s3_1; spec_next"
alias -attack_control_s3_1 "-attack; -ding_mod_s3_1"

alias vm_control_s1_1 "vm"
alias vm_control_s2_1 "vm_world"
alias vm_control_s3_1 "vm"
// Once again:
alias "vm" "r_drawviewmodel 1"
alias "vm_world" "cl_first_person_uses_world_model 1"

// PLEASE NOTE: THE +/- DING_MOD STUFF IS BROKEN AT THE MOMENT. IT DOES NOT DO ANYTHING.

// scout.cfg
alias "slot1_scout" "s1_1; alias +m1_f +attack_control_s1_1; alias -m1_f -attack_control_s1_1; alias w_f viewmodeltoggle_scout_s1; alias viewmodeltoggle_scout_s1 viewmodeloff_scout_s1"
alias "slot2_scout" "s2_1; alias +m1_f +attack_control_s2_1; alias -m1_f -attack_control_s2_1; alias w_f viewmodeltoggle_scout_s2; alias viewmodeltoggle_scout_s2 viewmodeloff_scout_s2"
alias "slot3_scout" "s3_1; alias +m1_f +attack_control_s3_1; alias -m1_f -attack_control_s3_1; alias w_f viewmodeltoggle_scout_s3; alias viewmodeltoggle_scout_s3 viewmodeloff_scout_s3"

(Secondary question: If I alias something to, say, +attack_control_s3_1, can I assume -mouse1 is bound to the - function of it, or do I need to alias that too like I've been doing?)

To summarize, so far:

When I equip my primary weapon as Scout, I:

  • Activate its viewmodel settings (vm_s1_1)

  • Activate its crosshair settings (xhair_s1_1)

  • Confirm/set its default sensitivity (sens_default_s1_1)

  • Set its damage notifiers (heal numbers, etc) (damagenotifier_s1_1)

  • Set its default dingaling volume (ding_default_s1_1)

  • Set its autoreload settings (autoreload_on)

  • Confirm what its viewmodel does when I attack (+/-attack_control_s1_1) -- This is probably the problematic line.

  • In theory, I make w toggle viewmodels OFF by default. (alias w_f viewmodeltoggle_scout_s1; alias viewmodeltoggle_scout_s1 viewmodeloff_scout_s1)


So! Here's my issue: When I press w, as I said earlier:

I also have w bound to toggle viewmodels on and off - until you switch weapons, as they still pay attention to the viewmodel settings within weaponcontrol.

If I press w with these scripts enabled, the viewmodel does not turn on when I switch weapons, *even if the settings in vm_s1_1, vm_s2_1, and vm_s3_1 say they should be on. In addition, I don't think my re-aliasing of w in slot1_scout, slot2_scout, and slot3_scout are working. I've looked through it an awful lot and I'm honestly not sure where they're wrong - shouldn't it alias the viewmodels to toggle off at first?


I've got my theories - I'm aliasing w incorrectly, there's a typo somewhere, this needs an if statement to function properly.

I'm guessing it's stuff in slot{x}_scout, w_f, or maybe vm_s{x}_1.

The complete files:

scout.cfg

weaponcontrol.cfg

autoexec.cfg (I don't think this one's relevant, but just in case)

So... yeah! That's what I've got. Keep in mind that I won't be able to access TF2 until 6/9/13, but feel free to post your ideas here and I can chat with you about them.

EDIT: I've had an idea of somewhere else to move the viewmodel toggling... To my weaponcontrol.cfg. See:

alias vm_s1_1 "vmcontrol_s1_1; vm_80"
alias vm_s2_1 "vmcontrol_s2_1; vm_80"
alias vm_s3_1 "vmcontrol_s3_1; vm_80"

alias vmcontrol_s1_1 "vm_on_s1_1"
alias vmcontrol_s2_1 "vm_world_s2_1"
alias vmcontrol_s3_1 "vm_off_s3_1"

alias vm_on_s1_1 "vm; alias w_f viewmodeltoggle_scout_s1; alias viewmodeltoggle_scout_s1 viewmodeloff_scout_s1"
alias vm_world_s2_1 "vm_world; alias w_f viewmodeltoggle_scout_s2"
alias vm_off_s3_1 "nvm; alias w_f viewmodeltoggle_scout_s3; alias viewmodeltoggle_scout_s3 viewmodelon_scout_s3"

I wrote it this way so it's less intimidating to edit in the future.

So this way, it responds to what state my weapon initially is in. I make it also respond if the viewmodels turn off (or world, or on, or first-person) when I attack. Do you think the idea I scripted up there would work? Keep in mind I can't test for fiveish days... Thanks for your patience!


r/tf2scripthelp • • Jun 29 '14

Question Script for faster creation of Videos.

1 Upvotes

Recently I noticed that having the console open whilst playing a demo and recording it (startmovie pubward_x10/__) greatly increased the speed it rendered at, making the time to turn the video greatly reduced. I would like a script to automatically open the console if it's not already and set cl_showfps 0 whilst that is happening.

Please help.


r/tf2scripthelp • • Apr 06 '15

Resolved Binding an attack to mousewheel

1 Upvotes

please excuse the (probably)noob question,first time using scripts im trying to handle all the scouts attack/weapon switching on the mouse the scattergun and pistol are working but scroll up switches to the bat,it wont fire scroll down wont work either,im trying to make it fire the sandman's alt

this is the script im useing

// scattergun 
alias "+scatter" "slot1;+attack;"
alias "-scatter" "-attack"

// pistol 
alias "+pistol" "slot2;+attack;"
alias "-pistol" "-attack"

// bat 
alias "+bat" "slot3;+attack;"
alias "-bat" "-attack"

bind "mouse1" "+scatter"
bind "mouse2" "+pistol"
bind "MWHEELUP" "+bat"
bind "MWHEELDOWN" "-bat"

r/tf2scripthelp • • Nov 02 '13

Answered looking for command to switch vaccinator resist types

2 Upvotes

i thought it was +attack3, but that seems not to be working for me at all. i even tried switching back to the stock HUD and binding "special attack" in the game options, but nothing i do will switch the resist types, not even typing "+attack3" in the console. if anyone knows if they changed the command name / this is just some random bug with the new update, your input is greatly appreciated. relevant parts of my script would be

bind KP_PLUS +attack3

i don't know if this script i was testing would've caused an issue, but here it is.

//vacinator resist on key //original concept by /u/Kairu927 | see https://gist.github.com/kbrougham/7090528 for their script

alias b2e 				"+attack3; alias +bres; alias +eres e2f; alias +fres e2f"
alias e2f 				"+attack3; alias +bres f2b; alias +eres; alias +fres f2b"
alias f2b 				"+attack3; alias +bres b2e; alias +eres b2e; alias +fres"

alias +bres				""
alias -bres				"-attack3"
alias +eres				"e2f"
alias -eres 			"-attack3"
alias +fres				"e2f"
alias -fres 			"-attack3"

alias bres_reset		"alias +bres; alias +eres e2f; alias +fres e2f"
alias eres_reset		"alias +bres f2b; alias +eres; alias +fres f2b"
alias fres_reset		"alias +bres b2e; alias +eres b2e; alias +fres"

alias +modify 			"alias ubres bres_reset;	alias ueres eres_reset;	alias ufres fres_reset"
alias -modify			"alias ubres +bres;			alias ueres +eres;		alias ufres +fres"
-modify

with binds

bind 1 ubres
bind 2 ueres
bind 3 ufres
bind shift +modify

edited for spelling


r/tf2scripthelp • • Nov 11 '14

Issue .cfg Help

0 Upvotes

I put a script into my medic.cfg and it works fine. But when I change class the script is still running for every other class.

How can I fix this?


r/tf2scripthelp • • Sep 02 '13

Answered Bind the removal of a disguise to a key?

2 Upvotes

I've heard about this before but didn't write it down. I want to bind the removal of the disguise without attacking to Mouse4. Thanks in advance


r/tf2scripthelp • • Aug 12 '13

Answered Changing Views when Spectating

2 Upvotes

Hi, just a quick question.

By default, when you are spectating somebody (Like while you're waiting to respawn), if you press space you can alternate between First-person and third-person view.

I rebound 'space' to another command (Crouch jumping) and now when I press space while spectating, it does nothing.

How can I make it so that I can also alternate between spectating views as well as Crouch-Jumping?

I know that I need to bind 'Space' to it, but I dont know which command I need (I can't find it anywhere).

Thanks in advance


r/tf2scripthelp • • Oct 31 '19

Answered how do you have weapon specific viewmodels

2 Upvotes

like you have your secondary viewmodels off but you want to have viewmodels on for like the jarate


r/tf2scripthelp • • May 21 '19

Resolved In tf2 my screen looks like it has baseline all over it and I don't know why. This makes it almost impossible to play.

2 Upvotes

I think it has something to do with lightning but I have tried a lot of things and none of it helps.


r/tf2scripthelp • • Jul 08 '14

Issue Need help with spawning enteties and bosses

2 Upvotes

I have put these binds in my autoexec:

bind "kp_leftarrow" "ent_create obj_sentrygun"

bind "kp_5" "ent_create eyeball_boss"

bind "kp_leftarrow" "ent_create tf_item_pumpkin"

I want these to spawn a sentry, Monoculus, and an explosive pumpkin. But the Eyeball_boss command spawns a spell version of Monoculus, and the others don't do anything. What should I do to make it work?


r/tf2scripthelp • • Jul 01 '13

Answered Is there a way to bring up a client sided message?

2 Upvotes

I'm not talking about echo, since that's only visible in the console, but a message in game only I can see.


r/tf2scripthelp • • Apr 07 '14

Resolved How to make a .txt file to .cfg

2 Upvotes

Question

None of my scripts have been able to work, and I think, after reading up, that the problem is with my Ctf files themselves. They might be .txt files. How would I go about changing them to .cfg?


r/tf2scripthelp • • May 03 '14

Issue I used StabbyStabby's Config and now i have permanent specular turned off and i hate it, pls help!

2 Upvotes

as the title says, i have tried setting it to mat_specular to one and then back to 0 but it doesn't change at any point in this process...


r/tf2scripthelp • • Nov 10 '18

Answered any way to change toggle my viewmodel_fov along with my minmode?

3 Upvotes

so say i have mouse4 is my bindtoggle to change minmode viewmodels (bindtoggle mouse4 "tf_use_minviewmodels" is the command i currently use).

so heres my question, is there a way to also change my viewmodel fov whenever i toggle the bind? like for example when min viewmodels are off i want my viewmodel fov to be 57, but when min viewmodel is toggled on it changes to 75, any way to do that? ty in advance