RSS Feed

Scripting Help

#  Sep 04, 2009 at 11:39 PM
Join Date:
Jun 26, 2008
Post Count:
44
 
5yewy5r 86109
Loading...
Specialty: Spy
Clan: Control Point
 
Hey all. I recently decided to turn of viewmodels for the scout. But, I want it to make it so ONLY the scattergun has no viewmodel, while the pistol and bat does. Luckily, I already had a sciprt that kind of does this with autoreload, so I just stuck in r_drawviewmodel in there. However, the autoreload script also made it so it would still work if you changed weapons using q. I don't know how to set this up, and any help would be appreciated. 
The original script was:

alias shotgun "slot1; cl_autoreload 1; alias last last1"
alias pistol "slot2; cl_autoreload 0; alias last last2"
alias melee "slot3; bind q lastinv"
alias last "last1"
alias last1 "lastinv; alias last last2"
alias last2 "lastinv; cl_autoreload 1; alias last last1"
bind 1 shotgun
bind 2 pistol
bind 3 melee
bind q last

My attempt was:

alias shotgun "slot1; cl_autoreload 1; r_drawviewmodel 0; alias last last1"
alias pistol "slot2; cl_autoreload 0; r_drawviewmodel 1; alias last last2"
alias melee "slot3; r_drawviewmodel 1; bind q lastinv"
alias last "last1"
alias last1 "lastinv; r_drawviewmodel 0; alias last last2"
alias last2 "lastinv; cl_autoreload 1; r_drawviewmodel 1; alias last last1"
bind 1 shotgun
bind 2 pistol
bind 3 melee
bind q last

Although it did work with switching by using 1,2, or 3, it didn't work when I used q. Sorry if this is a stupid question, but anyone know how to fix this?
#  Sep 07, 2009 at 5:02 PM
Join Date:
Jun 26, 2008
Post Count:
44
 
5yewy5r 86109
Loading...
Specialty: Spy
Clan: Control Point
 
Noone's willing to help?
#  Sep 07, 2009 at 5:07 PM
Join Date:
May 17, 2009
Post Count:
902
 
Specialty: Sniper
Steam ID: theharorider
 
I'm not good wth scripting, so I can't help you. Tf2f isn't exactly a fast response website, sometimes it'll take a fewdays until someone replies. Just give it a little more time.
#  Sep 07, 2009 at 6:33 PM
Join Date:
Aug 18, 2008
Post Count:
568
 
Specialty: Sniper
Steam ID: The Geniusman
 
I got it!

Here's an alternate script, which keeps track of the weapon you're using and disables viewmodel for it only. Assuming you use the pistol, it's completely, 100% bulletproof. Never loses track, whether you switch with the mousewheel, number keys or Q, it always knows only to hide the scattergun. If you die whilst holding another weapon, it might lose it's beat, but it recovers simply by changing weapons. Clever, yes?

In scout.cfg:


r_drawviewmodel 0
alias "one" "slot1; bind mwheelup 3f1; bind mwheeldown 2f1; r_drawviewmodel 0"
alias "two" "slot2; bind mwheelup 1f2; bind mwheeldown 3f2; r_drawviewmodel 1"
alias "three" "slot3; bind mwheelup 2f3; bind mwheeldown 1f3; r_drawviewmodel 1"
alias "1f2" "one; bind q 2f1; unbind 1; bind 2 2f1; bind 3 3f1"
alias "2f1" "two; bind q 1f2; bind 1 1f2; bind 3 3f2; unbind 2"
alias "3f1" "three; bind q 1f3; bind 1 1f3; bind 2 2f3; unbind 3"
alias "1f3" "one; bind q 3f1; unbind 1; bind 2 2f1; bind 3 3f1"
alias "3f2" "three; bind q 2f3; bind 1 1f2; bind 3 3f2; unbind 2"
alias "2f3" "two; bind q 3f2; bind 1 1f3; bind 2 2f3; unbind 3"
bind "mwheeldown" "2f1"
bind "mwheelup" "3f1"
bind "q" "2f1"
unbind 1
bind "2" "2f1"
bind "3" "3f1"

And put this in your other configs:

r_drawviewmodel 1
unbind 1
unbind 2
unbind 3
unbind mwheelup
unbind mwheeldown
unbind q
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "mwheelup" "invprev"
bind "mwheeldown" "invnext"
bind "q" "lastinv"

You can place the first script in any class config in which you'd like to hide the primary weapon.

Good luck on the field, soldier! Hope this is what you were looking for.
#  Sep 07, 2009 at 9:33 PM
Join Date:
Jun 26, 2008
Post Count:
44
 
5yewy5r 86109
Loading...
Specialty: Spy
Clan: Control Point
 
Thnx computergeniusman! Just what I was looking for. I don't think it will conflict with my autoreload script, but if it does I can probably merge the two.
#  Sep 07, 2009 at 10:19 PM
Join Date:
Aug 18, 2008
Post Count:
568
 
Specialty: Sniper
Steam ID: The Geniusman
 
You are very welcome. I should post this as an explanation, in case you'd like to extend the script.

To modify the settings for each weapon, simply add your commands to the end of the corresponding line, like this:

r_drawviewmodel 0
alias "one" "slot1; bind mwheelup 3f1; bind mwheeldown 2f1; r_drawviewmodel 0; commands_for_primary"
alias "two" "slot2; bind mwheelup 1f2; bind mwheeldown 3f2; r_drawviewmodel 1; commands_for_secondary"
alias "three" "slot3; bind mwheelup 2f3; bind mwheeldown 1f3; r_drawviewmodel 1; commands_for_melee"
-all the rest-

So you'd just add any commands you wanted for the weapon you needed them for. Adding cl_autoreload 1 to the primary weapon line would enable autoreload for that weapon. You'd also have to add cl_autoreload 0 to the other lines. I hope that's clear enough, the script is complicated for such a simple task.

Copyright 2007-2008 All Rights Reserved

Team Fortress 2


2 Guys 1 Kill: {TF2F} FlyingPenguin - (102 kill assists)
Captures Blocked: Nimbli Bimbli - (26 captures blocked)
Dominator: {TF2F} Bitch Nasty - (25 dominations)
Flags Captured: Corporal Clegg - (11 flags captured)
Flags Defended: MechaEdd - (12 flags defended)
Physician Assisted Homicide: {TF2F}SME®BUI©K - (271 medic kill assists)
Points Captured: {TF2F}SME®BUI©K - (30 points captured)
Revenger: Count_Flakula - (10 revenges)
Spy Power: Chro - (19 objects killed as spy)
Ubercharger: {TF2F}SME®BUI©K - (89 ubercharges)
Axe Man: {TF2F} Ninja Dude - (18 kills with fireaxe)
Axtinguished: {TF2F} BOOSH Rizzilio - (81 kills with axtinguisher)
Batter Up!: soup! - (16 kills with bat)
Biggest Prick: Sam - ClutchKill.com - (8 kills with syringegun)
Blood Sucker: {TF2F}SME®BUI©K - (30 kills with blutsauger)
Broke Backburner: {TF2F} FlyingPenguin - (223 kills with backburner)
Can You Dig It?: {TF2F}.TüRb!NE. - (3 kills with shovel)
Doctor's Certificate: Maero - (16 kills with bonesaw)
Drunken Brawler: [???] Deviruchi - (4 kills with bottle)
Epic Defender: {TF2F} Spy - (9 kills with wrench)
Fire Spitter: {TF2F}blistering - (100 kills with flamethrower)
Flare Gunner: {TF2F} FlyingPenguin - (12 kills with flare gun)
Grenade Spammer: GeneralSheep - (47 kills with pipe)
Grey Matter: STar - (168 snipings as sniper)
Hadouken Master: Xandier - (1 kills with pyro taunt)
Hot Potato: {TF2F} BOOSH Rizzilio - (4 kills with rocket deflection)
I <3 Sasha: {TF2F} Bitch Nasty - (181 kills with minigun)
Knife Maniac: {TF2F} Dartagnan - (109 knifings)
Last Resort: [Ba-El] BoC - (26 kills with smg)
Manslayer: [FRGT] Klare - (10 kills with machete)
Master Fister: Maero - (3 kills with fists)
Peashooter Marksman: Corporal Clegg - (48 kills with scout pistol)
Pickle Squad Award: [NH]Pitt - (18 pickles man handled)
Rocket Scientist: [TF2F]Lancer - (217 kills with rocket)
Scatter Shot: Corporal Clegg - (147 kills with scattergun)
Sentrygun Master: Numenor - (142 kills with sentrygun)
Spam Blocker: {TF2F} BOOSH Rizzilio - (1 kills with pipe deflection)
Spy Checker: {TF2F} Fanlaen - (5 kills with pistol)
Sticky Explosion: {TF2F}Album - (105 kills with pipe remote)
Ubersawer: Psycholord - (27 kills with ubersaw)
Stats Refreshed 6/24/2008 5:00:03 AM CST
AddThis Social Bookmark Button
Fortcast Podcast
Donate
Welcome, you are not logged in.
Login or Register
Team Fortress 2 Fort Team Fortress 2 Fort