SCRIPT: Bypass the spellwheel!



  • So after spending the better part of my time on the server yesterday with Remnic and in Notepad++ instead of the game, I made a script that takes advantage of the new commands that were added to the gamemode. In combination with a state-switcher script that allows you to change the function of extra keys by holding down another (by default shift) this script makes the spell wheel obsolete. I don’t know of a method to make GMod detect when a gamemode is being played, so you’ll have to put this in a file called RTP.cfg or something and execute it whenever you join manually.

    I’m posting this code in parts. The following section consists of direct-spell reference aliases for Wizard and Dragoon, but you generally shouldn’t need direct-spell reference aliases unless you’re playing a class that has more than 16 spells. If someone requests and I have enough time (finals coming up) I’ll add their class choice’s direct-reference spell aliases.

    
    //"are you a bad enough coder to configure the president"
    
    alias s_anchor "cast "Anchor""
    alias s_blink "cast "Blink""
    alias s_burn "cast "Burn""
    alias s_channel "cast "Channel Life""
    alias s_counter "cast "Counter Spell""
    alias s_drain "cast "Drain Mana""
    alias s_electron "cast "Electron Ball""
    alias s_energy "cast "Energy Bolt""
    alias s_firebolt "cast "Fire Bolt""
    alias s_firebomb "cast "Fire Bomb""
    alias s_flare "cast "Flare""
    alias s_field "cast "Force Field""
    alias s_greatheal "cast "Greater Heal""
    alias s_haste "cast "Haste""
    alias s_invert "cast "Inversion""
    alias s_invis "cast "Invisibility""
    alias s_lightning "cast "Lightning""
    alias s_missile "cast "Missiles of Magic""
    alias s_protect "cast "Protect From Elements""
    alias s_pull "cast "Pull""
    alias s_push "cast "Push""
    alias s_shock "cast "Shock""
    alias s_slow "cast "Slow""
    alias s_sparkle "cast "Sparkler""
    alias s_beam "cast "Sunbeam""
    alias s_swap "cast "Swap Location""
    alias s_tag "cast "Tag""
    alias s_teleport "cast "Teleport to Target""
    
    //dragoon's direct spellname aliases, unlikely to need them but here they are for example
    alias s_thrower "cast "Flamethrower""
    alias s_blast "cast "Inferno Blast""
    alias s_dash "cast "Dragoon Dash""
    alias s_skin "cast "Salamander Skin""
    alias s_talon "cast "Fiery Talon""
    alias s_flight "cast "Dragoon Flight""
    alias s_blood "cast "Dragon's Blood""
    
    

    This next section realiases the “castslot x” commands to be more convenient “castx” so you don’t need as many quotes. Now, for example, if my cfg has “bind 1 cast1”, hitting the 1 key will cast my spell in slot 1 of the spellwheel. This image depicts how the castslot numbers go around the spellwheel:

    
    //castslot realiases
    alias cast1 "castslot 1"
    alias cast2 "castslot 2"
    alias cast3 "castslot 3"
    alias cast4 "castslot 4"
    alias cast5 "castslot 5"
    alias cast6 "castslot 6"
    alias cast7 "castslot 7"
    alias cast8 "castslot 8"
    alias cast9 "castslot 9"
    alias cast10 "castslot 10"
    alias cast11 "castslot 11"
    alias cast12 "castslot 12"
    alias cast13 "castslot 13"
    alias cast14 "castslot 14"
    alias cast15 "castslot 15"
    alias cast16 "castslot 16"
    
    

    Now comes the tricky shit, since you have to fit up to sixteen aliases between your keyboard and mouse, particularly if you play a clusterfuck like Wizard. It was hard coming up with a decent way to bind this, so I’ll try to leave it open-ended ish and let you pick.

    This following section is one way to go about this. It binds each number to its respective castslot, following on the example I put up earlier (so hitting 1 casts spell 1). This way is nice and simple if you play a class without a lot of spells to bind, and is less of a headache, but is absolute shit for the complex spellcasters since you can’t fit 16 numbers and no one’s reaching over to 0 anyway.

    
    bind 1 "cast1"
    bind 2 "cast2"
    bind 3 "cast3"
    bind 4 "cast4"
    bind 5 "cast5"
    bind 6 "cast6"
    bind 7 "cast7"
    bind 8 "cast8"
    bind 9 "cast9"
    bind 0 "cast10" 
    
    

    If you use the above script, you also need to make sure your number keys are bound to what they are normally in your main autoexec.cfg, so you can use your number keys when not playing RTP. I’ll put in the standard 1=weapon 1, 2 = weapon 2 shit that is by default and that I assume most people use. Put this in your main autoexec if that’s you and for some reason you’re using this shitty setup method.

    
    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 "slot0"
    
    

    Now, I personally dislike using number keys for “active” spells that you use on the move, like offensive spells and teleport, since you need to take a finger off the strafe keys to use the number keys, which fucks with your movement. For this I resort to an uglier beast: A state-switcher. This has the benefit of also giving you ready access to all 16 spells on the wheel.

    
    //non-switching state shit
    bind 1 "cast12"
    bind 2 "cast13"
    bind 3 "cast14"
    bind 4 "cast15"
    bind 5 "cast16"
    bind MOUSE5 "cast4"
    
    //the state-switcher itself
    alias +switcher "bind MOUSE1 "cast1"; bind MOUSE2 "cast3"; bind MOUSE3 "cast2"; bind q "cast7"; bind e "cast8"; bind r "cast9"; bind t "cast10"; bind f "cast11"
    alias -switcher "bind "MOUSE1" "+attack"; bind "MOUSE2" "cast6"; bind "MOUSE3" "cast5"; bind "q" "[YOUR NORMAL Q BIND]"; bind "e" "[YOUR NORMAL E BIND]"; bind "r" "+reload"; bind "t" "[YOUR NORMAL T BIND HERE]"; bind "f" "[YOUR NORMAL F BIND HERE]"
    bind shift "+switcher"
    
    

    This pic sums up how the keys are bound to each spellwheel slot for the above example script:

    As you can see in the picture, while I hold down SHIFT, hitting mouse1 executes cast1, which casts the first spell in my spellwheel, which is the spell in the top-left corner normally accessed by hitting right click + left click and strafing up and to the left. Isn’t this way nicer? Replace the [YOUR NORMAL WHATEVER BIND HERE] section, brackets included, with whatever command that key is bound to normally, keeping the quotes. You can also change shift from being the default “switching” key.

    Note that this script still breaks the number keys 1-5 for normal use, so you still have to put in the following in your main autoexec:

    
    bind 1 "slot1"
    bind 2 "slot2"
    bind 3 "slot3"
    bind 4 "slot4"
    bind 5 "slot5"
    
    

    or whatever your number keys are bound to in normal play. If you need to use shift for something else in normal play you’d also have to rebind it in your main autoexec.cfg as well, though you could just use another switcher script in your autoexec with non-RTP related functions for other games and probably have a free key to take over whatever shift was before.

    Note further that if you kept t bound to spray, “impulse 201” breaks the switcher for t. You have to realias it; i.e

    
    alias spray "impulse 201"
    
    <ETC>... bind "r" "+reload"; bind t "spray"; ...<ETC>
    
    

    Note again that this switcher script is extendable. You can add on extra buttons to go into the switcher by adding their binds for both +switcher and -switcher states, like

    
    //the state-switcher itself with extended functionality to more keys
    alias +switcher "bind MOUSE1 "cast1"; bind MOUSE2 "cast3";   ... <ETC> ...    ; bind g "[EXTRA G FUNCTION]"; bind x "[EXTRA X FUNCTION]"
    alias -switcher "bind "MOUSE1" "+attack"; bind "MOUSE2" "cast6";   ... <ETC> ... ; bind "g" "[DEFAULT G FUNCTION]"; bind "x" "[DEFAULT X FUNCTION]"
    bind shift "+switcher"
    
    

    And finally, attempting to bind NoX emotes to any buttons that use the switcher will not work, even with aliases (i.e “alias medic “say medic!””). I’ve tried this before many times, but the result is always your text entered in chat plainly without being parsed for emote play (admittedly might have some limited applications). If a better coder understands why this is, or sees something else to improve here, I’d appreciate your help.

    EDIT: Fucked up the original numbering like an idiot and left out the f key.



  • So after spending the better part of my time on the server yesterday with Remnic and in Notepad++ instead of the game, I made a script that takes advantage of the new commands that were added to the gamemode. In combination with a state-switcher script that allows you to change the function of extra keys by holding down another (by default shift) this script makes the spell wheel obsolete. I don’t know of a method to make GMod detect when a gamemode is being played, so you’ll have to put this in a file called RTP.cfg or something and execute it whenever you join manually.

    I’m posting this code in parts. The following section consists of direct-spell reference aliases for Wizard and Dragoon, but you generally shouldn’t need direct-spell reference aliases unless you’re playing a class that has more than 16 spells. If someone requests and I have enough time (finals coming up) I’ll add their class choice’s direct-reference spell aliases.

    
    //"are you a bad enough coder to configure the president"
    
    alias s_anchor "cast "Anchor""
    alias s_blink "cast "Blink""
    alias s_burn "cast "Burn""
    alias s_channel "cast "Channel Life""
    alias s_counter "cast "Counter Spell""
    alias s_drain "cast "Drain Mana""
    alias s_electron "cast "Electron Ball""
    alias s_energy "cast "Energy Bolt""
    alias s_firebolt "cast "Fire Bolt""
    alias s_firebomb "cast "Fire Bomb""
    alias s_flare "cast "Flare""
    alias s_field "cast "Force Field""
    alias s_greatheal "cast "Greater Heal""
    alias s_haste "cast "Haste""
    alias s_invert "cast "Inversion""
    alias s_invis "cast "Invisibility""
    alias s_lightning "cast "Lightning""
    alias s_missile "cast "Missiles of Magic""
    alias s_protect "cast "Protect From Elements""
    alias s_pull "cast "Pull""
    alias s_push "cast "Push""
    alias s_shock "cast "Shock""
    alias s_slow "cast "Slow""
    alias s_sparkle "cast "Sparkler""
    alias s_beam "cast "Sunbeam""
    alias s_swap "cast "Swap Location""
    alias s_tag "cast "Tag""
    alias s_teleport "cast "Teleport to Target""
    
    //dragoon's direct spellname aliases, unlikely to need them but here they are for example
    alias s_thrower "cast "Flamethrower""
    alias s_blast "cast "Inferno Blast""
    alias s_dash "cast "Dragoon Dash""
    alias s_skin "cast "Salamander Skin""
    alias s_talon "cast "Fiery Talon""
    alias s_flight "cast "Dragoon Flight""
    alias s_blood "cast "Dragon's Blood""
    
    

    This next section realiases the “castslot x” commands to be more convenient “castx” so you don’t need as many quotes. Now, for example, if my cfg has “bind 1 cast1”, hitting the 1 key will cast my spell in slot 1 of the spellwheel. This image depicts how the castslot numbers go around the spellwheel:

    
    //castslot realiases
    alias cast1 "castslot 1"
    alias cast2 "castslot 2"
    alias cast3 "castslot 3"
    alias cast4 "castslot 4"
    alias cast5 "castslot 5"
    alias cast6 "castslot 6"
    alias cast7 "castslot 7"
    alias cast8 "castslot 8"
    alias cast9 "castslot 9"
    alias cast10 "castslot 10"
    alias cast11 "castslot 11"
    alias cast12 "castslot 12"
    alias cast13 "castslot 13"
    alias cast14 "castslot 14"
    alias cast15 "castslot 15"
    alias cast16 "castslot 16"
    
    

    Now comes the tricky shit, since you have to fit up to sixteen aliases between your keyboard and mouse, particularly if you play a clusterfuck like Wizard. It was hard coming up with a decent way to bind this, so I’ll try to leave it open-ended ish and let you pick.

    This following section is one way to go about this. It binds each number to its respective castslot, following on the example I put up earlier (so hitting 1 casts spell 1). This way is nice and simple if you play a class without a lot of spells to bind, and is less of a headache, but is absolute shit for the complex spellcasters since you can’t fit 16 numbers and no one’s reaching over to 0 anyway.

    
    bind 1 "cast1"
    bind 2 "cast2"
    bind 3 "cast3"
    bind 4 "cast4"
    bind 5 "cast5"
    bind 6 "cast6"
    bind 7 "cast7"
    bind 8 "cast8"
    bind 9 "cast9"
    bind 0 "cast10" 
    
    

    If you use the above script, you also need to make sure your number keys are bound to what they are normally in your main autoexec.cfg, so you can use your number keys when not playing RTP. I’ll put in the standard 1=weapon 1, 2 = weapon 2 shit that is by default and that I assume most people use. Put this in your main autoexec if that’s you and for some reason you’re using this shitty setup method.

    
    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 "slot0"
    
    

    Now, I personally dislike using number keys for “active” spells that you use on the move, like offensive spells and teleport, since you need to take a finger off the strafe keys to use the number keys, which fucks with your movement. For this I resort to an uglier beast: A state-switcher. This has the benefit of also giving you ready access to all 16 spells on the wheel.

    
    //non-switching state shit
    bind 1 "cast12"
    bind 2 "cast13"
    bind 3 "cast14"
    bind 4 "cast15"
    bind 5 "cast16"
    bind MOUSE5 "cast4"
    
    //the state-switcher itself
    alias +switcher "bind MOUSE1 "cast1"; bind MOUSE2 "cast3"; bind MOUSE3 "cast2"; bind q "cast7"; bind e "cast8"; bind r "cast9"; bind t "cast10"; bind f "cast11"
    alias -switcher "bind "MOUSE1" "+attack"; bind "MOUSE2" "cast6"; bind "MOUSE3" "cast5"; bind "q" "[YOUR NORMAL Q BIND]"; bind "e" "[YOUR NORMAL E BIND]"; bind "r" "+reload"; bind "t" "[YOUR NORMAL T BIND HERE]"; bind "f" "[YOUR NORMAL F BIND HERE]"
    bind shift "+switcher"
    
    

    This pic sums up how the keys are bound to each spellwheel slot for the above example script:

    As you can see in the picture, while I hold down SHIFT, hitting mouse1 executes cast1, which casts the first spell in my spellwheel, which is the spell in the top-left corner normally accessed by hitting right click + left click and strafing up and to the left. Isn’t this way nicer? Replace the [YOUR NORMAL WHATEVER BIND HERE] section, brackets included, with whatever command that key is bound to normally, keeping the quotes. You can also change shift from being the default “switching” key.

    Note that this script still breaks the number keys 1-5 for normal use, so you still have to put in the following in your main autoexec:

    
    bind 1 "slot1"
    bind 2 "slot2"
    bind 3 "slot3"
    bind 4 "slot4"
    bind 5 "slot5"
    
    

    or whatever your number keys are bound to in normal play. If you need to use shift for something else in normal play you’d also have to rebind it in your main autoexec.cfg as well, though you could just use another switcher script in your autoexec with non-RTP related functions for other games and probably have a free key to take over whatever shift was before.

    Note further that if you kept t bound to spray, “impulse 201” breaks the switcher for t. You have to realias it; i.e

    
    alias spray "impulse 201"
    
    <ETC>... bind "r" "+reload"; bind t "spray"; ...<ETC>
    
    

    Note again that this switcher script is extendable. You can add on extra buttons to go into the switcher by adding their binds for both +switcher and -switcher states, like

    
    //the state-switcher itself with extended functionality to more keys
    alias +switcher "bind MOUSE1 "cast1"; bind MOUSE2 "cast3";   ... <ETC> ...    ; bind g "[EXTRA G FUNCTION]"; bind x "[EXTRA X FUNCTION]"
    alias -switcher "bind "MOUSE1" "+attack"; bind "MOUSE2" "cast6";   ... <ETC> ... ; bind "g" "[DEFAULT G FUNCTION]"; bind "x" "[DEFAULT X FUNCTION]"
    bind shift "+switcher"
    
    

    And finally, attempting to bind NoX emotes to any buttons that use the switcher will not work, even with aliases (i.e “alias medic “say medic!””). I’ve tried this before many times, but the result is always your text entered in chat plainly without being parsed for emote play (admittedly might have some limited applications). If a better coder understands why this is, or sees something else to improve here, I’d appreciate your help.

    EDIT: Fucked up the original numbering like an idiot and left out the f key.



  • I’d love to reach my thumb all the way from Space to 0 just to cast a spell

    It seems like a no-brainer but considering the pacing of RTP assigning spells to numbers won’t work at all



  • @Samuel:

    I’d love to reach my thumb all the way from Space to 0 just to cast a spell

    It seems like a no-brainer but considering the pacing of RTP assigning spells to numbers won’t work at all

    You read the entire post, right?



  • so that’s what you were up to?

    I’m curious how someone used to the normal spellwheel will deal with someone using this system for spells.



  • @Ed640:

    so that’s what you were up to?

    I’m curious how someone used to the normal spellwheel will deal with someone using this system for spells.

    Put up with my walls of text for a minute here.

    At high-end play, I can see there being a definite advantage. I’ve played enough intensive duel-type games (like MGEMod and endif) to notice that strafing patterns and prediction of human behavior are a large part of deathmatch in general. The game styles follow a format where you’re pitted against one player for an extended amount of time, so observation of your opponent’s style can prove to eventually be a big factor in deciding who wins. I’ve won rounds by switching from short strafes to long strafing patterns, or by always moving right when my opponent thinks I’ll move left; I’ve had people miss me with direct pipes ten, fifteen times in a row without realizing they were still unconsciously trying to fight against the movement pattern I had before. It’s some subtle shit that you can miss out on if you’re not acquainted with it (and here I’m going to make the disclaimer that I’m not even very good at MGEMod; my ELO is sub-1600).

    Now, the way the normal spell wheel is configured encourages players to develop predictable patterns in their playstyle while deathmatching other opponents. It might be conceivably possible, for example, to fight against Kolmio, and notice that (out of my ass example) he always strafes left prior to using Counterspell. I can deduce, over repeated observation, that he therefore has Counterspell bound to one of his left strafe slots. If I fight him later, I can use this knowledge to my advantage in combat; he can’t have Counterspell loaded without strafing left, so he can’t have a Counterspell prepared unless I observe him strafing left. If I later rush him down, attack him with a spell, and he then strafes left, I have a pretty damn good idea of what he’s about to do next. The spellwheel system limits your options and makes your metaphorical hand effortlessly readable by your opponent, unless you use jumps to hide your input (notice how many RTP players rely on constant jumping and have acquired it out of habit unconsciously). Even then, jumping is disadvantageous in games like TF2 and by extension RTP, since you lose movement options and become easier to hit with projectile weapons.

    In short, while it won’t probably make a difference to the majority of us, it will matter between high-level players at an equal skill level, and in that case, the conventional spellwheel user is always at a disadvantage. As for how the spellwheel user would deal with it I’m not sure at all. I have no idea what I would try if I was forced into that situation since my movement is better than my aim.



  • Hate to break it to you but people have been binding their entire keyboard to shock and rolling their face across it for as long as I can remember.



  • @Zetanor:

    Hate to break it to you but people have been binding their entire keyboard to shock and rolling their face across it for as long as I can remember.

    Have they been binding their entire spell wheel selection to their keyboard and rolling their face across it? Or is part of your point that using extra binds is unnecessary because only a few spells are really relevant?



  • I can see how this might be more useful when spells get a cooldown sometime soon and you can’t spam a single low cost spell over and over again just for one guy, and instead of having to remember a certain “dance” when comboing spells, you can easily concentrate on moving smoothly and cast spells from whatever you have bound with this script.

    If someone new started with this system, how much faster would they grasp (atleast spellcasting and fighting) rtp than someone that starts with the basic spellwheel?



  • @Apathetic:

    Have they been binding their entire spell wheel selection to their keyboard and rolling their face across it? Or is part of your point that using extra binds is unnecessary because only a few spells are really relevant?

    Yes. Yes.



  • @Ed640:

    I can see how this might be more useful when spells get a cooldown sometime soon and you can’t spam a single low cost spell over and over again just for one guy, and instead of having to remember a certain “dance” when comboing spells, you can easily concentrate on moving smoothly and cast spells from whatever you have bound with this script.

    If someone new started with this system, how much faster would they grasp (atleast spellcasting and fighting) rtp than someone that starts with the basic spellwheel?

    This only simplifies the control, which makes casting spells more intuitive and reduces the likelihood of fumbling with them when you’re a beginner. It would definitely make transitioning into the game much, much easier, although you’d need to have this .cfg in the first place, so obviously this isn’t intended as a fix-all solution or whatever to the problem of getting newbies into RTP.

    The other thing to consider is that the spells are still spells. They each have their own situational usage and their own respective skill curves. Someone who can’t already lead projectiles isn’t going to become a master wizard in one night because they have this .cfg. They’re still going to miss with firebolt or whatever. Of course, being able to more readily use the spells with easier controls means you can put more effort into actually learning their in-game usage rather than getting accustomed to how to cast them.

    @Zetanor:

    Yes. Yes.

    I’ll take your word for it, then. I apologize for presenting this as though it was novel, but hopefully at least someone else benefits from my putting this script together. As for the imbalance between spells, that’s something no script can remedy, so hopefully Darker can put on a good show later on.


Log in to reply
 

6
Online

11066
Users

15298
Topics

297981
Posts

Looks like your connection to NoXiousNet was lost, please wait while we try to reconnect.