Go Back   Steam Users' Forums > Steam Game Discussions > T - Z > Team Fortress 2 > New Users / Training

Reply
Click here to go to the first staff post in this thread.  
Thread Tools Display Modes
Old 02-19-2009, 03:19 PM   #196
Cryzbl
 
Join Date: Jul 2008
Reputation: 572
Posts: 1,757
Nope, you can't get rid of the default message.
Cryzbl is offline   Reply With Quote
Old 02-19-2009, 08:08 PM   #197
pkt-zer0
 
Join Date: Dec 2008
Reputation: 29
Posts: 437
Quote:
Originally Posted by AciD View Post
1# Lets say that we want a name changing script.
//...//
Note: That script does not allow spaces in names, if you want space in your nick look below.
Spaces is names is what I'm trying to do, but looking below (including all the pages of the topic) didn't help. Is a solution not there, or did I just miss it?

I was thinking of turning every problematic alias into a config file of its own, and then just exec-ing them, but that'd be quite messy. Any help?
pkt-zer0 is offline   Reply With Quote
Old 02-19-2009, 09:46 PM   #198
BlazeFireMaster
 
 
 
Join Date: Feb 2009
Reputation: 83
Posts: 1,282
Alright, thank you so much for this. This will help a LOT with spies. I'll post a good script later.

But know I have a question:
Can I "bind" multiple keys to the same thing? I mean, so I can put "bind "1+shift" "disguise 1 2"
or whatever? I want my keys to be on the top of my keys, but I only have 9, and I want them to be used for both teams. I don't have another set of number keys that aren't being used for anything else, and I want them to be easily knowable.
Please help, I'll give you a rep when I can. (I can't right now, but when I can, I will give it to you.)
BlazeFireMaster is offline   Reply With Quote
Old 02-19-2009, 11:34 PM   #199
AciD
 
AciD's Avatar
 
Volunteer Moderator
Join Date: Sep 2007
Reputation: 2278
Posts: 13,873
You cannot bind key combinations like ctrl+alt+1, but you can make an alas that will execute another keyboard configurations when pressed.
AciD is offline   Reply With Quote
Old 02-20-2009, 12:03 AM   #200
BlazeFireMaster
 
 
 
Join Date: Feb 2009
Reputation: 83
Posts: 1,282
Er, ok. Can you help me with that? I mean, I have no idea about the alias command, I looked at the main post, and still don't get it.
BlazeFireMaster is offline   Reply With Quote
Old 02-20-2009, 01:27 AM   #201
Cryzbl
 
Join Date: Jul 2008
Reputation: 572
Posts: 1,757
Does this explain it?

Quote:
Originally Posted by Cryzbl View Post
Alias'es aren't hard. Basically you give a series of commands a single name. Then you can use this name to execute all those commands at once.

Example:
Code:
alias sayspy "voicemenu 0 3; say_team Spy around here!"
Now you can substitute sayspy if you want to execute those 2 commands:
Code:
bind key "sayspy"
With this it's easy to create key combos, say you want 1 to select your primary weapon, but SHIFT+1 makes you change class to scout:
Code:
alias join_scout "join_class scout"

alias +scout_joiner "bind 1 join_scout"
alias -scout_joiner "bind 1 slot1"
bind SHIFT "+scout_joiner"
Ok, that's a whole lot:
First we create an alias that will make us scout, we do this because we can't nest commands that take parameters (Ignore this if you don't understand why it is necessary)

Then we create 2 commands one starting with + and another with the same name but starting with -. When the + variant is bound to a key it will be executed when you press it. Implicitly the - variant will be executed when we release that key! (Yeah, ACID, you mind adding this to the first post? About the + and - commands?)

+scout_joiner rebinds 1 to join scout.
-scout_joiner resets the key 1 so it selects your primary weapon.
By binding +scout_joiner to a key (SHIFT here) whenever you HOLD DOWN SHIFT 1 will NOT select your primary weapon but make you join scout instead.
When you release SHIFT 1 no longer makes you join scout, but selects your primary weapon as normal.

Homework: Create a script that makes SHIFT+number keys join the respective class but pressing the number keys normally changes weapon.

I hope that explains it :P

Also AciD, how do I get unicode characters in a script, I want a name changing script (to toggle my clan tag) but it contains unicode. Tf2 does odd things when encode it in "unicode".
And you forgot to explain how +/- commands/aliases work.

Last edited by Cryzbl: 02-20-2009 at 01:30 AM.
Cryzbl is offline   Reply With Quote
Old 02-20-2009, 08:09 AM   #202
BlazeFireMaster
 
 
 
Join Date: Feb 2009
Reputation: 83
Posts: 1,282
Hm, I'll see if I can get that. Thanks! I'll rep you when I can.

Edit: After trying a bit, it seems I can't get it to do what I want. I need it so it's like

bind +SHIFT, 1, "disguise 1 2"

I know that won't work, it was an example.
Is there really no way to do that? Even with Aliasing?

Last edited by BlazeFireMaster: 02-20-2009 at 08:16 AM.
BlazeFireMaster is offline   Reply With Quote
Old 02-20-2009, 10:30 AM   #203
Cryzbl
 
Join Date: Jul 2008
Reputation: 572
Posts: 1,757
Of course you can and it looks like this:
Code:
alias +key_combo "bind key new_action; ..."
alias -key_combo "bind key default_action; ..."

bind shift "+key_combo"
Whenever you press shift, +key_combo is executed and you temporarily bind the keys you want to do something different. Then you release shift and -key_combo is executed which resets the keybinds to what their normal action.
How +/- aliases work is explained in my post.

In your case:
Code:
alias disguise_scout_red "disguise 1 2"

alias +disguiser "bind 1 disguise_scout_red"
alias -disguiser "bind 1 slot1"

bind SHIFT "+disguiser"
Cryzbl is offline   Reply With Quote
Old 02-20-2009, 04:57 PM   #204
BlazeFireMaster
 
 
 
Join Date: Feb 2009
Reputation: 83
Posts: 1,282
Alright, I got it. But now I have a question, when I have some binds, like build and disguise, can I have them on the same key? (I mean, putting the disguises in the spy.cfg, and the build binds in the engineer.cfg.)
BlazeFireMaster is offline   Reply With Quote
Old 02-21-2009, 02:25 AM   #205
Cryzbl
 
Join Date: Jul 2008
Reputation: 572
Posts: 1,757
Quote:
Originally Posted by BlazeFireMaster View Post
Alright, I got it. But now I have a question, when I have some binds, like build and disguise, can I have them on the same key? (I mean, putting the disguises in the spy.cfg, and the build binds in the engineer.cfg.)
Of course.

However if you bind something to, say, 5 and you switch class: this keybind doesn't reset magically. You have to manually reset this in every other class config. For this I have a file called default.cfg:
Code:
// Default config

// Stop any command that got 'stuck'
-apistol
sfstop
-detonate
-goforward
-goback
-goleft
-goright
-attack
-attack2
-reload
-duck
-jump

// Restore keybinds
bind MOUSE1 "+attack"
bind MOUSE2 "+attack2"
unbind MOUSE3
unbind MOUSE4
unbind MOUSE5

bind Z "+forward"
bind S "+back"
bind Q "+moveleft"
bind D "+moveright"
bind A "lastinv"
bind R "+reload"
bind T "+use"
bind G "taunt"
bind F "impulse 201"
bind SPACE "+jump"
bind SHIFT "+duck"
bind BACKSPACE "kill"
bind DEL "explode"
bind HOME "exec default; disp; echo Keybinds reset! Press ENTER to reload.; dispf"
unbind -
bind MWHEELUP "invnext"
bind MWHEELDOWN "invprev"

alias resetslots "rstslotx"
rstslotx


// Announce we're done
echo "~~ Keybinds reset ~~"
When gets executed before I bind stuff in every class config.
With the cool addition I can press home at any time to revert to the standard tf2 controls (AZERTY keyboard).
Cryzbl is offline   Reply With Quote
Old 02-21-2009, 11:53 AM   #206
Wakaboom
 
Guest
Posts: n/a
Hmm, i'm wondering if someone could help me out here.
I've made an automatic Sticky-Bomb launcher that fires stickies after eachother when i hold MOUSE4.

But... I want to implement Autoreload to it, so that when i release the button when i have, say, 4 stickies left, it automaticly reloads so that i have 8 again. I want this also for the Grenade Launcher.

PS. If you can make it so that the autoreload does not work for other classes it will be alot more awesome.

This is the script:

Alias +QF "alias RF F; F"
alias F "+attack; wait 2; -attack; wait 2; RF"
alias -QF "alias RF"

bind MOUSE4 "+QF"


If anyone can help me, i will love you for the rest of my life <3

Last edited by Wakaboom: 02-21-2009 at 01:33 PM.
  Reply With Quote
Old 02-22-2009, 03:41 AM   #207
Cryzbl
 
Join Date: Jul 2008
Reputation: 572
Posts: 1,757
Pretty simple:

Code:
bind mouse1 "+autoreload"
bind mouse4 "+stickyfire"

alias +autoreload "-reload; wait; +attack"
alias -autoreload "-attack; wait; +reload"
+reload

alias +stickyfire "-reload; alias sfrepeat sfloop; sfloop"
alias -stickyfire "alias sfrepeat +reload"
alias sfloop "wait 3; +attack; wait 16; -attack; wait 3; sfrepeat"
and in the other class cfg files put -reload.

I've also modified some of the timing, when I tested my sticky autofire if I execute +attack and -attack too quickly it would just get stuck in charging... Also keep in mind that if you charge a sticky and then hold reload it will get stuck in charging the sticky, hence why I throw around some extra waits to prevent this.

One more thing: give your aliases clear names and prefix those with an otherwise generic name, it'll save your some day.

Last edited by Cryzbl: 02-22-2009 at 03:43 AM.
Cryzbl is offline   Reply With Quote
Old 02-22-2009, 08:24 AM   #208
Wakaboom
 
Guest
Posts: n/a
Quote:
Originally Posted by Cryzbl View Post
Pretty simple:

Code:
bind mouse1 "+autoreload"
bind mouse4 "+stickyfire"

alias +autoreload "-reload; wait; +attack"
alias -autoreload "-attack; wait; +reload"
+reload

alias +stickyfire "-reload; alias sfrepeat sfloop; sfloop"
alias -stickyfire "alias sfrepeat +reload"
alias sfloop "wait 3; +attack; wait 16; -attack; wait 3; sfrepeat"
and in the other class cfg files put -reload.

I've also modified some of the timing, when I tested my sticky autofire if I execute +attack and -attack too quickly it would just get stuck in charging... Also keep in mind that if you charge a sticky and then hold reload it will get stuck in charging the sticky, hence why I throw around some extra waits to prevent this.

One more thing: give your aliases clear names and prefix those with an otherwise generic name, it'll save your some day.
Thanks, that worked for my demoman you saved my
But... The other classes still reload, also when i put the -reload in their cfg's. any solution for that?
  Reply With Quote
Old 02-22-2009, 08:59 AM   #209
Cryzbl
 
Join Date: Jul 2008
Reputation: 572
Posts: 1,757
Sorry, forgot about that: It's because mouse1 is still bound to +autoreload. Simply put bind mouse1 +attack in those cfgs to restore it (don't forget about -reload).

I appreciate rep instead of love as well :P

Last edited by Cryzbl: 02-22-2009 at 09:05 AM.
Cryzbl is offline   Reply With Quote
Old 02-22-2009, 09:06 AM   #210
Wakaboom
 
Guest
Posts: n/a
Quote:
Originally Posted by Cryzbl View Post
Sorry, forgot about that: It's because mouse1 is still bound to +autoreload. Simply put bind mouse1 +attack in those cfgs to restore it (don't forget about -reload).

I appreciate rep instead of love as well :P
Thanks!

Also, bit new here. I'll try my best repping ya.
  Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Game Discussions > T - Z > Team Fortress 2 > New Users / Training


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -7. The time now is 02:59 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2014, All Rights Reserved.