I've got an array foo = unittype[30], I want to show an image of the units in a dialog. To this end I need to convert the unittype to an image. Is this possible? I know that in the data editor one can set icons for units, so there is a link build in, can one access it somehow? What are possible workarounds if the answer to my original question is no.
In the past, I used a function that figured out the unit icon file based the unit's name; I've never liked using it though. Where exactly is that link to the unit icon in the data editor? I can't seem to find it; if you could point out its location for me, I could write a better function to get it for you.
You are right, the actor has "Unit Icon" but the unit itself does not seem to have an icon.
Could you post your script? How does it deal with units, that don't have Assets\Textures\btn-unit-foo-bar.dds (e.g. the Automaton 2000 doesn't seem to have any icon or image I could use in a dialog.)
Note: the function retrieves a lot more than just the unit's icon. The only line of importance for you is that second to last line. The function was only used for units available in melee. Even then the image didn't work for the Void Ray (Warp Ray).
You could also link to the unit's button game link and retrieve its file that way. With only 30 units, especially if you're using things like the Automaton, I would either do that or select the images manually.
Hi,
I've got an array foo = unittype[30], I want to show an image of the units in a dialog. To this end I need to convert the unittype to an image. Is this possible? I know that in the data editor one can set icons for units, so there is a link build in, can one access it somehow? What are possible workarounds if the answer to my original question is no.
Thank you for your consideration
@kmkkmk: Go
In the past, I used a function that figured out the unit icon file based the unit's name; I've never liked using it though. Where exactly is that link to the unit icon in the data editor? I can't seem to find it; if you could point out its location for me, I could write a better function to get it for you.
@hunterx3: Go
You are right, the actor has "Unit Icon" but the unit itself does not seem to have an icon.
Could you post your script? How does it deal with units, that don't have Assets\Textures\btn-unit-foo-bar.dds (e.g. the Automaton 2000 doesn't seem to have any icon or image I could use in a dialog.)
[reply=312971]
Note: the function retrieves a lot more than just the unit's icon. The only line of importance for you is that second to last line. The function was only used for units available in melee. Even then the image didn't work for the Void Ray (Warp Ray).
You could also link to the unit's button game link and retrieve its file that way. With only 30 units, especially if you're using things like the Automaton, I would either do that or select the images manually.