Binding key to script

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
Planky
Posts: 25
Joined: Sun Sep 04, 2005 8:41

Binding key to script

Post by Planky »

How can you bind a key to a script in GZDoom? I'm assuming there is a command in ACS that allows you to do it?

Im making a mod for Legacy, which I'm having to use runcommand (ergh!) in FraggleScript but I also want it to work in GZDoom as well.
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

To bind a key to a script, just make make an alias.

First, take note of what number your script is. You'll need that later.

Create a KEYCONF lump in your wad file. Add the following:

Code: Select all

alias planky_script "puke ###"
defaultbind o plankyscript
Substitute the ### with whatever your script number is, and change o to whatever key you need it to be. To top it off, make sure the key is listed in the control config screen by doing this in your KEYCONF lump:

Code: Select all

addkeysection "planky's mod" plankykeys
addmenukey "planky's script" plankscript
Then it'll appear at the bottom of the keyboard controls menu.
Planky
Posts: 25
Joined: Sun Sep 04, 2005 8:41

Post by Planky »

Thanks - I'm assuming using this won't affect the players permanent configuration (I know the method Im using in Legacy does :()?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

No. (G)ZDoom saves all WAD specific key bindings in a dedicated section (that's why you have to use addkeysection.)
However, if something else is already bound to the key you choose as a default the binding won't take effect and has to be set manually. This is to avoid overwriting a user's own settings for standard stuff.
User avatar
Lioyd_Irving
Posts: 122
Joined: Sun Dec 30, 2007 15:44
Location: Where ?

Post by Lioyd_Irving »

And is there anything for doublebindings via KEYCONF ?
Jack the Ripper, Charles Manson and Adolf Hitler all drank water. You criminal scum !
Locked

Return to “GZDoom”