#class script debugging

1 messages · Page 1 of 1 (latest)

oak nova
#

heya, i'm trying to get some pretty specific behaviour out of my spy config here, it's almost working but this last part keeps breaking

intended behaviour:
when disguised, weapon swap keys and mouse wheel scroll will automatically press "lastdisguise", which allows me to keep my disguise's weapon accurate to the real weapon i'm holding at all times

however, i want to be able to hold shift to temporarily disable that functionality

it's working up to the point where i have a functional shift toggle bind which i'm already using to swap voice lines with shift+e, but on spy, if i press then release shift, it permanently disables the auto-disguise-swap, likely because i've screwed up with the aliases to re-enable it

would anyone be able to help debug this? (notably i'm trying to add the shift function on top of the original script, which has always worked fine)

thanks :3

#

script:

alias disguisecheck "none"

alias wepslot4 "slot4; alias disguisecheck lastdisguise"

alias +disguisedattack "alias disguisecheck none; +attack;"
alias -disguisedattack "-attack;"

alias +dattack "+attack;"
alias -dattack "-attack;"

alias scrup "wepslot1"
alias scrdown "wepslot2"

alias slot1disguiseswap "alias wepslot1 "slot1; disguisecheck; alias +dattack +disguisedattack; alias scrup wepslot2; alias scrdown wepslot3;""
alias slot2disguiseswap "alias wepslot2 "slot2; disguisecheck; alias +dattack +disguisedattack; alias scrup wepslot3; alias scrdown wepslot1;""
alias slot3disguiseswap "alias wepslot3 "slot3; disguisecheck; alias +dattack +disguisedattack; alias scrup wepslot1; alias scrdown wepslot2;""
alias slot5disguiseswap "alias wepslot5 "disguisecheck none""

alias slot1noswap "alias wepslot1 "slot1""
alias slot2noswap "alias wepslot2 "slot2""
alias slot3noswap "alias wepslot3 "slot3""
alias slot5noswap "alias wepslot5 "slot5""

bind 1 "wepslot1"
bind 2 "wepslot2"
bind 3 "wepslot3"
bind 4 "wepslot4"
bind 5 "wepslot5"


alias +shift_toggle "alias medic_UO activatecharge; slot1noswap; slot2noswap; slot3noswap; slot5noswap; echo "down""
alias -shift_toggle "alias medic_UO medic; slot1disguiseswap; slot2disguiseswap; slot3disguiseswap; slot5disguiseswap; echo "up""

bind "MOUSE1" "+dattack"
bind "MWHEELUP" "scrdown"
bind "MWHEELDOWN" "scrup"```
solid kiln
#

like alias thing "alias thing2 "here is the issue"" doesn't work i think

#

alias thing "echo "however this works";echo "for some reason""
alias thing "alias thing2 this; alias thing3 would; alias thing4 work; alias thing5 though"

solid kiln
oak nova
#

ohh okay, do i need another alias to nest it inside?

nocturne pecanBOT
#

*ohh okay, do i

need another alias

to nest it inside?*

oak nova
#

ty

#

or is it just that i need additional quotes inside the middleman alias

#

actually that would make sense- slot1 through slot3 still work, which would make sense if it's only listening to the first argument of "slot1; disguisecheck;"

solid kiln
#

also you don't have to do alias disguisecheck none, alias disguisecheck does the same thing as alias disguisecheck ""

oak nova
#

ah oki, that's an artifact from the original maker of the script lol

#

hold on i'll try this all out in a second

#

thanks for the help :3

solid kiln
oak nova
#

ah oki

#

alright- trying to understand this

#

alias slot1disguiseswap "alias wepslot1 ""slot1"; "disguisecheck";" alias +dattack "+disguisedattack;" alias scrup "wepslot2"; alias scrdown "wepslot3;"

#
"
  alias wepslot1 ""slot1"; "disguisecheck"";
  alias +dattack "+disguisedattack";
  alias scrup "wepslot2";
  alias scrdown "wepslot3"
"```
solid kiln
#

(you also don't need the ; after the final command, it's intended to chain commands together and so the last one is redundant)

#

i don't think the wepslot1 would work because the alias is trying to be created with two commands within a nested string, the ; within it would break out of the string and then it would execute like alias wepslot slot1; disguisecheck

oak nova
#

right- yeah

#

the other three should work fine though right? since they shouldnt need those quotes

solid kiln
#

yes the other three should work

oak nova
#

right

#

oki, so

#
alias setslot1disguiseswap "slot1"; "disguisecheck"
alias slot1disguiseswap
"
  alias wepslot1 setslot1disguiseswap;
  alias +dattack +disguisedattack;
  alias scrup wepslot2;
  alias scrdown wepslot3
"```
solid kiln
#

alias setslot1disguiseswap "slot1; disguisecheck" is fine

#

but yeah that should work

oak nova
#

oki!

#

also i'm wondering if +dattack is even doing anything

#
alias -disguisedattack "-attack;"

alias +dattack "+attack;"
alias -dattack "-attack;"```
solid kiln
#

looks like it's supposed to be acting as a switch to activate lastdisguise for wepslot4 but my brain isn't working right now lol

oak nova
#

fair xd

#

uhm oki,

#
alias slot1disguiseswap "alias wepslot1 setslot1disguiseswap; alias +dattack +disguisedattack; alias scrup wepslot2; alias scrdown wepslot3"

alias setslot2disguiseswap "slot2"; "disguisecheck"
alias slot2disguiseswap "alias wepslot2 setslot2disguiseswap; alias +dattack +disguisedattack; alias scrup wepslot3; alias scrdown wepslot1"

alias setslot3disguiseswap "slot3"; "disguisecheck"
alias slot3disguiseswap "alias wepslot3 setslot3disguiseswap; alias +dattack +disguisedattack; alias scrup wepslot1; alias scrdown wepslot2"

alias slot5disguiseswap "alias wepslot5 "disguisecheck" ""

alias slot1noswap "alias wepslot1 "slot1""
alias slot2noswap "alias wepslot2 "slot2""
alias slot3noswap "alias wepslot3 "slot3""
alias slot5noswap "alias wepslot5 "slot5""

alias +shift_toggle "alias medic_UO activatecharge; slot1noswap; slot2noswap; slot3noswap; slot5noswap; echo "down""
alias -shift_toggle "alias medic_UO medic; slot1disguiseswap; slot2disguiseswap; slot3disguiseswap; slot5disguiseswap; echo "up""

bind 1 "wepslot1"
bind 2 "wepslot2"
bind 3 "wepslot3"
bind 4 "wepslot4"
bind 5 "wepslot5"```
#

relevant part of it looks like this now

#

currently the lastdisguise part isn't working though

solid kiln
#

no weapon is executing lastdisguise when it's supposed to be?

oak nova
#

yeah, but it still swaps weapons fine

#

tested before and after shifting, and the shift function does work as i'm getting up and down in consol

#

alias setslot1disguiseswap "slot1"; "disguisecheck"

#

do these need to be in quotes?

solid kiln
#

"slot1; disguisecheck"

oak nova
#

wait-

#

RIGHT

#

WORKS!!

solid kiln
#

lol yeah it can be a mess to look at

oak nova
#

swaps by default, no swap when shifting

#

helllll yeah ty!

#

well now i feel like i could basically script any controls xd

solid kiln
#

it is pretty customizable

oak nova
#

i love tf2 for this tbh

solid kiln
#

yeah i'm pretty glad we have this functionality

#

not commonly found within games without external applications

oak nova
#

ye

#

alright i'll just clean this file up a bit more

#

+dattack is only ever set to +disguisedattack

#
alias -disguisedattack "-attack;"```
#

which just... does a disguisecheck on attack?

#

i feel like that accomplishes nothing lol

solid kiln
#

uhh maybe trying to activate/deactivate executing lastdisguise after you've fired your weapon?

oak nova
#

oh-

#

that would make sense

#

that's really funny because uh

#

i only use YER

#

so i never noticed

#

xd

solid kiln
#

ah yeah

oak nova
#

honestly- i'll just bind that to shift +mouse1

#

seems cool but could eat cloak with YER

oak nova
#

NVM

#

it was to check if disguise is active

#

xd

#

breaks the whole thing

#

fixed it now i think

oak nova
#

followup question if anyone's willing:

is there any possible way to check if you have an active disguise, or if an attack was successful etc?

#

instead of just guessing/inferring it through which keys have been pressed

#

since i play YER, attacking could either result in me staying disguised if i get a stab, or losing it if i miss, and there's no way to control for that by tracking my inputs

solid kiln
#

it's possible there's some hud jank you could do but that's beyond me