Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
invictius

Zdoom, can I bind a key combo to a single command?

Recommended Posts

I think you could bind Alt to set value to a custom console variable depending on whether it is pressed or not, and bind 0 to check the value of this variable and enter/toggle god mode if the value indicates that Alt is currently pressed.

Share this post


Link to post

No, you cannot.

Look at how the game works: All of the 'shift' keys are bound to some in-game operation by default, which makes it problematic to use them as modifiers.

For obvious reasons this cannot be changed without creating a big mess with the control setup.

Share this post


Link to post

Well, then he can't use Alt for any other form of control, but since that's a hack at best the results may not be consistent.

But the reasoning for how this is done stands and won't be changed. The keys are standard mapping for basic game functions which prevent their use as proper modifier.

Share this post


Link to post

I have what I call the 'cheat panel' in my ZDoom setup - I've bound all of the cheats I use when testing my maps (god, noclip, fly, freeze, resurrect, kill etc) to the number pad on the right of my keyboard. Perhaps this will be of more use than trying to setup hacky bindings which involve multiple keys?

Share this post


Link to post
Dragonfly said:

I have what I call the 'cheat panel' in my ZDoom setup - I've bound all of the cheats I use when testing my maps (god, noclip, fly, freeze, resurrect, kill etc) to the number pad on the right of my keyboard. Perhaps this will be of more use than trying to setup hacky bindings which involve multiple keys?


How do I go about doing that? I don't need to bind shift, alt or anything at all, I was just using that as an example. Q + down would be fine, or anything + anything that the port permits.

Share this post


Link to post

Dragonfly means that he binds each action to a single button as usual, he chooses the numpad just because it's far-enough away from the alphabetical keyboard keys to be triggered by accident, which makes it a good place for cheats and actions that spoil the game and that you generally don't want to trigger by accident.

Share this post


Link to post

@invictius: Take a look at the following script I wrote for C&C Renegade-style binds:

// Renegade-style Binds

set Ctrl 0
set Alt 0
set KeyStatus 0
archivecvar KeyStatus

alias Say11 ""
alias Say12 "say :>"
alias Say13 ""
alias Say21 ""
alias Say22 "say :O"
alias Say23 ""
alias Say31 ""
alias Say32 "say :<"
alias Say33 ""
alias Say41 ""
alias Say42 ""
alias Say43 ""
alias Say51 ""
alias Say52 ""
alias Say53 ""
alias Say61 ""
alias Say62 ""
alias Say63 ""
alias Say71 ""
alias Say72 ""
alias Say73 ""
alias Say81 ""
alias Say82 ""
alias Say83 ""
alias Say91 ""
alias Say92 ""
alias Say93 ""
alias Say01 ""
alias Say02 "god"
alias Say03 ""

alias CheckKey "set Key %1; eval + $Ctrl $Alt KeyStatus; test > $KeyStatus 0 "SpecialSay $Key $KeyStatus" "slot $Key""
alias SpecialSay "Say%1%2"

alias +Ctrl "set Ctrl 1"
alias -Ctrl "set Ctrl 0"
alias +Alt "set Alt 2"
alias -Alt "set Alt 0"
1. Put it in a text file in your ZDoom folder.
2. In ZDoom, open the console, type exec <textfile> and press Enter.
3. In the console, type bind 0 "checkkey 0" and press Enter.
4. In the console, type bind alt +Alt and press Enter.
5. In the game, press Alt+0 to enable/disable God Mode.

EDIT: Changed it to Alt+0.

Share this post


Link to post

Pick a key and pick a command. Drop this in to your zdoom autoexec.cfg file and save it.

Example: Change the key and change your command:

bind L "give Infrared"
alias flashlight_on "r_visibility 32; bind f flashlight_off"
alias flashlight_off "r_visibility 8; bind f flashlight_on"
bind f flashlight_on
bind n "notarget"
bind x "summonfriend cyberdemon"
bind a "summonfriend archvile"
bind s "summonfriend sorcerer2"
bind r "summonfriend Revenant"
bind b "summonfriend BaronOfHell"
Bind k "give all"
Bind u "god"
sv_nojump false
sv_allowjump true

When done make sure this following line is in your zdoom-user.cfg

Example
set autoexec "C:/DOOM2/ZDOOM/autoexec.cfg"

Do it only one time and just hit the keys in game. All done...

Obviously these are cheats...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×