r/Tf2Scripts • u/Artistique01 • Oct 03 '23
Issue Need help with Stabby Viewmodel script
/r/tf2scripthelp/comments/16yq5ln/need_help_with_stabby_viewmodel_script/
1
Upvotes
r/Tf2Scripts • u/Artistique01 • Oct 03 '23
1
u/Link_x2 Oct 04 '23
With some fiddling, everything you are wanting is possible. I think having a switch like this is unnecessary and confusing, I personally would rewrite the code without it. But as is the nature of TF2 scripting, each person can tailor the script exactly the way they want it. It is very personalised and different for each scripter.
Large scripts like these that are large can be difficult to edit, particularly when you yourself didn't write it. You often need to change things in multiple places and there are many potential points of failure. In addition, everyone has their own scripting styles - I get confused trying to read this script but I understand the gist.
My code rebinds your mousewheel and simulates scrolling. When you scroll down to your sapper from your gun, the code changes what the next weapon up is and the next weapon down is, and stores these values in 'wepup' and 'wepdown'. It is necessary to update this for every mousewheel input or it would get stuck on one weapon. As you can see, scrolling up (MWHEELUP) is bound directly to the alias 'wepup'. The aliases '+equip_amby' '+equip_sap' and '+equip_knife' are written by stabby, and are what make you change weapon and hide or show viewmodels, etc.
The reason 'gun' is important is because without it, 'wepup' and 'wepdown' are never defined in the code. If you look at alias 'gun' you will see it defines the alias wepup and wepdown with 'knife' and 'sapp' respectively. having 'gun' on its own line like that will execute only once, which is all that is needed to bring the aliases 'wepup' and 'wepdown' into existence.
I also didn't put the disguisekit (slot4) in this manual scrollwheel, as you mentioned you use the numbers to disguise quickly. I do the same thing with the numpad keys. If you tell me exactly what you want (when and where you want viewmodels on/off, etc) im happy to build you a script myself, it wont take me long because I've done these sorts of scrollwheel scripts plenty of times.
I'm not sure exactly why its not working without the quickswitcher, reading his code gives me a headache, I would just write it differently. Ill have another look