Chaosforge Forum

  • April 16, 2024, 05:30
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: [1]

Author Topic: Ultra Keybindings - 3 Technical Questions  (Read 3585 times)

BrickGun

  • Supporter of Chaos
  • Lance Corporal
  • *
  • *
  • Offline Offline
  • Posts: 23
  • Lost Soul
    • View Profile
    • BrickGun
Ultra Keybindings - 3 Technical Questions
« 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

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.
Logged
(0.9.9.7) Hell Knight Warrant Officer
[M:116 11/43] [I:248 51/67] [A:144 24/40] [22/7/3/0/0]

Evilpotatoe

  • Backer
  • Major
  • *
  • *
  • Offline Offline
  • Posts: 316
  • Lost Soul corpse
    • View Profile
Re: Ultra Keybindings - 3 Technical Questions
« Reply #1 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
Logged
Badges - [26/26/26/22/9/2] - 42/43

BrickGun

  • Supporter of Chaos
  • Lance Corporal
  • *
  • *
  • Offline Offline
  • Posts: 23
  • Lost Soul
    • View Profile
    • BrickGun
Re: Ultra Keybindings - 3 Technical Questions
« Reply #2 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.
Logged
(0.9.9.7) Hell Knight Warrant Officer
[M:116 11/43] [I:248 51/67] [A:144 24/40] [22/7/3/0/0]

bwross

  • Supporter
  • Private FC
  • *
  • *
  • Offline Offline
  • Posts: 14
  • Lost Soul
    • View Profile
Re: Ultra Keybindings - 3 Technical Questions
« Reply #3 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.
Logged

Evilpotatoe

  • Backer
  • Major
  • *
  • *
  • Offline Offline
  • Posts: 316
  • Lost Soul corpse
    • View Profile
Re: Ultra Keybindings - 3 Technical Questions
« Reply #4 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.
Logged
Badges - [26/26/26/22/9/2] - 42/43

bwross

  • Supporter
  • Private FC
  • *
  • *
  • Offline Offline
  • Posts: 14
  • Lost Soul
    • View Profile
Re: Ultra Keybindings - 3 Technical Questions
« Reply #5 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.
Logged

shark20061

  • Programmer
  • Elder Chaos Guard
  • Captain
  • *
  • *
  • Offline Offline
  • Posts: 266
    • View Profile
Re: Ultra Keybindings - 3 Technical Questions
« Reply #6 on: April 18, 2013, 15:04 »

The boots' sid is: unboots
Logged
Hell Knight Warrant Officer (0.9.9.4)  [26!/8/3/1/0]

Mancubus 2nd Lieutenant (0.9.9.6)  [22/12/3/0/0]
M:16 S:43 (126) A:17

Evilpotatoe

  • Backer
  • Major
  • *
  • *
  • Offline Offline
  • Posts: 316
  • Lost Soul corpse
    • View Profile
Re: Ultra Keybindings - 3 Technical Questions
« Reply #7 on: June 22, 2013, 14:16 »

I'm trying to create a function which would queue 3 actions :
  • Wait
  • Shoot
  • Reload

(This seems quite close to point 1 of the op)
I encountered 2 problems :
  • It's possible to queue commands in a function, but I wonder if I could execute commands defined by constants, like COMMAND_RUNMODE or COMMAND_FIRE. Seems I can only access a few functions (namely : quit, use_item, quick_weapon, fire, reload, assemblies, messages, help).
    So, I can use two medkits, but not move or fire :/
  • The "fire" command seems deprecated, and only aims at a target. I'd like my command to shoot at the first aimed target, whatever it is.

Is there any way to do that ?
Logged
Badges - [26/26/26/22/9/2] - 42/43
Pages: [1]