home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Binding multiple actions to a single key

by Topher2798 on 02/10/2002 00:04, 21 messages, last message: 06/30/2002 20:32, 3172 views, last view: 05/03/2024 22:35

Is it possible to bind a series of different actions to a single key?

For instance, to simulate a rifle scope you could bind two different keys to zoom in and out such as the following:

bind a fov 20
bind s fov 90

This would of course in effect allow you to zoom in with your scope by pressing the "a" key and then zoom out again by pressing "s".

However, what I am trying to do is bind a single key that will cycle through these two actions. For instance when you press the "a" key it zooms in and then when you press the "a" key a second time, it zooms back out.

I've tried the following list of bindings in the autoexec.cfg but none of them worked:

bind a fov 20 fov 120
bind a "fov 20 fov 120"
bind a fov 20 120
bind a "fov 20 120"

Is it possible to do what I am trying to do? If not, perhaps I should have placed this in the requested features forum.

Go to first 20 messagesGo to previous 20 messages    Board Index   

#2: ..

by Hot on 02/10/2002 20:26

Might it be something like bind \"key\" \"action 1 ; action 2\" or bind \"key\" \"action 1 : action 2\"

reply to this message

#3: Still Trying....

by Topher2798 on 02/10/2002 21:06

To get two keys binding to the same command with a different value, I had to edit the keymap.cfg. It wouldn't work in the autoexec.cfg. So although zooming in and out can be done with two seperate keys, I still haven't found a way to create an alias or script multiple commands to a single key stroke.

Ok, so my next dissapointment was that I went looking for a way to change the "roll". Meaning the way the screen tilts to the left and right when you strafe or sidestep. The way cube "tilts" when strafing is more like the way "Quake" does compared to other FPS games such as UT or Quake III. The constant "swaying" has a tendency to give some people motion sickness. I'm trying to decrease the way the game "rolls" but I cannot figure out the command that will let me change this, or if it's even possible. Anybody else been looking for that one?

reply to this message

#4: Roll

by Bascule on 02/10/2002 22:24

The latest Win32 version (cube_2002_02_03) readme mentions a new command 'maxroll'. No details given, but I suspect that it will sort out your problem :)

reply to this message

#5: solution

by Goetzenzar on 02/11/2002 03:22

write in the autoexec.cfg :

bind q "exec fov30.cfg"

make 2 .cfgs then:
1 called fov30.cfg ,
with the lines:

fov 30
bind q "exec fov120.cfg"

and 1 called fov120.cfg
with the lines:

fov 120
bind q "exec fov30.cfg"

that it. :p
of course there are also slightly other ways, but this should work.

to the maxroll command,
set it to 0 (write "maxroll 0"
in autoexec) to get rid of the tilting.






reply to this message

#6: Maxroll

by Topher2798 on 02/11/2002 05:00

Thanks guys. Yeah, I noticed the maxroll config in the docs shortly after I posted that question. Duh, now I feel stupid. =)

reply to this message

#7: Switching Displays

by Topher2798 on 02/11/2002 05:05

Ok, here's a tough one for you. Anyone know of a way to make CFG files that would change resolution. For instance, being able to execute a config file from the console that would switch your resolution in the middle of a game. Is it possible?

reply to this message

#8: Re: Switching Displays

by Shockie on 04/10/2002 16:34, refers to #7

no, but how do i change the resolution neway? i get 280 fps at 640x480, i wouldnt mind 1024x768

i thought i say it somewhere, but i dont know where

reply to this message

#9: Re: Switching Displays

by eihrul on 04/10/2002 16:39, refers to #8

Does no one read the documentation anymore? :P
cube -w1024 -h768

reply to this message

#10: here

by Goetzenzar on 04/10/2002 18:08

alias zoomin "fov 60;sensitivity 5;bind a zoomout"

alias zoomout "fov 120;sensitivity 10;bind a zoomin"

bind a zoomin

here, this should work

reply to this message

#11: Re: Switching Displays

by Al_Capone on 04/12/2002 05:06, refers to #9

As long it can be found

reply to this message

#12: Re: Switching Displays

by Shockie on 04/12/2002 15:44

thank, but its n the wrong thread

reply to this message

#13: How to include quotes within quotes

by dabugas on 04/18/2002 12:37

I am re-writing my autoxec.cfg and I'm trying to put quote in quotes. In particular, what I'm trying to do is to minimize the amount of configuration files, so I've taken pushplay's (at least I think they were his) .cfgs, and put them in one autoexec.cfg. But, I liked the idea of having a different menus in edit_mode and normal_mode. Currently, I've achieved using the following method...

---

autoexec.cfg:
alias switch_to_edit_mode "edittoggle; exec changemenutoedit.cfg; bind E switch_to_normal_mode; say edit_mode"
alias switch_to_normal_mode "edittoggle; exec changemenutonormal.cfg; bind E switch_to_edit_mode; say play_mode"
bind ESCAPE "showmenu main"
bind E "switch_to_edit_mode"

changemenutoedit:
bind ESCAPE "showmenu editing"

changemenutonormal:
bind ESCAPE "showmenu main"

---

I chould solve all this chaos by replacing, for example:
exec changemenutoedit.cfg
with:
bind E "showmenu editing"

Of course because this second command I've showed you will go in the quotes (because it's in the alias). It won't work. Any ideas?

I tried using " or ` but nothing worked :-(

reply to this message

#14: dunno but try...

by Shockie on 04/18/2002 13:30

try escaping it ie "

reply to this message

#15: ..

by Shockie on 04/18/2002 13:31

ok, didnt show, put a backslash infront

\"

reply to this message

#16: hmmm

by pushplay on 04/18/2002 17:12

At first I was going to suggest making an alias, but you would probably run into the same problem. You could have it execute a file which redefines the menu, instead of calling a different one. But then you have multiple files again.

I never split things up just because it would make the file too long and confusing.

reply to this message

#17: use aliases

by Aardappel on 04/20/2002 00:08

whenever you need to use quotes in quotes, use an alias instead of the inner quotes instead.

reply to this message

#18: Re: use aliases

by dabugas on 04/20/2002 20:25, refers to #17

Thanks, the code, for anyone interested in using pushplay's menus without having several .cfg (because like me, they have managed to fit all keybindings in one):

---

alias switch_to_edit_mode "edittoggle; bind ESCAPE switch_to_edit_mode_part_2; bind E switch_to_normal_mode; say edit_mode"
alias switch_to_edit_mode_part_2 "showmenu editing"
alias switch_to_normal_mode "edittoggle; bind ESCAPE switch_to_normal_mode_part_2; bind E switch_to_edit_mode; say play_mode"
alias switch_to_normal_mode_part_2 "showmenu main"

---

Yes, it _could_ be clearer :-) I just like long names.

reply to this message

#19: Sniper-zoom alias

by DeFrag on 06/30/2002 05:14

bind Z "zoomhalf"

alias zoomhalf [ fov 60; sensitivity 4; weapon 4; bind Z "zoomall"]
alias zoomall [ fov 30; sensitivity 2; bind Z "zoom0"]
alias zoom0 [ fov 120; sensitivity 6; bind Z "zoomhalf"]

reply to this message

#20: Re: Sniper-zoom alias

by Shockie on 06/30/2002 10:16, refers to #19

whats with the [ ] in the alias's?

reply to this message

#21: oops

by DeFrag on 06/30/2002 20:32

hehe worked anyway
i'll strip

reply to this message

Go to first 20 messagesGo to previous 20 messages    Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53868344 visitors requested 71643515 pages
page created in 0.013 seconds using 10 queries
hosted by Boost Digital