r/tf2scripthelp • • Jun 08 '15

Resolved Engineer/Spy PDA/weapon switch script issues.

My goal with my script is to allow my Engineer and Spy to access thier Primary, Secondary, and Melee (in Spy's case, Revolver, Sapper, Knife, and in Engineer's case, Shotgun, Pistol, Wrench) with Scrollwheel, and to access thier respective PDAs with Z and X (using both for Engineer's build/destroy PDAs and only Z for Spy's PDA.)

To this end, I took /u/genemilder 's crosshair/viewmodel script and modified it, at first only adding the PDAs as Z and X. This showed my my first serious bug: neither class could switch weapons, but every other class could thanks to a reset script. Both classes, however, could access thier PDAs with little issue.

I found that the cause was that every alias used to switch weapons wasn't actually defined. The script defined aliases that would define the aliases when called, but at no point were the aliases called. To this end, I added a hotfix.

The hotfix patched... most of the issue. The result was that melee and secondary were accessible with mousewheel, but primary wasn't- but for some reason, it was always accessible via Q. Again, all three PDAs could be accessed with little issue.

My Engineer script with its hotfix (and some commenting thrown in) can be found here. The Spy script is almost identical, the only difference being the lack of setting slot5 to X- Spy has only one PDA, his disguise kit, while Engineer has two.

2 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/genemilder Scripter Jun 09 '15 edited Jun 09 '15

Yeah, that one's definitely wrong, not sure what I was thinking. :)

It's possible that I simplified it from a more complicated version and took out parts I shouldn't have. I think the script would be functional if the corresponding qs_ aliases were put into the definitions of the 3 equip_primary etc aliases. Anyway it's old and not so good. :)

Edit: I just checked my old script files and yep, that's exactly what I did, I mistakenly took out those aliases when I was removing the unneeded settings aliases.