Chaosforge Forum

DoomRL => Discussion => Topic started by: BrickGun on April 10, 2013, 21:56

Title: Ultra Keybindings - 3 Technical Questions
Post by: BrickGun on April 10, 2013, 21:56
I have a fairly-customized keybindings.lua, but being a coder, I'd like to take it as far as possible. A few questions:

1. Is it possible to assign multiple commands to a single key? "Macro"-ing, if you will. It would be nice to set a single key to "COMMAND_RUNMODE" then "WAIT" rather than hitting (default) "," and "5" each time. (Or is there some easier way to wait in place that I'm just not aware of in gameplay?)

2. Has anyone figured out a nesting logic to be able to say... set a keypress of "3" to iterate through all of the different unique/assembled/standard shotguns to attempt to select them in a particular order until it finds one you have?
     If what I mean isn't clear, to have nested logic where on a press of "3" it attempts "command.quick_weapon('upshotgun')" and if that fails then "command.quick_weapon('uashotgun')" and so-on until it hits a weapon you have in inventory. The logic of the order could be set in keybindings.lua logic nesting so that it looks for the user's preferred (i.e. most powerful, by the user's definition) first and iterates down to the "weaker" weapons.
There was some discussion similar to what I'm talking about here, but it doesn't appear to have ever been fully-resolved: http://forum.chaosforge.org/index.php/topic,6116.msg52893.html#msg52893 (http://forum.chaosforge.org/index.php/topic,6116.msg52893.html#msg52893)

3. Is there a centralized list of all the object names used in code for the weapons? I checked the wiki and didn't find. it. I would like to know how people found the names "upshotgun", "uashotgun", etc. when they were doing extensive keybinding definitions.
Title: Re: Ultra Keybindings - 3 Technical Questions
Post by: Evilpotatoe on April 18, 2013, 07:44
1) As you've seen in the topic you refer to, there is currently limitations. Just try it and see. If you already did and it didn't work, I guess it's not yet possible.

2) Same topic reference : quick swap currently doesn't return a result, so we're screwed. (unless maybe, if we have a non-quick swap command ? I wouldn't bet on it)

3) Here's the list I used to add quick keys to every 0.9.9.6 weapons http://doom.chaosforge.org/wiki/Modding:sID (http://doom.chaosforge.org/wiki/Modding:sID)
Title: Re: Ultra Keybindings - 3 Technical Questions
Post by: BrickGun on April 18, 2013, 10:46
Cool. Thanks for the info, EP. #3 was exactly what I was searching for but hadn't been able to find.
Title: Re: Ultra Keybindings - 3 Technical Questions
Post by: bwross on April 18, 2013, 12:47
The new ones in 0.9.9.7 are: ufshotgun (Frag Shotgun), umjoll (Mjollnir), usubtle (Subtle Knife), umega (Mega Blaster), and unullpointer (Charch's Null Pointer).

And although there isn't a return value for quick_weapon, you can still do some interesting things with it.  I have one macro that quick_weapons a pistol and then a shotgun, which I use when juggling.  Another one quick_weapons the Longinus Spear and then Azrael's Scythe... since I can only ever have one of those at a time, the other one simply fails.
Title: Re: Ultra Keybindings - 3 Technical Questions
Post by: Evilpotatoe on April 18, 2013, 13:57
Added entries in Wiki. Btw, where can one find thoses ? I would gladly have added Nyarlathing boots... but don't have their Sid.
Title: Re: Ultra Keybindings - 3 Technical Questions
Post by: bwross on April 18, 2013, 14:26
I found them by creating macros that would alternate calling quick_weapon on pistol with a guesses on an ID.  Then I'd run the game and hit the macros to see if it generated the "You don't have" message, and count the number of "already using a pistol" messages to see which one was correct.  Naturally, this couldn't be used to get IDs for boots or armour.
Title: Re: Ultra Keybindings - 3 Technical Questions
Post by: shark20061 on April 18, 2013, 15:04
The boots' sid is: unboots
Title: Re: Ultra Keybindings - 3 Technical Questions
Post by: Evilpotatoe on June 22, 2013, 14:16
I'm trying to create a function which would queue 3 actions :

(This seems quite close to point 1 of the op)
I encountered 2 problems :

Is there any way to do that ?