Customizing/Binding: Difference between revisions

m
mentioned the use of film-jumping in speedruns
(total review, rewrite and update)
m (mentioned the use of film-jumping in speedruns)
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="toclimit-2">__TOC__</div>
In the absence of a control settings screen within Oni, most players set their key bindings manually by editing '''[[key_config.txt]]''', though there are GUI solutions like [[Oni Key Editor]] and [[KeyConfig]].
{{UpdatedForOniX|1.0.0}}
{{TOClimit}}
==How to bind keys==
==How to bind keys==
When you want to add your own controls to '''key_config.txt''', make sure you do it underneath the heading "unbindall". To reset your bindings to default, delete key_config.txt and launch Oni to get a clean binding config generated.
When changing/adding bindings, make sure you do it underneath the "unbindall" command. To reset your bindings to default, delete key_config.txt and launch Oni to generate a clean version of the file.


The bind command is structured the following way:
The bind command is structured the following way:
  bind *key* to *action*
  bind *key* to *action*


So if you would want to bind "kick" to '/' you would type:
So if you wanted to kick with the '/' key, you would type:
  bind slash to kick
  bind slash to kick


Bindings that can't be changed are :
To disable a binding without removing it from the file, comment it out with the '#' symbol:
*'''F8''' and '''Shift+F8''' (cycles through available characters when '''shapeshifter''' or [[Dev Mode]] is enabled)
#bind slash to kick
*'''Esc''' (toggles Main Menu while playing).


==Bindable keys==
==Bindable key names==
To see if the key or button you're trying to bind to is being received by Oni, you can enter <tt>chr_debug_characters=1</tt> on the console and watch the keypress event bitset in the display at the upper-right; it should be changing as you press and hold keys.
Below are the names of the keys you can bind actions to. Keys attached to developer functions have default key bindings that don't show up in key_config.txt; the keys which are likely to trigger a function when Developer Mode is on are listed in the table below. See [[Developer Mode]] for all the bindings. Note that these default bindings cannot be unbound, even though new actions can be bound to the same keys. Let's say that you added <code>bind fkey8 to swap</code> to key_config.txt. When Developer Mode is off, F8 will draw your weapon, and when Dev Mode is on it will cycle through playable characters.
 
To see if the key or button you're trying to bind to is being received by Oni, you can enter <tt>chr_debug_characters=1</tt> into the developer console and watch the keypress event bitset in the display at the upper-right; it should be changing as you press and hold keys. Note that '''Esc''' is hardcoded to toggle the Main Menu and cannot be bound to anything else.


{|class="wikitable" style="margin-left:auto; margin-right:auto;"
{|class="wikitable" style="margin-left:auto; margin-right:auto;"
!Key description
!Key description
!Syntax
!Name
!Reserved in Dev Mode
|-
|-
|Mouse/joystick/gamepad horizontal/vertical/other axis
|Mouse/joystick/gamepad horizontal/vertical/other axis
|mousexaxis, mouseyaxis, mousezaxis
|mousexaxis, mouseyaxis, mousezaxis
| -
|-
|-
|Mouse/joystick/gamepad button 1 ... 4
|Mouse/joystick/gamepad button 1 ... 4
|mousebutton1 ... mousebutton4
|mousebutton1 ... mousebutton4
| -
|-
|-
|0 ... 9, A ... Z
|0 ... 9, A ... Z
|0 ... 9*, a ... z (lowercase)
|0 ... 9<ref name="numpad" />, a ... z (lowercase)
| -
|-
|-
|F1 ... F12 ... F15
|F1 ... F12 ... F15
|fkey1 ... fkey12 ... fkey15
|fkey1 ... fkey12 ... fkey15
|F2, F3, F6, F7, F8, F9, F10, F11
|-
|-
|Up/Down/Left/Right Arrow
|Up/down/left/right arrow
|uparrow, downarrow, leftarrow, rightarrow
|uparrow, downarrow, leftarrow, rightarrow
|All arrow keys
|-
|-
|Space, Backspace, Tab, Enter
|Space, Backspace, Tab, Enter
|space, backspace, tab, enter
|space, backspace, tab, enter
|Enter
|-
|-
|Num Pad 0 ... Num Pad 9
|Num Pad 0 ... Num Pad 9
|(PC only) numpad0 ... numpad9*
|numpad0 ... numpad9<ref name="numpad">On Macs, bindings using <tt>0 ... 9</tt> will be bound to both the keyboard's and numeric pad's 0-9 keys in lieu of support for num pad-specific bindings on Mac.</ref>
| -
|-
|-
|Num Pad '''* / + - .'''
|Num Pad * / + - .
|multiply, divide, add, subtract, decimal
|multiply, divide, add, subtract, decimal
| -
|-
|-
|Num Pad Enter, Num Pad =
|Num Pad Enter, Num Pad =
|numpadenter, numpadequals
|numpadenter, numpadequals
| -
|-
|-
|Print Screen, Pause, Insert, Delete
|Print Screen, Pause, Insert, Delete
|printscreen, pause, insert, delete
|printscreen, pause, insert, delete
| -
|-
|-
|Page Up/Down, Home, End
|Page Up/Down, Home, End
|pageup, pagedown, home, end
|pageup, pagedown, home, end
|Page Up/Down, End
|-
|-
|Caps Lock, Num Lock, Scroll Lock
|Caps Lock, Num Lock, Scroll Lock
|capslock, numlock, scrolllock
|capslock, numlock, scrolllock
| -
|-
|-
|<tt>, . ; '</tt>
|<tt>, . ; '</tt>
|comma, period, semicolon, apostrophe
|comma, period, semicolon, apostrophe
|. (period)
|-
|-
|[ ] / \
|[ ] / \
|rightbracket, leftbracket, slash, backslash
|rightbracket, leftbracket, slash, backslash
|[, ] and /
|-
|-
|Left/Right Shift
|Left/Right Shift
|leftshift/rightshift
|leftshift/rightshift
| -
|-
|-
|Left/Right Control
|Left/Right Control
|leftcontrol/rightcontrol
|leftcontrol/rightcontrol
| -
|-
|-
|Left/Right Alt
|(Windows only) Left/Right Alt
|leftalt/rightalt
|leftalt/rightalt
| -
|-
|-
|(Mac only) Left/Right Option
|(Mac only) Left/Right Option
|leftoption/rightoption
|leftoption/rightoption
| -
|-
|-
|(PC only) Left/Right Windows
|(Windows only) Left/Right Windows
|leftwindows/rightwindows
|leftwindows/rightwindows
| -
|}
|}


<nowiki>*</nowiki>On Macs, bindings using "0-9" will be bound to both the keyboard and numpad 0-9 (in lieu of separate numpad bindings on Mac).
<references />


==Regular bindable events==
==Bindable action names==
{|class="wikitable" style="margin-left:auto; margin-right:auto;"
{|class="wikitable" style="margin-left:auto; margin-right:auto;"
!Event description
!Action
!Syntax
!Name
!Restrictions
!<tt>[[#lock_keys|lock_keys]]</tt> group
!<tt>[[#lock_keys|lock_keys]]</tt> group
|-
|-
|Horizontal/Vertical Aiming
|Horizontal/Vertical Aiming
|aim_lr/aim_LR, aim_ud/aim_UD
|aim_lr/aim_LR, aim_ud/aim_UD
|NOT AFFECTED
| -
|'''cannot be locked'''
|-
|-
|Forward, Backward, Strafe Left/Right
|Forward, Backward, Strafe Left/Right
|forward, backward, stepleft, stepright
|forward, backward, stepleft, stepright
| -
|<tt>keys_movement</tt>
|<tt>keys_movement</tt>
|-
|-
|Turn Left/Right (DOOM-style)
|Turn Left/Right
|turnleft/turnright
|turnleft/turnright
| -
|<tt>keys_all</tt>
|<tt>keys_all</tt>
|-
|-
|Jump, Crouch, Walk
|Jump, Crouch, Walk
|jump, crouch, [[#walk|walk]]
|jump, crouch, [[#walk|walk]]
| -
|<tt>keys_jump, keys_crouch, keys_walk</tt>
|<tt>keys_jump, keys_crouch, keys_walk</tt>
|-
|-
|Draw/Holster Weapon, Pick Up
|Draw/Holster Weapon, Pick Up
|swap
|swap
| -
|<tt>keys_inventory</tt>
|<tt>keys_inventory</tt>
|-
|-
|Drop Weapon
|Drop Weapon
|drop
|drop
| -
|<tt>keys_inventory</tt>
|<tt>keys_inventory</tt>
|-
|-
|Reload Weapon
|Reload Weapon
|reload
|reload
| -
|<tt>keys_reload</tt>
|<tt>keys_reload</tt>
|-
|Weapon Safety
|weapon_safety
|Intel Mac build only
|<tt>keys_all</tt>
|-
|-
|Punch, Kick, Fire1 ... Fire3
|Punch, Kick, Fire1 ... Fire3
|punch, kick, [[#fire1, fire2, fire3|fire1 ... fire3]]
|punch, kick, [[#fire1, fire2, fire3|fire1 ... fire3]]
| -
|<tt>keys_attack</tt>
|<tt>keys_attack</tt>
|-
|-
|Use Hypo
|Use Hypo
|hypo
|hypo
| -
|<tt>keys_hypo</tt>
|<tt>keys_hypo</tt>
|-
|-
|Use Console/Door, Talk, Taunt,
|Use Console/Door, Talk, Taunt
|action
|action
| -
|<tt>keys_action</tt>
|<tt>keys_action</tt>
|-
|-
|Escape/Resume
|Escape/Resume
|escape
|escape
|NOT AFFECTED
| -
|'''cannot be locked'''
|-
|-
|Pause Screen
|Pause Screen
|pausescreen
|pausescreen
| -
|<tt>keys_pause</tt>
|<tt>keys_pause</tt>
|-
|-
|Look Mode
|Look Mode
|[[#lookmode|lookmode]]
|[[#lookmode|lookmode]]
| -
|<tt>keys_all</tt>
|<tt>keys_all</tt>
|-
|-
|Screenshot
|Screenshot
|[[#screenshot|screenshot]]
|[[#screenshot|screenshot]]
|NOT AFFECTED
| -
|'''cannot be locked'''
|-
|''Use Cheat''
|''cheatcode'', e.g. fatloot
| Requires Daodan DLL or Intel Mac build
|<tt>keys_all</tt>
|-
|-
|Start/Stop/Play Record
|Open Developer Console
|console
| Developer Mode must be active
|'''cannot be locked'''
|-
|Start/Stop/Play Recording
|[[#start_record, stop_record, play_record|start_record, stop_record, play_record]]
|[[#start_record, stop_record, play_record|start_record, stop_record, play_record]]
|<tt>keys_all</tt>
| -
|'''cannot be locked'''
|-
|-
|Custom Animations 1 and 2
|Custom Animation Binding 1 and 2
|[[#cutscene1, cutscene2|cutscene1, cutscene2]]
|[[#cutscene1, cutscene2|cutscene1, cutscene2]]
|<tt>keys_all</tt>
| Must be recording a film
|'''cannot be locked'''
|-
|[[#Detached camera controls|Detached camera controls]]
|man_cam_move_up, man_cam_move_down,<br>man_cam_move_left, man_cam_move_right,<br>man_cam_move_forward, man_cam_move_backward,<br>man_cam_pan_up, man_cam_pan_down, <br>man_cam_pan_left, man_cam_pan_right
| Developer Mode must be active
|'''cannot be locked'''
|}
|}


===lock_keys===
===lock_keys===
<tt>lock_keys</tt> is a [[BSL]] command used by Oni in the Training level to prevent the player from doing certain actions until he is prompted to. The keys were arranged for this purpose in "lock groups", the names for which are given above. Passing one of those names to <tt>lock_keys</tt> prevents that kind of input.
<tt>lock_keys</tt> is a [[BSL]] command used by Oni in the Training level to prevent the player from doing certain actions until he is prompted to. The keys were arranged for this purpose into "lock_keys groups", the names for which are given above. Passing one of those names to <tt>lock_keys</tt> prevents that kind of input.


===fire1, fire2, fire3===
===fire1, fire2, fire3===
Line 169: Line 229:


===screenshot===
===screenshot===
*This stores a screenshot in uncompressed BMP format in Oni's folder, with the generic name '''screen_shot#####.bmp'''.
*This stores a screenshot in BMP format (an uncompressed bitmap) in Oni's folder with the name '''screen_shot#####.bmp'''.
*The size of the screenshot is normally the resolution specified in '''Options''', but you can set the runtime variable <tt>gs_screen_shot_reduce</tt> to downsample the bitmap by a factor of 2 to that power.<br>Thus, if you play Oni in 640x480, the bitmaps you'll get will be:
*The size of the screenshot is normally the resolution of the game, as specified in '''Options''', but you can set the runtime variable <tt>gs_screen_shot_reduce</tt> using the Developer Mode console to downsample the bitmap by a power of 2.<br>Thus, if you play Oni in 640x480, the bitmaps you'll get will be:
**640x480 if <tt>gs_screen_shot_reduce= 0</tt> (default)
**640x480 if <tt>gs_screen_shot_reduce=0</tt> (default)
**320x240 if <tt>gs_screen_shot_reduce= 1</tt>
**320x240 if <tt>gs_screen_shot_reduce=1</tt>
**160x120 if <tt>gs_screen_shot_reduce= 2</tt>....
**160x120 if <tt>gs_screen_shot_reduce=2</tt>....
*See the [[:Category:Screenshots]] page for tips on taking screenshots efficiently and without the HUD in the way.


===start_record, stop_record, play_record===
===start_record, stop_record, play_record===
Line 185: Line 246:
====What you can use it for====
====What you can use it for====
*You can use this feature to "teleport" back to a place where you've already been. "Plant" a "teleporter" by pressing <tt>start_record</tt> then <tt>stop_record</tt> right afterwards; at any later time, pressing <tt>play_record</tt> will bring you back to the last "teleporter" you have thus "planted".
*You can use this feature to "teleport" back to a place where you've already been. "Plant" a "teleporter" by pressing <tt>start_record</tt> then <tt>stop_record</tt> right afterwards; at any later time, pressing <tt>play_record</tt> will bring you back to the last "teleporter" you have thus "planted".
*Expert gamers have used the above "teleporting" technique to perform so-called "film-jumping".
*Expert gamers have used the above "teleporting" technique to perform so-called "film-jumping", which is abused in [[Videos#any%|any% speedruns]].


===cutscene1, cutscene2===
===cutscene1, cutscene2===
====What it's meant for====
====What it's meant for====
This is another feature of the cutscene authoring process detailed above
This is another part of the cutscene authoring process detailed above. First you set up the bindings using the BSL variables sc_bind_f2 and sc_bind_f2, then you start recording a cutscene, then you press <tt>cutscene1</tt> or <tt>cutscene2</tt> to play back the animation.
*The 2 runtime variables '''sc_bind_f2''' and '''sc_bind_f3''' can be set to hold the names of 2 arbitrary animations, say:
*Here's how the first step would look:
  sc_bind_f2= "KONCOMsuper_kick";
  sc_bind_f2="KONCOMsuper_kick";
  sc_bind_f3= "KONOKOendpowerup";
  sc_bind_f3="KONOKOendpowerup";
*Those two animations can then be applied to the authored character at any time during the authoring, by the pressing the '''cutscene1''' or '''cutscene2''' key.
*Then press F9 to start recording a film. The cutscene keys do not work otherwise.
*The custom animation's name is stored in the event buffer, so the ''authored'' animations will appear during playback even if '''sc_bind_f2''' and '''sc_bind_f3''' are changed while recording or before playback.
*Then press F2 or F3 (or your custom binding) to play the designated animation.
*The custom animations' names are stored in the event buffer, so the right animations will appear during playback even if '''sc_bind_f2''' and '''sc_bind_f3''' are changed afterward.


====What you can use it for====
====What you can use it for====
*You can use it for playing custom animations (like normally unavailable combat moves) in-game, any time you want.
*You can use it for playing custom animations in-game (like normally unavailable combat moves), any time you want, as long as you press the <tt>start_record</tt> key first.
*Just press the <tt>start_record</tt> key, and the two custom animations (Konoko's Super Kick and Outro Daodan Blast in the example above) will be available ''via'' the keys you bound to <tt>cutscene1</tt> and <tt>cutscene2</tt>.
 
==Developer Mode-bindable events==
These events only work when [[Developer Mode]] is active.


===Detached camera controls===
===Detached camera controls===
These controls are automatically bound to the numeric keypad in Windows, but Oni for the Mac lacks those bindings.  To control the free-flying camera on the Mac, add bindings to key_config.txt for the following events:
See the [[Developer Mode]] page for where and how to use these controls.
*man_cam_move_up/down/left/right/forward/backward
*man_cam_pan_up/down/left/right


==Unbindable events==
====Missing Mac controls====
To our knowledge, these events cannot be bound to custom keys, even in Developer Mode. However, their default keys are noted when available (Dev Mode must be on).
The camera-panning movements for Mac are automatically bound to the numeric keypad in Oni, but Oni for the Mac lacks the ability to bind keys to the numpad, so these controls will be missing. To fully control the free-flying camera on the Mac, add bindings to key_config.txt for the following four events:
 
*man_cam_pan_up
{|class="wikitable" style="margin-left:auto; margin-right:auto;"
*man_cam_pan_down
!Event name
*man_cam_pan_left
!Description
*man_cam_pan_right
!Dev Mode binding
The Mac treats the key bindings "0-9" as both "0-9" and "numpad0-numpad9", so if you bind the above movements as follows, you can use the numeric pad just as Bungie West intended the Mac build to work:
|-
bind 8 to man_cam_pan_up
|unstick
bind 2 to man_cam_pan_down
|Moves the player forwards (no-clipping)
bind 6 to man_cam_pan_left
|Ctrl+Shift/Alt+U
bind 4 to man_cam_pan_right
|-
|profile_toggle
|Runtime profiling (obsolete?)
|Ctrl+Shift/Alt+\
|-
|record_screen
|Dumps a screenshot for every frame into Oni folder
|Ctrl+Shift/Alt+L
|-
|delete_flag, add_flag (obsolete?)
|Manages flags near player's position
|
|-
|f4, f5, f6, f7, f8, f12
|Yes, those are events, not key names (obsolete?)
|
|-
|camera_record, camera_stop, camera_play
|Not working
|
|-
|place_quad, place_quad_mode
|Not working
|
|-
|secretx, secrety, secretz
|Not working
|
|}


[[Category:Oni Support]]
[[Category:Oni Support]][[Category:OniX-affected articles]]