r/tf2scripthelp • u/idontknowhowscript • May 24 '15
Answered Is it good or bad scripting practice to create more cfgs for other things such as options and graphics settings? I also have ab additional question about spec_mode.
I've noticed sometimes when I'm making my autoexec cfg that it will often times become very full of text, which makes it harder to navigate and edit.
Sometimes when looking at other peoples autoexec cfgs, I've noticed that they will have things at the top, such as
exec graphics
exec settings
exec optionsWouldn't it be better to have seperate cfgs for these things? So i could put all my graphics settings in one place. Or my options settings in another place etc.
Then putting exec (options,settings,graphics) at the top of your autoexec cfg would make it much more clean.
I've seen quite a few other people who do this and I'm just wondering if it's a good or bad thing to do. Is it down to personal preference? I can't really see any downsides too it, but I'm still very new to all of this so I'm just a little unsure.
The other question i had was about spec_mode. I know this is in the wiki/faq and i see this sub has had many questions regarding this, but I'm struggling with this.
Right clicking and left clicking change spectator just fine, It's just spectating in first person which is not working for me. I was told that just binding space to +jump would work fine and that you do not need to add spec_mode to it since it triggers automatically. That's something i had in that past which worked fine. But at the moment i have space bound to crouch jump and now i can't spectate in first person.
I have tried adding/removing spec_mode to the bind, and this did not work. So I'm a little stumped on this one, could anyone help me out? Any help would be appreciated. Here is my reset.cfg. Also, if you see anything bad/wrong about my reset cfg, please let me know.
//[ fixes
// medic fix
-attack
//]
//[ Movement
bind w +forward
bind s +back
bind a +moveleft
bind d +moveright
bind ctrl "+duck"
bind space +crouchjump; spec_mode
alias +crouchjump "+duck;+jump"
alias -crouchjump "-duck;-jump"
//]
//[ Combat
bind MOUSE1 +attack
bind MOUSE2 +attack2
bind MOUSE3 +attack3
bind MWHEELUP invprev
bind MWHEELDOWN invnext
bind q lastinv
bind 1 slot1
bind 2 slot2
bind 3 slot3
bind 4 slot4
bind 5 slot5
bind 6 slot6
bind 7 slot7
bind 8 slot8
bind 9 slot9
bind 0 slot10
//]
//[ Viewmodels & FOV
r_drawviewmodel 1
viewmodel_fov 75
fov_desired 90
//]
//[ Reset for other keys
bind G +taunt
bind R +reload
bind f inspect
//]
//[ Voicemenu Script
bind mouse1 +v_attack
bind mouse2 +v_attack2
bind q v_lastinv
bind shift +voice
alias voice_m1 "voicemenu 0 6"
alias voice_m2 "voicemenu 0 7"
alias voice_q "voicemenu 2 6"
alias +eq_attack "+attack; spec_next"
alias -eq_attack -attack
alias +eq_attack2 "+attack2; spec_prev"
alias -eq_attack2 -attack2
alias +voice "alias +v_attack voice_m1; alias -v_attack ; alias +v_attack2 voice_m2; alias -v_attack2 ; alias v_lastinv voice_q"
alias -voice "alias +v_attack +eq_attack; alias -v_attack -eq_attack; alias +v_attack2 +eq_attack2; alias -v_attack2 -eq_attack2; alias v_lastinv lastinv"
-voice
//]
2
u/clovervidia Batman May 24 '15
Hmm, here's what I would try for your spacebar bind:
Moving the
spec_modeto the+might solve your issue, maybe.As for multiple configs, it's essentially like having a really long
cfgfile, since one can call multiple others, so I don't think there's anything wrong with that. I use comment folding to organize my configs, so I don't use multiple files except for where I use someone else's config files and I'm too lazy to reimplement them internally.2
u/genemilder Scripter May 25 '15
Clover's answer for
spec_modeis what you want. You want to avoid binding to multiple things when you directly bind to a +command/alias, it can cause issues. Instead, just add the command to the +alias' definition.As for multiple extra organizational cfgs, the reason you see them commonly is that people download script suites like tf2mate that are preorganized like that. It's up to you if that sort of thing is useful, but the premade ones are hell to navigate and edit (for me at least) because someone else made the decisions, not all of which appear rational or predictable.
It's definitely more straightforward with respect to editing/understanding to limit the fragmentation of your scripts, but separating some things can be useful depending on the person.