Mod created to select category units

Everything about mods can be found here.

Moderator: Morax

Mod created to select category units

Postby Okpuck » 29 Jan 2017, 09:40

Hello,

I created a specific MOD to select specific units (see the MOD in attachment). You can select:
the LAND direct fire excep scout
the LAND indirect fire
the LAND anti air
the air Fighters
the Bombers
and so on.....
I put also in attchment my game.prefs for keypad affectation.
This works correctly with the AEON, CYBRAN and FTU race but failed for SERAPHIM race :(

Indeed, when I try to select LAND direct fire for instance or select whatever the specific units by my MOD, it selects everything instead of only land direct fire units. You can make a trial in the following replay 5727490 from 1min40 game play. It would seem that teh function "UISelectionByCategory" fails for SERAPHIM race.

Thanks in advance for your support.
If we succeed to fix this issue, I can share my MOD with FAF players :)
Attachments
Game.7z
(4.32 KiB) Downloaded 64 times
Additional_Keys.7z
(1.26 KiB) Downloaded 68 times
Okpuck
Avatar-of-War
 
Posts: 50
Joined: 15 Nov 2014, 12:14
Has liked: 1 time
Been liked: 1 time
FAF User Name: Okpuck

Re: Mod created to select category units

Postby Okpuck » 29 Jan 2017, 16:24

I made a game completely weird with sera: (5731207)
I had the issue until 10min as soon as ACU built the PD tech2, the issue disappear!
Unbelievable!!!

I ask to all MOD pro guys to explain me why the MOD that I've created , doesn't work. PLS!
Okpuck
Avatar-of-War
 
Posts: 50
Joined: 15 Nov 2014, 12:14
Has liked: 1 time
Been liked: 1 time
FAF User Name: Okpuck

Re: Mod created to select category units

Postby Okpuck » 01 Feb 2017, 20:41

Nobody can't help me :(
Okpuck
Avatar-of-War
 
Posts: 50
Joined: 15 Nov 2014, 12:14
Has liked: 1 time
Been liked: 1 time
FAF User Name: Okpuck

Re: Mod created to select category units

Postby jackherer » 02 Feb 2017, 02:41

I can, dont play sera xD
User avatar
jackherer
Avatar-of-War
 
Posts: 219
Joined: 07 Oct 2013, 23:50
Has liked: 65 times
Been liked: 61 times
FAF User Name: Jackherer

Re: Mod created to select category units

Postby speed2 » 02 Feb 2017, 12:26

Well it's highly inefficient put put it directly unit BPs instead of categories.

There is already a option to select all air fighters, so maybe have a look at that how that's done and it might give you some clues.
https://github.com/FAForever/fa/blob/develop/lua/keymap/keyactions.lua#L336
User avatar
speed2
Contributor
 
Posts: 3189
Joined: 05 Jan 2013, 15:11
Has liked: 636 times
Been liked: 1119 times
FAF User Name: speed2

Re: Mod created to select category units

Postby Okpuck » 03 Feb 2017, 07:36

Thanks speed2 for this link but I would like to select specific units and not category units.
I created a new version of this mod but it failed as soon as I'm seraphim race.
What is the approppriate function to select specific units?
Or How can I choose category units without specific units like (for example):
- select only ASF/interceptors
- select land fire except scout/engineers/mobileshield

Thanks in advance for your support.
Because of this issue, I can't be in random faction.
Attachments
Additional_Keys_v2.7z
(1.38 KiB) Downloaded 66 times
Okpuck
Avatar-of-War
 
Posts: 50
Joined: 15 Nov 2014, 12:14
Has liked: 1 time
Been liked: 1 time
FAF User Name: Okpuck

Re: Mod created to select category units

Postby nine2 » 03 Feb 2017, 09:34

I made select fighters.


['select_anti_air_fighters'] = {action = 'UI_Lua import("/lua/keymap/smartSelection.lua").smartSelect("AIR HIGHALTAIR ANTIAIR -BOMBER")', category = 'selection', order = 42,},


Using smart select you can select some categories and EXCLUDE others with minus symbol, which means you can make category shortcuts but exclude a few things by category/id
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Mod created to select category units

Postby nine2 » 03 Feb 2017, 09:41

The way the mod works is weird

function OnScreenDirect()
UISelectionByCategory("ALLUNITS", false,false,false,false) SelectUnits(GetUnitsByType({'ual0303','uel0303','xel0305','url0303','xrl0305','xsl0303','ual0201','ual0202','xal0203','del0204','uel0201','uel0202','uel0203','drl0204','url0202','url0203','xsl0201','xsl0202','xsl0203','ual0106','uel0106','url0106','url0107'}, GetSelectedUnits()))
end

you should be able to just do this:

UISelectionByCategory("ual0303, uel0303, etc", false,false,false,false)

haven't actually check that it works though. my keybinding thread is here:

viewtopic.php?f=40&t=8230&hilit=+keybinding#p77553

The problem with just trying to select fighters is it will include corsair which is technically a fighter.

Re this: - select land fire except scout/engineers/mobileshield

You could smart select something like "DIRECT MOBILE LAND -IdOfScout1 -IdOfScout2 -IdOfShield"
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Mod created to select category units

Postby nine2 » 03 Feb 2017, 09:46

I don't know why it fails for Seraphim ... sounds very weird - perhaps you have some other mod that doesnt work on Seraphim. You should disable your other mods.

You don't need a mod at ALL to make your key bindings. You could just add new entries to your game.prefs file to make your selection keys, then bind them.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Mod created to select category units

Postby Okpuck » 03 Feb 2017, 13:47

Youpi you found my solution. Thx a lot Anihilnine!
I don't understand why I didn't think before....
I used this function UISelectionByCategory("ual0303, uel0303, etc", false,false,false,false)
It works perfectly! No issue on the seraphim race so that i can use random race :)

I confirm that it would have been more smart to use category instead of specific units but with the categories I can't make select only interceptors and ASFs (corsairs are also included). With my way, I choose exactly the units that I want to select/control.

Many thanks again for your solution.
Okpuck
Avatar-of-War
 
Posts: 50
Joined: 15 Nov 2014, 12:14
Has liked: 1 time
Been liked: 1 time
FAF User Name: Okpuck

Next

Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest