How to: Make new keyboard shortcuts

Need help? This is the right place!
Note, reporting bugs and issues should be in the Tech Support forum!

Re: How to: Make new keyboard shortcuts

Postby Anihilnine » 18 Aug 2017, 17:48

You write a mod
Anihilnine
Moderator
 
Posts: 2177
Joined: 16 Apr 2013, 10:10
Has liked: 254 times
Been liked: 374 times
FAF User Name: Anihilnine

Re: How to: Make new keyboard shortcuts

Postby svenni_badbwoi » 19 Oct 2017, 19:57

Hello, thx for the solid information provided here.
So far my keys are working just fine, with two minor exceptions. Unfortunately I was unable to figure it out myself.

1)Since the Mole (Cybran scout) has no direct fire weapon, it stays unselected if I use my key for "all direct fire units on screen".
Is there a way to exclude or include all land scouts to the selection?

Code: Select all
['Select Land Direct Fire Units on Screen'] = {
action = 'UI_SelectByCategory +inview +excludeengineers DIRECTFIRE MOBILE LAND',
category = 'Custom Keys'
},

2)And I like to remove the fighter/bomber from "all airfighter in screen", since they are shitty AA units.

Code: Select all
['Select Air Fighters on Screen'] = {
action = 'UI_SelectByCategory +inview AIR HIGHALTAIR ANTIAIR',
category = 'Custom Keys'
},
User avatar
svenni_badbwoi
Crusader
 
Posts: 41
Joined: 23 May 2017, 12:19
Has liked: 11 times
Been liked: 23 times
FAF User Name: svenni_badbwoi

Re: How to: Make new keyboard shortcuts

Postby JoonasTo » 19 Oct 2017, 21:22

Just add 'SCOUT' to your first one and do '-BOMBER' to your second.
User avatar
JoonasTo
Priest
 
Posts: 498
Joined: 08 Feb 2015, 01:11
Has liked: 18 times
Been liked: 82 times
FAF User Name: JoonasTo

Re: How to: Make new keyboard shortcuts

Postby svenni_badbwoi » 19 Oct 2017, 23:08

JoonasTo wrote:Just add 'SCOUT' to your first one and do '-BOMBER' to your second.


thx for the quick reply. I tried..
Code: Select all
action = 'UI_SelectByCategory +inview +excludeengineers DIRECTFIRE MOBILE LAND SCOUT',

Code: Select all
action = 'UI_SelectByCategory +inview AIR HIGHALTAIR ANTIAIR -BOMBER',

..unfortunately its not working me. did you use that?
User avatar
svenni_badbwoi
Crusader
 
Posts: 41
Joined: 23 May 2017, 12:19
Has liked: 11 times
Been liked: 23 times
FAF User Name: svenni_badbwoi

Re: How to: Make new keyboard shortcuts

Postby Anihilnine » 19 Oct 2017, 23:18

Removing categories doesn't work with this method, you have to use something called smart select. Then you could remove SCOUT from query 1 and BOMBER from query 2.

However there already exists solutions to your problems.

There is a select all fighters key built into FAF that removes bombers and experimentals. If it's not working for you then it means I made a mistake somewhere.

In the latest version of ui party mod, I made a select direct fire onscreen mod and fixed that exact SCOUT issue. And some other units.
Anihilnine
Moderator
 
Posts: 2177
Joined: 16 Apr 2013, 10:10
Has liked: 254 times
Been liked: 374 times
FAF User Name: Anihilnine

Re: How to: Make new keyboard shortcuts

Postby svenni_badbwoi » 19 Oct 2017, 23:35

Thx for the info and solution.
The key you created works nicely-will use it. Would be nice to have that same function with '+inview' as well, if it is no problem ;)
I will check out UI party now...
User avatar
svenni_badbwoi
Crusader
 
Posts: 41
Joined: 23 May 2017, 12:19
Has liked: 11 times
Been liked: 23 times
FAF User Name: svenni_badbwoi

Re: How to: Make new keyboard shortcuts

Postby Anihilnine » 20 Oct 2017, 05:51

svenni_badbwoi wrote:Thx for the info and solution.
The key you created works nicely-will use it. Would be nice to have that same function with '+inview' as well, if it is no problem ;)
I will check out UI party now...


You can make an inview version. Just copy paste and add.
Anihilnine
Moderator
 
Posts: 2177
Joined: 16 Apr 2013, 10:10
Has liked: 254 times
Been liked: 374 times
FAF User Name: Anihilnine

Re: How to: Make new keyboard shortcuts

Postby svenni_badbwoi » 20 Oct 2017, 11:32

Anihilnine wrote:You can make an inview version. Just copy paste and add.

I dont like being spoon-fed, but didn't find what I was looking for in the game.prefs.
I tried ['key'] = 'select_anti_air_fighters, +inview' but that is wrong ;) I also looked for lua-files where 'select_anti_air_fighters' is defined, but had no luck. Could you give me another hint?
User avatar
svenni_badbwoi
Crusader
 
Posts: 41
Joined: 23 May 2017, 12:19
Has liked: 11 times
Been liked: 23 times
FAF User Name: svenni_badbwoi

Re: How to: Make new keyboard shortcuts

Postby Anihilnine » 20 Oct 2017, 16:50

Yeah my bad, it wasnt that easy to work out. I had to search github for "select_anti_air_fighters" to find the code for how it was implemented.

This is it:
['select_anti_air_fighters'] = {action = 'UI_Lua import("/lua/keymap/smartSelection.lua").smartSelect("AIR HIGHALTAIR ANTIAIR -BOMBER")',

Your should do:
['select_anti_air_fighters_onscreen'] = {action = 'UI_Lua import("/lua/keymap/smartSelection.lua").smartSelect("+inview AIR HIGHALTAIR ANTIAIR -BOMBER")',
Anihilnine
Moderator
 
Posts: 2177
Joined: 16 Apr 2013, 10:10
Has liked: 254 times
Been liked: 374 times
FAF User Name: Anihilnine

Re: How to: Make new keyboard shortcuts

Postby JoonasTo » 20 Oct 2017, 18:35

Hmmm, why doesn't the scout work though? Do they have to satisfy all the demands for that to work?
User avatar
JoonasTo
Priest
 
Posts: 498
Joined: 08 Feb 2015, 01:11
Has liked: 18 times
Been liked: 82 times
FAF User Name: JoonasTo

PreviousNext

Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest