r/Tf2Scripts • u/Rad_Larry0 • Jun 13 '20
Issue spy viewmodel script
so I modified the engineer/spy version of this guys advanced viewmodel script
( https://www.reddit.com/r/Tf2Scripts/comments/becycg/script_guide_a_basic_guide_to_hiding_tf2/ )
but now I'm struggling to figure out how to get it to work exactly 1:1 to how it works by default.
what I mean is normally when you use the disguise kit it will switch back to the weapon you were previously holding, and if you attempt to switch to your last weapon it will remember and switch correctly. (if you were holding the revolver, then pulled out your knife, and then used the disguise kit it should remember that you were holding your revolver. etc)
I can't figure it out, at this point, all I've accomplished is make it switch to my knife without remembering what weapon I was using before my knife.
-my current code
bind 1 "weapon1"
bind 2 "weapon2"
bind 3 "weapon3"
bind 4 "weapon4"
bind Q "last_weapon"
bind MWHEELUP "next_weapon"
bind MWHEELDOWN "prev_weapon"
alias weapon1 slot1
alias weapon1 "slot1; r_drawviewmodel 0; alias next_weapon weapon4; alias prev_weapon weapon2; set_last; alias set_last alias last_weapon weapon1"
alias weapon4 "slot4; r_drawviewmodel 1; alias next_weapon weapon3; alias prev_weapon weapon1; alias last_weapon weapon3"
alias weapon3 "slot3; r_drawviewmodel 1; alias next_weapon weapon2; alias prev_weapon weapon4; set_last; alias set_last alias last_weapon weapon3"
alias weapon2 "slot2; r_drawviewmodel 1; alias next_weapon weapon1; alias prev_weapon weapon3; set_last; alias set_last alias last_weapon weapon2"
if anyone can help that would be cool
View all comments
Show parent comment
1
u/pdatumoj Jun 13 '20 edited Jun 13 '20
I believe the preferred way to do it is via generation at cfg.tf - though you'll probably want to chop out the relevant portion from the output from that, as that tries to be a generator of all your configuration and takes something of an "our way or no way" approach.
Anyway, via that, it's in the viewmodels tab and then " Adjust class-specific viewmodels and crosshairs " ....
All this said, I believe it also requires loading a plugin into TF2, though it's apparently widely considered innocuous.
Personally, I've not tried it, as I like having the viewmodels and my own script isn't something I'd want to try to integrate with that.
Addendum: it's apparently from here: https://code.google.com/archive/p/broesels-crosshair-switcher/ Also, having looked at that, I have to say I'm not terribly impressed. I may dig into it sometime soon to understand it better, but, for now, you may want to extract the relevant stuff from there.
Addendum 2: having now read over this, I think it's hardly the magic sauce it's cracked up to be. I wouldn't recommend it, and I'm not sure why so many people do. I'll follow up in a more useful manner later.
Addendum 2 P.S.: Either I'm thinking of something completely different, or the bits I'd heard about this requiring a plugin were misinformation.
Addendum 2 P.P.S.: I was thinking of something else - which has now been linked in a comment that should be well above this one: https://www.reddit.com/r/Tf2Scripts/comments/h81miq/spy_viewmodel_script/fuoq3oz/
Edits: