Page 1 of 1

Binding key to script

Posted: Sun Apr 08, 2007 9:53
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.

Posted: Sun Apr 08, 2007 17:54
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.

Posted: Sun Apr 08, 2007 23:44
by Planky
Thanks - I'm assuming using this won't affect the players permanent configuration (I know the method Im using in Legacy does :()?

Posted: Sun Apr 08, 2007 23:53
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.

Posted: Mon Apr 07, 2008 7:01
by Lioyd_Irving
And is there anything for doublebindings via KEYCONF ?