r/Tf2Scripts • u/JaditicRook • Jun 16 '19
Resolved Trying to make a slot specific viewmodel toggle for complicated medic inverted healing script.
My script makes it so that when my medi guns are active theyre continuously healing(attacking) but leaves my primary and melee working as normal.
I'd like a bind that can toggle the settings of my slot1 to use cl_first_person_uses_world_model 1 then be able to press the key again to toggle it back to its normal cl_first_person_uses_world_model 0 configuration.
If you want to, feel free to edit the base script into something simpler to work with. Its mostly beyond my scripting ability tbh.
This is where I got the bulk of the script from. Edited out my slot specific crosshair/viewmodel settings for clarity.
bind 1 "weapon1"
bind 2 "weapon2"
bind 3 "weapon3"
bind mwheelup "weapon1"
bind mwheeldown "weapon2"
bind mouse3 "weapon3"
bind mouse1 "+medicatk"
bind mouse2 "+charge"
alias weapon1 "slot1; alias +medicatk ss_n; alias -medicatk ss_f; syrisaw; hud_combattext_healing 1"
alias weapon2 "slot2; alias +medicatk mg_n; alias -medicatk mg_f; medigun; hud_combattext_healing 0"
alias weapon3 "slot3; alias +medicatk ss_n; alias -medicatk ss_f; syrisaw; hud_combattext_healing 1"
alias atk_n "alias syrisaw +attack; alias medigun -attack; spec_next"
alias atk_f "alias syrisaw -attack; alias medigun +attack"
alias ss_n "+attack; atk_n"
alias mg_n "-attack; atk_n"
alias ss_f "-attack; atk_f"
alias mg_f "+attack; atk_f"
alias +medicatk "ss_n"
alias -medicatk "ss_f"
atk_f
alias "+charge" "weapon2; +attack2; dropitem; spec_prev"
alias "-charge" "-attack2"
weapon2 //spawn with secondary out
To be clear, I know how to make it so my primary is always in world models and my secondary/melee arent but I'm looking for a toggle I can use to just change my primary back and forth on the fly.
I have something similar to make pyro flames visible if I want to see them but the base script made by u/genemilder is a lot easier to work with. I added the janky toggle bit at the bottom. When I try to do the same with the medic script it doesnt keep the changes upon weapon swap and makes my primary spam attack.
3
u/ArgosOfIthica Jun 17 '19 edited Jun 17 '19
This script should only toggle the world model of your primary weapon, and preserve it across weapon swaps. The toggle will work if your primary weapon is out, or will even work silently when other weapons are out. I can't test this, so please let me know if it works. Also, delete your existing "weapon" aliases, this replaces those, as you'll see.
2
u/FanciestBanana Jul 02 '19
I suggest to not to toggle ` cl_first_person_uses_world_model ` at all since it's very janky and doesn't not update properly until you respawn. I would suggest you change this setting only on per-class basis.
But i guess everyone has their tastes.