Forums » Suggestions

Some requests regarding aliases/binds

Jul 08, 2003 vx link
There are a few things that aliases and binds are missing that I'd like to see.

For example, what would one expect the following to do?
alias Cycle1 "echo 1;alias -Cycle Cycle2"
alias Cycle2 "echo 2;alias -Cycle Cycle1"
alias +Cycle "echo 0"
alias -Cycle "Cycle1"

bind something to +Cycle and try it. The result is bizarre.

What should happen is on key down, it should echo 0, then when the key is released, echo 1 the first time, 2 the second, then 1 again, and so on.

What happens is that when the bound key is pressed, you see 0 then shortly after 0,1,2,0,1,2,0,1,2..., (I'm using commas to separate lines) as the keyboard repeat takes effect, which it probably shouldn't. Not only that, but look at the order - even given keyboard repeating, it should be 0,1,0,2,0,1,0,2... Also, when you lift the key, an extra 1,2 appears, where one would expect only a 1 or a 2.

The next thing I'd want after that's fixed is the ability to put pauses into the commands, so that say, one could define a command to fire only once, or turn for a given amount of time. (actually, builtins for these particular actions would be nice, as, for example the different firing rates on weapons would make a fire_once alias difficult to code, if possible.)

After that would come the ability to set new cvars and interpolate them into aliases and binds.

The previous requests all should be fairly simple to add to the existing codebase, I think (he says, not having seen the code), unless that first one turns out to be a particularly nasty bug - it certainly seems to indicate that the input method might need changing. However, now on to some more whimsical requests. :)

Triggers would also be very, very sweet. (This was recently suggested by someone else for the purposes of a music switcher.) They'll probably be easy once the event system is in place. It would also be useful to let teammates know what you were doing in the middle of battle (i.e. something like /onjumpgate team "Jumping to $to_sector."), periodically report health during missions, etc.

Of course, at some point, it would probably be coolest of all to write up a nice Lua API and let us define our aliases, triggers, binds, functions, variables and whatnot in Lua. :) This might be seen as going too far, as people might write bots to control their player's actions, but I say let them. If it's easier to code a bot to fight for you in-game than to play yourself, well... it isn't, as is quite clear from the in-game bots. ;) More power to you if you can easily code AI that well.

In my opinion, the nice ability for players to shape gameplay that would come of it would be worthwhile.

- Mesostel Ze
Jul 09, 2003 Eldrad link
Here's another thing that should work... but instead crashes you.

/alias test1 "alias test 'echo 1'"
/alias test test1
/test