how to enable hotbuild with my mod

Everything about mods can be found here.

Moderator: Morax

how to enable hotbuild with my mod

Postby Axle » 27 Sep 2019, 16:37

I made a mod that has a whole bunch of new units, factories, turrets, new everything. And they all work fine, except they don't work with hotbuild ... no letter overlay on their build icons. And with factory or contstruction unit selected, pressing hotbuild hotkeys don't cause them to be built.

So my question is ... how to enable hotbuild with the new units in my mod? Do I add a magic tag to the "categories" key in the units' blueprint? Do I need to hook some particular lua file and programatically add a keybinding for each unit?

Please help me out I can't play my mod without hotbuild I love hotbuild too much!

Alex
Axle
Avatar-of-War
 
Posts: 93
Joined: 02 Apr 2013, 10:14
Has liked: 0 time
Been liked: 4 times
FAF User Name: Axle

Re: how to enable hotbuild with my mod

Postby Uveso » 27 Sep 2019, 19:35

Hello Axle,

i have no clue about hotbuild, so i only view the scripts without testing.

All keygroups with unitID are saved inside unitkeygroups.lua:
https://github.com/FAForever/fa/blob/develop/lua/keymap/unitkeygroups.lua


For adding new hotkeys make a new (empty) file inside your mod:
Code: Select all
YOURMOD\hook\lua\keymap\unitkeygroups.lua


Now, if you want to add a new unit to the T2_Fighter/Bomber hotkey as example, add this to your empty file:
Code: Select all
unitkeygroups = {
    ["T2_Fighter/Bomber"] = {
        "dea0202",
        "dra0202",
        "xsa0202",
        "YOUR NEW UNIT ID",
    },
}


In case you want to add completly new keyactions you need to modify the file keyactions.lua
(same like unitkeygroups.lua)
https://github.com/FAForever/fa/blob/develop/lua/keymap/keyactions.lua


More help can be found here:
http://forums.faforever.com/viewtopic.php?f=2&t=13817

Greetings, Uveso.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: how to enable hotbuild with my mod

Postby Axle » 28 Sep 2019, 01:20

You sir, are a sir! Thank you!

[edit] and a note for those that might follow ... unit ids must be lower case (or converted to lower case in unitkeygroups.lua)
Axle
Avatar-of-War
 
Posts: 93
Joined: 02 Apr 2013, 10:14
Has liked: 0 time
Been liked: 4 times
FAF User Name: Axle


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest