Page 11 of 13

Re: How to: Make new keyboard shortcuts

PostPosted: 18 Aug 2017, 17:48
by nine2
You write a mod

Re: How to: Make new keyboard shortcuts

PostPosted: 19 Oct 2017, 19:57
by svenni_badbwoi
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'
},

Re: How to: Make new keyboard shortcuts

PostPosted: 19 Oct 2017, 21:22
by JoonasTo
Just add 'SCOUT' to your first one and do '-BOMBER' to your second.

Re: How to: Make new keyboard shortcuts

PostPosted: 19 Oct 2017, 23:08
by svenni_badbwoi
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?

Re: How to: Make new keyboard shortcuts

PostPosted: 19 Oct 2017, 23:18
by nine2
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.

Re: How to: Make new keyboard shortcuts

PostPosted: 19 Oct 2017, 23:35
by svenni_badbwoi
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...

Re: How to: Make new keyboard shortcuts

PostPosted: 20 Oct 2017, 05:51
by nine2
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.

Re: How to: Make new keyboard shortcuts

PostPosted: 20 Oct 2017, 11:32
by svenni_badbwoi
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?

Re: How to: Make new keyboard shortcuts

PostPosted: 20 Oct 2017, 16:50
by nine2
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")',

Re: How to: Make new keyboard shortcuts

PostPosted: 20 Oct 2017, 18:35
by JoonasTo
Hmmm, why doesn't the scout work though? Do they have to satisfy all the demands for that to work?