Key Binding question

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
User avatar
Caligari87
Admin
Posts: 6233
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Key Binding question

Post by Caligari87 »

I want to have the flashlight and Zoom bindings in my new level. I've imported the code into a keyconf, but I want to have the key changeable by the player. So the player can bind the flashlight toggle to 'G' for example and that key continuously toggles the light. In the original, the flashlight key was hard-bound to 'F'. HELP!

Hope someone understands that...

8-)
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

User avatar
Caligari87
Admin
Posts: 6233
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Post by Caligari87 »

Nope, no help there. I've downloaded that page for reference at home.

For example:

Code: Select all

addmenukey "Flashlight Toggle" flashlight_on
alias flashlight_on "r_visibility 32;bind f flashlight_off"
alias flashlight_off "r_visibility 8;bind f flashlight_on"
defaultbind f flashlight_on
I want to be able to change the bind key so that it stays the same when the player toggles it, not be the same key. If they bind the key to G, it should not rebind to F when it changes.

Understand? I hope so.

8-)
User avatar
Mr. Tee
Posts: 1111
Joined: Sun Feb 08, 2004 7:49 pm
Contact:

Post by Mr. Tee »

There is a way you can do this.

Search for "bind" "toggle" in the forum... I remember someone making an alias that when you first use it, it rebinds itself to turn the feature off the next time you use it, and then resets.
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Post by LilWhiteMouse »

From Hellspawn, modified from Enjay's zooming:

Code: Select all

alias hellspawn_scopein "fov 10; m_pitch .125;m_yaw .2; echo 12X zoom; set autoaim 0; set r_drawplayersprites 0; crosshairgrow 0; puke 700 1; rebind hellspawn_scopeout;" 
alias hellspawn_scopeout "fov 90; m_pitch 1;m_yaw 1; echo zoom reset; set autoaim .5; set r_drawplayersprites 1; crosshairgrow 1; puke 700 2; rebind hellspawn_scopein;"

defaultbind "uparrow" "hellspawn_scopein"
 
addkeysection "Hellspawn" hellspawn_keysection
addmenukey "Use Scope" hellspawn_scopein
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

Ahh, I think I understand now. As with LWM's example, you need to use "rebind."
User avatar
Caligari87
Admin
Posts: 6233
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Post by Caligari87 »

Ah! Thanks. I'll try that. Hope it works :glare: :)

8-)
Post Reply

Return to “General”