Lightbulb[TUTORIAL] How to get around alias removal

Posts 1–7 of 7 · Page 1 of 1
[TUTORIAL] How to get around alias removal
Since the alias command was removed, it rendered all those with customized toggle binds useless.

While this can't replace the more advanced toggle binds, such as an outfit creation bind, it works well for more specific toggles, like host_timescale and plr_turning_movement_speed_rate_min.

The old method involved alias binds that looked like this
Code:
bind "KP_DOWNARROW" "SpeedToggle"
bind "KP_SLASH" "TimeToggle"
bind "*" "Fire"

alias "SpeedToggle" "speed1"
alias "speed1" "plr_turning_movement_speed_rate_min 6;alias SpeedToggle speed2"
alias "speed2" "plr_turning_movement_speed_rate_min 1;alias SpeedToggle speed1"
alias "TimeToggle" "time1"
alias "time1" "host_timescale 1;alias TimeToggle time2;cc_system_message Scale-1"
alias "time2" "host_timescale 5;alias TimeToggle time1;cc_system_message Scale-5"
alias "Fire" "FF1"
alias "FF1" "mp_friendlyfire 0;alias Fire FF2;cc_system_message Friendly-Fire-Off"
alias "FF2" "mp_friendlyfire 1;alias Fire FF1;cc_system_message Friendly-Fire-On"
The new method involves using incrementvar and bindtoggle instead of alias.

Code:
bind "KP_DOWNARROW" "incrementvar host_timescale 1 5 4"
bind "KP_END" "incrementvar plr_turning_movement_speed_rate_min 1 6 5"
bind "*" "BindToggle mp_friendlyfire"
BindToggle command tutorial:
• bind "*" ... this sets up the key we will use.\
• "BindToggle ... the command needed to make a cycle script toggling between 0 and 1
• mp_friendlyfire" ... the command that will be toggled between 1 and 0.
Every time that you press the bound key, it will toggle back and forth between 1 and 0.

incrementvar command tutorial:
• bind "KP_END" ... this sets up the key we will use.
• "incrementvar ... the command needed to make a cycle script using a set of 3 numbers.
• plr_turning_movement_speed_rate_min ... the cvar or command variable
• 1 ... The first of the set of three numbers... this is the Minimum value.
• 6 ... The second of the set of three numbers... this is the Maximum value.
• 5 ... The third of the set of three numbers... this is called the Delta value. In mathematics it is an incremental change in a variable.

What the command does is first set the console to use the plr_turning_movement_speed_rate_min with an initial value of 1. The incremental value is 5, so upon next usage, it will move up to 6.
Upon the next keystroke, it would attempt to go to 11, but since 6 is the maximum value, it returns back to the minimum value of 1 and starts over.

---EDIT---
Though I had posted this in tutorials, turns out I was in the wrong tab in Firefox. If someone could move this, please and thanks!
okies, let's see if I'm getting this correct

example:
bind "y" "DifficultyToggle"
alias "DifficultyToggle" "diff1"
alias "diff1" "current_combat_difficulty 1;alias DifficultyToggle diff2;cc_system_message Normal Mode"
alias "diff2" "current_combat_difficulty 2;alias DifficultyToggle diff3;cc_system_message Hard Mode"
alias "diff3" "current_combat_difficulty 3;alias DifficultyToggle diff1;cc_system_message Hero Mode"
would now be:
bind "y" "incrementvar current_combat_difficulty 1 3 1"
?

Definitely cuts down on a lot of typing. Is there still a way to embed system messages into the toggles though?

oh and thank you for this. it's new info for me! ^^
Quote Originally Posted by veryvoodoo View Post
okies, let's see if I'm getting this correct
As far as I'm aware you can't incorporate text into the incrementvar or bindtoggle.

But, yes, you did the code properly.

And thanks Dracconus, much appreciated.
Gj man, nice to see some unfamiliar contributors
Thanked, although I already knew about this.
how do i make custom cfg and exec it to set all those commands under 1 bind ?
you can't make the binds read from a config. Well, I take that back, you could, but no one is going to take the time necessary to code something like that when you could just put them into the console you're using anyways. So yeah.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us