r/tf2scripthelp • • Jul 15 '15

Resolved Need help with some spy scripting courtesy of stabby

So I want to add Stabby's script to auto-say sapping, but I don't know if I'm doing something wrong or not. I already have the script to hide the ambassador and I rather like it so I'd prefer not to remove it. The script can be found here. Now, this is my spy.cfg folder as of right now.

// Stabby's Viewmodel Script for Spy //

// // // // // // // // // // //  // // // // // // // // // // // //  //
    //Viewmodels<< on when shooting amby, off when knife or watch out//
// // // // // // // // // // //  // // // // // // // // // // // //  //


// spawn with knife out and viewmodel mode set to "on"

slot3
r_drawviewmodel 1
knife_vm_mode


        // replace [KEY] with the your Keybinds for the sapper/knife/ambassador/watch


bind "3" +equip_knife      // Key/button for knife
bind "1" +equip_amby      // Key/button for ambassador
    bind "mouse2" "+watch;spec_prev"          // Key for watch (mouse2 default)
//sapper
alias vmsap "bind mouse1 +sap"
        alias +sap "+attack;dotxhaircolor;dotxhairtype;r_drawviewmodel 1;sapalert"
alias -sap "-attack;dotxhaircolor;dotxhairtype"
alias sapalert "say_team sapping"

    alias +sapper "slot2;dotxhairtype;dotxhaircolor;sensitivity 3;r_drawviewmodel 1;vmon;fov_desired 90;viewmodel_fov 99"
alias -sapper "dotxhairtype;dotxhaircolor"
bind "2" "+sapper;vmsap" //rebind to liking


//re-bind mouse1

    alias knife_vm_mode "bind mouse1 +viewmodel_knife" // binds mouse1 to turn viewmodel on when attacking (for knife knife)
alias amby_vm_mode "bind mouse1 +viewmodel_amby"  // binds mouse1 to turn viewmodel off when attacking (for amby)
    alias sap_vm_mode "bind mouse1 +viewmodel_sap"   // binds mouse 1 to turn viewmodel on when attacking and off when not (for sapper)


// causes viewmodel to go off or on when you shoot

alias +viewmodel_knife "+attack;r_drawviewmodel 1;spec_next"          // attacks, turns viewmodel on
alias -viewmodel_knife "-attack;r_drawviewmodel 1"         // finishes atack, turns viewmodel on again as safeguard

alias +viewmodel_amby "+attack;r_drawviewmodel 0;spec_next"          // attacks, turns viewmodel off
alias -viewmodel_amby "-attack;r_drawviewmodel 0"         // finishes attack, turns viewmodel off again as a safeguard

alias +viewmodel_sap "+attack;r_drawviewmodel 1;spec_next"          // shows sapper when sapping
alias -viewmodel_sap "-attack;r_drawviewmodel 1"         // hides sapper when mouse1 released


// Equip item, turn vm on/off, set vm toggle for attack

alias +equip_knife "slot3;r_drawviewmodel 1"             // Equips knife, turns viewmodels on
alias -equip_knife "knife_vm_mode;r_drawviewmodel 1"    // Sets viewmodels to turn ON when stabbing (makes sure it stays on)

alias +equip_amby "slot1"                               // Equips amby
alias -equip_amby "amby_vm_mode"                        // Sets viewmodels to turn OFF when shooting

alias +equip_sap "slot2;r_drawviewmodel 1"             // Equips sapper, turns viewmodels on
alias -equip_sap "sap_vm_mode"                        // Sets viewmodels to turn on while firing, and off when not

alias +watch "+attack2;r_drawviewmodel 1"              // watch up/cloak on/secondary attack + viewmodels on
alias -watch "-attack2;r_drawviewmodel 1"             // viewmodels on again as safeguard


// // // // // // // // // // //  //

echo "Viewmodel script loaded" // confirms script loaded in the console    

Help?

1 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/genemilder Scripter Jul 16 '15

What are you asking? The script in the text includes the message, the script in the link does not but you just add it like I did with the script in text, that relevant line is exactly the same in both.

If you're having trouble because you are using either stabby's or the script in text with q or the mousewheel, you cannot switch weapons with those keys and have the settings switch too. Only the script in the link addresses those keys.

1

u/MisterFear Jul 16 '15

Sapping is not producing any team message, or any message at all. That's the only problem remaining.

1

u/genemilder Scripter Jul 16 '15

What script are you using, and if you're using one of mine are you certain that you fully removed stabby's? His will overwrite mine due to the nested binds.

1

u/MisterFear Jul 16 '15

I'm using the one you posted above. (Not the linked one)

I'm sure I removed it because I removed everything in my spy config and then posted that.

1

u/genemilder Scripter Jul 16 '15

Then what you need to do is go in-game (probably easiest to use a private server from the 'Training' tab with bots turned off, choose spy, and then double check that it still fails (you must press 2 to switch to the sapper). If it does fail, pause and open the console, then input bind mouse1 to see what it's bound to. It should be bound to +eq_attack. If it isn't, something you have has overwritten my script and that's the problem.

1

u/MisterFear Jul 17 '15

I have determined that it's still Stabby's script overriding it, despite the fact that deleted the scripting and replaced it. Doing exec spy does nothing, either.

1

u/genemilder Scripter Jul 17 '15

If the cfg does nothing then it's wrong in some way (name, file type, encoding, location). Scripts in the /custom/ location will override scripts in the old non custom location.

1

u/MisterFear Jul 17 '15

Fixed. Turns out I had scripts in custom. Deleted them. Thanks for the help.

1

u/genemilder Scripter Jul 17 '15

No sweat. Custom is the recommended location for scripts, but both work.