collapse

* Notice

Important notice (31 July): We have recently recovered from a nearly two day downtime due to an attack. No data was lost or stolen but the server has been reinstalled as a precaution. Please let us know if you encounter any issues. We apologise for the unacceptable inconvenience. Please read here for more information.

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Key binding.  (Read 2033 times)

Offline Acleacius

  • Antediluvian
  • *****
  • Posts: 927
  • Reputation: +447/-3
Key binding.
« on: May 07, 2011, 04:00:26 pm »
Is there a way to bind a key to set "FoV 20" then on release "Fov 90"?

I've found a few Source Engine Binding structures but haven't been able to figure it out yet.

Quote
bind [key, command] - Binds the stated command to the specified key (e.g. bind Z console binds the Z key to opening the command console).

bindtoggle [key, command] - Same as the bind command, except the assigned key can be used to both turn the command on and off (e.g. bindtoggle F cl_showfps 2 means the F key will toggle the FPS counter on or off).

unbind [key] - Removes any bindings from the specified key.

unbindall - Removes bindings from all keys.

alias [aliasname, command] - Gives a command a short name (e.g. alias taunt echo I am your new King! changes 'taunt' into a command which spits out "I am your new King" when used). Use alias as a shortcut for long or complex command strings.

key_findbinding [command] - Find the key bound to the specified command.

key_listboundkeys - Lists all the keys which currently have a binding.

This is how it would look in the Unreal Engine games.
Quote
Ctrl=FOV 20 | OnRelease FOV 90


Thanks. 
Trust me, most of the names I have been called you can't translate in any language...they're not even real words as much as a succession of violent images.

Offline int9

  • Fledgling
  • *
  • Posts: 14
  • Reputation: +22/-0
Re: Key binding.
« Reply #1 on: May 08, 2011, 11:48:00 pm »
Try
Code: [Select]
alias +Zoom FoV 20
alias -Zoom FoV 90
bind <key> +Zoom

Offline Acleacius

  • Antediluvian
  • *****
  • Posts: 927
  • Reputation: +447/-3
Re: Key binding.
« Reply #2 on: May 12, 2011, 01:44:26 pm »
Thanks int9, for some reason it just goes directly to fov 90 and doesn't switch between the two view distances.

Maybe I can try to have completely different key for each fov 20 and fov 90.
Trust me, most of the names I have been called you can't translate in any language...they're not even real words as much as a succession of violent images.

Offline Malkav

  • Antediluvian
  • *****
  • Posts: 1782
  • Reputation: +392/-13
Re: Key binding.
« Reply #3 on: May 13, 2011, 08:26:42 am »
Try something like this in autoexec.cfg:

alias run "-speed;bind SHIFT walk"
alias walk "+speed;bind SHIFT run"
bind SHIFT walk
This is for binding the toggle walk/run funktion to the SHIFT key.
For your purpose it would be something like

alias zoom "FoV 20;bind [key] unzoom"
alias unzoom "FoV 90;bind [key] zoom"
bind [key] zoom

where [key] is the key you want to bind the toggle view to. I haven't tested this, so I can't guarantee that it will work, and perhaps you have to change the syntax for the FoV command a bit. Maybe start with bind unzoom...

Edit: Now I have tested it. It works exactly the way I scripted it here. But I think FoV 20 is a bit exteme, 45 would be better.
« Last Edit: May 13, 2011, 09:17:14 am by Malkav »
Co Author of Camarilla Edition Mod

Offline Acleacius

  • Antediluvian
  • *****
  • Posts: 927
  • Reputation: +447/-3
Re: Key binding.
« Reply #4 on: May 15, 2011, 12:18:25 am »
Tyvm Malkav, your probably right about 20 being too much. Since I never got it working, never really had a chance to tweak it.

I'll give it a try, just started playing Rift (mmog) and I have to reinstall Bloodlines as I finally got my main PC back up, but have to redo most all drives.


Thanks again.  :)
Trust me, most of the names I have been called you can't translate in any language...they're not even real words as much as a succession of violent images.

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal