Forged Alliance Forever Forged Alliance Forever Forums 2016-07-15T13:34:07+02:00 /feed.php?f=41&t=12735 2016-07-15T13:34:07+02:00 2016-07-15T13:34:07+02:00 /viewtopic.php?t=12735&p=130690#p130690 <![CDATA[Re: Find icons in Script]]>
Thank you very much!
I didn't find that global variable myself, it's quite a good one to know about.

Lots of love,
Jip

Statistics: Posted by Jip — 15 Jul 2016, 13:34


]]>
2016-07-15T06:36:06+02:00 2016-07-15T06:36:06+02:00 /viewtopic.php?t=12735&p=130663#p130663 <![CDATA[Re: Find icons in Script]]>
Code:
    local FatboyBlueprint = __blueprints['uel0401']
    LOG('***', repr(FatboyBlueprint),'***')


Or you can loop over all blueprints like this :

Code:
    for unitID, unitBLUEPRINT in __blueprints do
        if unitID == 'uel0401' then
            LOG('Unit ID='..unitID)
            LOG('Unit Background='..(unitBLUEPRINT.General.Icon or 'no General.Icon found'))
            IconName = unitID..'_icon.dds'
            Filepath = '/textures/ui/common/icons/units/'
            if DiskFindFiles(Filepath, IconName) then
                LOG('Found Iconfile: '..IconName..' inside directory: '..Filepath)
            else
                LOG('Iconfile not found!')
            end
        end
    end

Statistics: Posted by Uveso — 15 Jul 2016, 06:36


]]>
2016-07-14T18:59:15+02:00 2016-07-14T18:59:15+02:00 /viewtopic.php?t=12735&p=130646#p130646 <![CDATA[Re: Find icons in Script]]>
Thanks for your reply!

Today, you're my hero Myxir.
I didn't know the unitID's were managed like that, now I can continue working again. Thanks!

I do have something else: perhaps another way of retrieving these icons: GameCommon.GetUnitIconFileNames(BLUEPRINT)
However, this requires a blueprint. Is there a way to get a blueprint in a UI Mod when all you have is the name of the blueprint?

The C function GetUnitBlueprintByName(STRING) does not appear to work, it does work when I use it though a map script.

Lots of love,
Jip

Statistics: Posted by Jip — 14 Jul 2016, 18:59


]]>
2016-07-14T18:14:07+02:00 2016-07-14T18:14:07+02:00 /viewtopic.php?t=12735&p=130642#p130642 <![CDATA[Re: Find icons in Script]]> (if you don't have it, you can get it by u:GetBlueprint().BlueprintId)

then your icon is named:
Code:
unitId..'_icon.dds'

and you can get it via something like:
Code:
   for _, file in DiskFindFiles('/textures/', iconname) do
      return file
   end   


not sure about all the generic backgrouns, but at least some are amph_up.dds, sea_up.dds and land_up.dds
(the 'up' part refers to the state of the curser not beeing over it - when it's over, it's 'over', pressed down is 'down' afaik)

Statistics: Posted by Myxir — 14 Jul 2016, 18:14


]]>
2016-07-14T15:30:21+02:00 2016-07-14T15:30:21+02:00 /viewtopic.php?t=12735&p=130635#p130635 <![CDATA[Find icons in Script]]>
I need the icons found in game for a mod that I am making.
I couldn't find a reference anywhere to them myself, and searching these forums didn't help me a lot either.

So, my question is: How do you get the icons of units? For example: An interceptor.
And could you get the generic background they use somehow? (All air units have the same 'airish' background)

It'd really appreciate some help on this, it's the last part of the mod.
The rest already works.

Lots of love,
Jip

PS: The mod is about filtering the current selected units.
For example: filter out all the hover when moving your navy.

Statistics: Posted by Jip — 14 Jul 2016, 15:30


]]>