Forged Alliance Forever Forged Alliance Forever Forums 2019-11-29T18:21:57+02:00 /feed.php?f=45&t=18453 2019-11-29T18:21:57+02:00 2019-11-29T18:21:57+02:00 /viewtopic.php?t=18453&p=180070#p180070 <![CDATA[Re: Mod API - allow mods to add strategic icons]]> Yes, you're right that textures will always be loaded. However it is JUST textures, so I think its fine. Main benefit of this would be simple installation/deinstallation - just hit "install" / "uninstall" in the vault and done. So for texture pack mods this is fine, as you'd want to use them all the time anyways.

Also, you can divide your mods if you want - I could, for example, publish my expanded strategic icon set as its own mod that is just a dependency for others and is not listed in the mod selection in game:
Code:
selectable = false    <---- Not in the in-game mod list!
enabled = true
exclusive = false
ui_only = true
requires = {}

As it doesn't do anything by itself other than allocate some memory to the textures, it could just be left active with no problems.

Statistics: Posted by wodzu_93 — 29 Nov 2019, 18:21


]]>
2019-11-29T16:04:04+02:00 2019-11-29T16:04:04+02:00 /viewtopic.php?t=18453&p=180063#p180063 <![CDATA[Re: Mod API - allow mods to add strategic icons]]>
The only problem i see; How can this mod be disabled ?
If we change the init file then those textures will be loaded no matter if the mod is switched on or off.

If this is the case then this mod is not different then placing a .SCD file somewhere.

@Anihilnine:
The changes folder is inside "textures/ui".
"UI" changes can't desync, they are not running through the sim.

Statistics: Posted by Uveso — 29 Nov 2019, 16:04


]]>
2019-11-29T00:52:12+02:00 2019-11-29T00:52:12+02:00 /viewtopic.php?t=18453&p=180055#p180055 <![CDATA[Re: Mod API - allow mods to add strategic icons]]> Statistics: Posted by nine2 — 29 Nov 2019, 00:52


]]>
2019-11-28T22:07:03+02:00 2019-11-28T22:07:03+02:00 /viewtopic.php?t=18453&p=180052#p180052 <![CDATA[Re: Mod API - allow mods to add strategic icons]]>
Scd files in gamedata folder have a path of "root" ( /), unlike mods ( /mods/<mod_name> ). Game expects strategic icons to be in textures/ui/common/game/strategicicons, so placing then in mod folder doesn't work ( /mods/<mod_name>/textures/ui/common/game/strategicicons ). What that code does is register textures in the mod folder as a root directory, so game can see those icons. Same goes for the big icons, and this should classify as an UI mod, as it is just textures.

Uveso, I'm asking for this because I added a lot of custom strategic icons to Total Mayhem Lite, and right now you have to manually install them by copying a file. If this is implemented it will be working without that step.

Statistics: Posted by wodzu_93 — 28 Nov 2019, 22:07


]]>
2019-11-28T21:30:37+02:00 2019-11-28T21:30:37+02:00 /viewtopic.php?t=18453&p=180051#p180051 <![CDATA[Re: Mod API - allow mods to add strategic icons]]>
How does it work ?

Can you overwrite original icon files, or only add new icons ?
Is it possible to add/change the optional big icons ?
Do we need a sim or a UI mod for this ?

Is there an working example mod to test this ?

Statistics: Posted by Uveso — 28 Nov 2019, 21:30


]]>
2019-11-28T19:05:39+02:00 2019-11-28T19:05:39+02:00 /viewtopic.php?t=18453&p=180044#p180044 <![CDATA[Mod API - allow mods to add strategic icons]]> I'd like to request mounting an extra directory in init, to allow mods for adding new strategic icons.

Game only reads strategic icons from textures/ui/common/game/strategicicons (regular) and textures/ui/icons_strategic (optional big icons in building panel). The only way for modders to add them currently is to pack them into an .scd and put it in the gamedata folder, which has to be done manually and is prone to overlooking by the users.

I'm asking to mount mods/<mod_name>/textures/ui directories as textures/ui, which will enable us modders to remove the need for manual installation of strategic icons.

Following code added to init_faf.lua in bin folder works in achieving this. At least it did on my end.
Code:
function mount_strategic_icons(MODFOLDER)
    for _,mod in io.dir( MODFOLDER..'\\*.*') do
        if mod != '.' and mod != '..' then
            for _,folder in io.dir(MODFOLDER..'\\'..mod..'\\*.*') do
                if folder == 'textures' then
          for _,folder in io.dir(MODFOLDER..'\\'..mod..'\\textures\\*.*') do
         if folder == 'ui' then
                          LOG('Found mod icons in: '..mod)
                          mount_dir(MODFOLDER..'\\'..mod..'\\textures\\ui', '/textures/ui')
                          break
         end
          end
                end
            end
        end
    end
end
mount_strategic_icons(SHGetFolderPath('PERSONAL') .. 'My Games\\Gas Powered Games\\Supreme Commander Forged Alliance\\mods')
mount_strategic_icons(InitFileDir .. '\\..\\user\\My Games\\Gas Powered Games\\Supreme Commander Forged Alliance\\mods')

Statistics: Posted by wodzu_93 — 28 Nov 2019, 19:05


]]>