Upvote Upvoted 2 Downvote Downvoted
Scripting help
posted in Q/A Help
1
#1
1 Frags +

I've been putting off getting my scripts all set up for awhile, been lazy and used a toggle key for viewmodels. Now that I'm actually going to get them setup is there any tutorials or resources that I could use to help me learn syntax and the general logic for TF2 Scripting? I understand a little bit like how to set up basic binds and toggles but that is about the extent of my knowledge.

I've been putting off getting my scripts all set up for awhile, been lazy and used a toggle key for viewmodels. Now that I'm actually going to get them setup is there any tutorials or resources that I could use to help me learn syntax and the general logic for TF2 Scripting? I understand a little bit like how to set up basic binds and toggles but that is about the extent of my knowledge.
2
#2
0 Frags +

http://wiki.teamfortress.com/wiki/Scripting
https://developer.valvesoftware.com/wiki/TF2_cvarlist
http://forums.steampowered.com/forums/showthread.php?t=709568

looking at other peoples configuration files could help you with ideas on what you want to do

everything is preference, and you really don't need to script much of anything in this game unless you are nitpicky on things per class

http://wiki.teamfortress.com/wiki/Scripting
https://developer.valvesoftware.com/wiki/TF2_cvarlist
http://forums.steampowered.com/forums/showthread.php?t=709568

looking at other peoples configuration files could help you with ideas on what you want to do

everything is preference, and you really don't need to script much of anything in this game unless you are nitpicky on things per class
3
#3
0 Frags +

If you want help with anything really specific add me and i can probably help you with it, otherwise use the resources that fox gave you above

If you want help with anything really specific add me and i can probably help you with it, otherwise use the resources that fox gave you above
4
#4
0 Frags +

Is there an easier way to test scripts ingame without reloading the game every time you change them? I've been looking at some peoples configs and most of them seem to do basically what I want but I wanted to add a couple minor things to classes I play often. One of the things I was trying to do is have mouse2 as soldier switch to melee, but when I would switch to another class it'd keep doing it even thought I only had it bound in the soldier.cfg file.

Is there an easier way to test scripts ingame without reloading the game every time you change them? I've been looking at some peoples configs and most of them seem to do basically what I want but I wanted to add a couple minor things to classes I play often. One of the things I was trying to do is have mouse2 as soldier switch to melee, but when I would switch to another class it'd keep doing it even thought I only had it bound in the soldier.cfg file.
5
#5
0 Frags +
BenroadsIs there an easier way to test scripts ingame without reloading the game every time you change them? I've been looking at some peoples configs and most of them seem to do basically what I want but I wanted to add a couple minor things to classes I play often. One of the things I was trying to do is have mouse2 as soldier switch to melee, but when I would switch to another class it'd keep doing it even thought I only had it bound in the soldier.cfg file.

The (class).cfg files get executed when you switch to that class. They don't get "un-executed" when you switch back. So if you make a bind in your soldier.cfg, then when you switch to medic, it's still going to be bound to the same thing. If you want to change a thing for a specific class, you have to change it BACK for every other class as well.

[quote=Benroads]Is there an easier way to test scripts ingame without reloading the game every time you change them? I've been looking at some peoples configs and most of them seem to do basically what I want but I wanted to add a couple minor things to classes I play often. One of the things I was trying to do is have mouse2 as soldier switch to melee, but when I would switch to another class it'd keep doing it even thought I only had it bound in the soldier.cfg file.[/quote]

The (class).cfg files get executed when you switch to that class. They don't get "un-executed" when you switch back. So if you make a bind in your soldier.cfg, then when you switch to medic, it's still going to be bound to the same thing. If you want to change a thing for a specific class, you have to change it BACK for every other class as well.
6
#6
0 Frags +

I've looked at a couple configs, trying to find the command that would like unbind the previously used one.

I've looked at a couple configs, trying to find the command that would like unbind the previously used one.
7
#7
0 Frags +

unbind all
That will unbind every key and then have the class exec a config that does all of the binds you want across all classes, like jumping, moving, attacking, chat binds, toggles, etc.

Or have it unbind only one key

unbind all
That will unbind every key and then have the class exec a config that does all of the binds you want across all classes, like jumping, moving, attacking, chat binds, toggles, etc.

Or have it unbind only one key
8
#8
0 Frags +

IDK if this still works but
http://clugu.com/tf2mate/
make a config here and take a look at it.

IDK if this still works but
http://clugu.com/tf2mate/
make a config here and take a look at it.
9
#9
0 Frags +
bind "1" "slot1; r_drawviewmodel 0"
bind "2" "slot2; r_drawviewmodel 0"
bind "3" "slot3; r_drawviewmodel 1"

Found this on the steam forums and used it, problem is when I respawn my weapons view models turn back on until I press 1. Is there a way around this?

[code]
bind "1" "slot1; r_drawviewmodel 0"
bind "2" "slot2; r_drawviewmodel 0"
bind "3" "slot3; r_drawviewmodel 1"
[/code]

Found this on the steam forums and used it, problem is when I respawn my weapons view models turn back on until I press 1. Is there a way around this?
10
#10
2 Frags +
Benroads
bind "1" "slot1; r_drawviewmodel 0"
bind "2" "slot2; r_drawviewmodel 0"
bind "3" "slot3; r_drawviewmodel 1"

Found this on the steam forums and used it, problem is when I respawn my weapons view models turn back on until I press 1. Is there a way around this?

Turn on "remember last active weapon" in advanced options. Your problem is that u died while holding your melee and when you spawn u switch to primary without pressing the button that changes view models. Remembering last active weapon prevents any weapon changing while dead that screws up view models. Your only other problem would be weapons that switch your active weapon automatically (like using a throwable item or running out of ammo). This will change to your last active weapon which may have had a different view model setting. The only way around this is to set up a more complicated bind that works only for a specific class when they're holding a specific slot, which is extensive and gets screwed up if you switch that slot to a different item that works differently. Ex u could make the sniper always switch to primary and turn off view models every time he fires secondary (jarate), but then if u use an smg u have problems (or even worse if u use a backpack and accidentally press two, switching ur binds without switching ur weps).

Long story short, it's easier to just press one either while ur dead or after u spawn.

[quote=Benroads][code]
bind "1" "slot1; r_drawviewmodel 0"
bind "2" "slot2; r_drawviewmodel 0"
bind "3" "slot3; r_drawviewmodel 1"
[/code]

Found this on the steam forums and used it, problem is when I respawn my weapons view models turn back on until I press 1. Is there a way around this?[/quote]
Turn on "remember last active weapon" in advanced options. Your problem is that u died while holding your melee and when you spawn u switch to primary without pressing the button that changes view models. Remembering last active weapon prevents any weapon changing while dead that screws up view models. Your only other problem would be weapons that switch your active weapon automatically (like using a throwable item or running out of ammo). This will change to your last active weapon which may have had a different view model setting. The only way around this is to set up a more complicated bind that works only for a specific class when they're holding a specific slot, which is extensive and gets screwed up if you switch that slot to a different item that works differently. Ex u could make the sniper always switch to primary and turn off view models every time he fires secondary (jarate), but then if u use an smg u have problems (or even worse if u use a backpack and accidentally press two, switching ur binds without switching ur weps).

Long story short, it's easier to just press one either while ur dead or after u spawn.
Please sign in through STEAM to post a comment.