Allow bos to capture keypresses when a unit is selected

Allow bos to capture keypresses when a unit is selected

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Allow bos to capture keypresses when a unit is selected

Post by Forboding Angel »

With this, we could do all kinds of really neat stuff. I was kind of surprised that this functionality didn't already exist.

Basically so we can define hotkeys and trigger a function in a script. Would be 100 kinds of neato.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Allow bos to capture keypresses when a unit is selected

Post by CarRepairer »

Gadgets create commands. Unit scripts animate upon those commands. Widgets can capture keypresses and can issue commands.

But, rather than capturing a keypress, the widget should make an ActionHandler action and the user can bind a key to it.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Allow bos to capture keypresses when a unit is selected

Post by Forboding Angel »

That's fair. Was just pipedreaming :-)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Allow bos to capture keypresses when a unit is selected

Post by KDR_11k »

Yeah, you're supposed to use the proper layer structure. I've got that toggle.lua gadget that I use for more or less direct hooks into BOS. One problem with a theoretical key-to-BOS hook is that key presses only go into the local unsynced, to communicate with the synced state you need a command or lua message so that information can be transmitted over the network to all participating players.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Allow bos to capture keypresses when a unit is selected

Post by CarRepairer »

It's ok, we have a solution in the works. He wants to hook it to a special attack so there's no need for a gadget to create a command. He'll create the unit and weapon and I'll throw together a small widget that issues an attack-ground on keypress.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Allow bos to capture keypresses when a unit is selected

Post by KDR_11k »

Hell, there's already a fairly universal gadget in Kernel Panic IIRC, it's how the Bug's transformation and the Byte's mine launcher work.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Allow bos to capture keypresses when a unit is selected

Post by AF »

tbh this seems shaky on the sync vs desync ground to me at first
Post Reply

Return to “Feature Requests”