Author Topic: [SOLVED] Toggling boost movement  (Read 4830 times)

Urcscumug

  • Posts: 278
  • Turrets: +18/-7
    • Wraths Newbie Server
[SOLVED] Toggling boost movement
« on: December 07, 2008, 12:03:03 pm »
(This is about playing as human, BTW.)

I've seen that I can bind WASD to "boost" in addition to the actual move, which gets me automatic sprinting all time. I've do so for back (S) because most of the time you're gonna retreat it helps to be sprinting (it does more than help, it's the one thing keeping you one step away from the alien).

Example:
Code: [Select]
bind s "+back;boost"You can do the same for all four keys (probably jump and crouch as well, to take effect when jetting.)

Except I don't want to do it automatically all the time. I wanted to design a key that would toggle using boost for WAD. In theory it's simple (I'll exemplify with just W, to keep it short):

Code: [Select]
set wboost "+forward;boost"
set boostmove "bind W vstr wboost; bind CTRL vstr normalmove; echo NORMAL MOVE ACTIVE"
set normalmove "bind W +forward; bind CTRL vstr boostmove; echo BOOST MODE ACTIVE"
bind CTRL vstr normalmove

This is where trouble begins. When I bind W to a single action it's perfectly alright to do it directly in normalmove. But if I want 2+ actions I can't, because there's no way to use quotes inside quotes (is there?) and it would get confused with the following commands. So I need to set a variable for those 2 commands and bind W to the vstr. But this doesn't work as intended; when I press W, both +forward and boost remain activated permanently and I can't turn them off anymore (I keep sprinting forward).

Let me put it another way. If I do bind W "+forward;boost" it works as intended. If I set "+forward;boost" in a variable and do bind W vstr variable, the commands in variable are repeated over and over forever. This only happens with moving and boost, however, not all commands.

Any solution? I'm using the 1.1.0 client, BTW.
« Last Edit: December 13, 2008, 01:55:16 pm by Urcscumug »
New to Tremulous? Look up the Wraths Newbie Server in the in-game server list.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Toggling boost movement
« Reply #1 on: December 07, 2008, 01:55:45 pm »
try something like:
set wboost "bind w +forward;boost"
set boostmove "vstr wboost; bind CTRL vstr normalmove; echo NORMAL MOVE ACTIVE"
set normalmove "bind W +forward; bind CTRL vstr boostmove; echo BOOST MODE ACTIVE"
bind CTRL vstr normalmove
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Urcscumug

  • Posts: 278
  • Turrets: +18/-7
    • Wraths Newbie Server
Re: Toggling boost movement
« Reply #2 on: December 07, 2008, 02:31:01 pm »
Code: [Select]
set wboost "bind w +forward;boost"
Doesn't work. If you don't put +forward;boost in quotes it treats them as separate commands. It binds W to +forward, then does a boost.
New to Tremulous? Look up the Wraths Newbie Server in the in-game server list.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Toggling boost movement
« Reply #3 on: December 07, 2008, 04:45:15 pm »
You could stick the bind w "+forward;boost" in a config file and then exec it.  Totally hacky and shit, but should work.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Urcscumug

  • Posts: 278
  • Turrets: +18/-7
    • Wraths Newbie Server
Re: Toggling boost movement
« Reply #4 on: December 07, 2008, 05:10:33 pm »
:D That worked.

I've also noticed that A and D (side moves) do not make use of sprinting, so with S bound at all times it's only W left. But even so, here it is:

Code: [Select]
set boostmove "exec personal/helper_boost.cfg; bind CTRL vstr normalmove; echo NORMAL MOVE ACTIVE"
set normalmove "bind w +forward; bind CTRL vstr boostmove; echo BOOST MODE ACTIVE"
bind CTRL vstr normalmove

And in helper_boost.cfg:

Code: [Select]
bind w "+forward;boost"
Thank you.
New to Tremulous? Look up the Wraths Newbie Server in the in-game server list.

Colynn'

  • Posts: 308
  • Turrets: +28/-35
Re: Toggling boost movement
« Reply #5 on: December 07, 2008, 07:32:54 pm »
Currently working on: REAL LIFE STUDIES BULLSHIT

Urcscumug

  • Posts: 278
  • Turrets: +18/-7
    • Wraths Newbie Server
Re: Toggling boost movement
« Reply #6 on: December 08, 2008, 06:47:14 pm »
One question: I see that you too have assigned boost to left and right strafe. But does it do anything? I noticed that stamina doesn't drop even if you do this.
New to Tremulous? Look up the Wraths Newbie Server in the in-game server list.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Toggling boost movement
« Reply #7 on: December 08, 2008, 07:30:10 pm »
One question: I see that you too have assigned boost to left and right strafe. But does it do anything? I noticed that stamina doesn't drop even if you do this.
apparently not:
Code: [Select]
  aForward  = abs( ucmd->forwardmove ); 
//...
  if( aForward <= 64 )
      client->ps.stats[ STAT_STATE ] &= ~SS_SPEEDBOOST;
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Urcscumug

  • Posts: 278
  • Turrets: +18/-7
    • Wraths Newbie Server
Re: Toggling boost movement
« Reply #8 on: December 08, 2008, 08:16:50 pm »
I guess I can't argue with the source code... Although everything I've tried seems to contradict it. For instance, I shot the rifle at a wall while moving in boost and normal mode respectively and counted the bullet marks. Same thing in both cases. It's not a fault in my toggle binds, it does the same if I use a key to engage boost.
New to Tremulous? Look up the Wraths Newbie Server in the in-game server list.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Toggling boost movement
« Reply #9 on: December 08, 2008, 10:20:22 pm »
I guess I can't argue with the source code... Although everything I've tried seems to contradict it. For instance, I shot the rifle at a wall while moving in boost and normal mode respectively and counted the bullet marks. Same thing in both cases. It's not a fault in my toggle binds, it does the same if I use a key to engage boost.
the source code confirms your tests, my comment was because i always thought otherwise.
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----