SC2Mapster Forums

Development > Triggers

Catalog - Actor for unit.

  • 12 posts
    #1 Feb 04, 2013 at 11:34 UTC - 0 likes

    So I need to be able to access the main actor for a unit type via catalogs to retrieve the 'hero-icon' for that unit.

    Does anyone have any ideas? There doesn't seem to be any way that I can find to get an actor reference from a unit.

    #2 Feb 04, 2013 at 15:17 UTC - 0 likes

    Not possible. They are in seperate catalogs.

    #3 Feb 04, 2013 at 21:54 UTC - 0 likes

    There is no way whatsoever to find an actor gamelink based on a unit? That seems really lame.

    #4 Feb 05, 2013 at 01:38 UTC - 0 likes

    Is there even a way to get the unit game link for a unit? There doesn't appear to be.

    #5 Feb 05, 2013 at 02:17 UTC - 0 likes

    What are you trying to do? Here's a simple return for the game link of a unit.

    Name Size MD5
    Return_unit_game_link.SC2Map 8.8 KiB d9f404ba66c6...
    #6 Feb 05, 2013 at 02:39 UTC - 0 likes

    I need to show the icon of a unit in a dialog when that unit goes into production. I already did this using a massive collection of variables that took forever to input, but I want to come up with a more automated system now as I am trying to streamline my map.

    I think the problem I was having was that I kept trying to pull the unit type from a unit that was in training. Units in training don't appear to actually have a unit type, you have to get it from "Triggering Progress Unit Type"

    Still...getting from a unit game link to an image in a dialog is a long annoying road it seems...

    Last edited Feb 05, 2013 by rtschutter
    #7 Feb 05, 2013 at 04:02 UTC - 0 likes

    Just spent quite a bit of time trying to figure out if you could do anything besides this, but nope. You're going to have to use a switch to set the icon for every possible type of unit.

    #8 Feb 05, 2013 at 07:15 UTC - 0 likes

    Yeah I appreciate you taking the time to look at it. Definitely nice to have a second opinion that I have to do it the hard way (read: only way).

    #9 Feb 05, 2013 at 13:37 UTC - 0 likes

    @rtschutter: Go

    It might be possible to store the game link address for an icon somewhere in the catalog for a unit type and then reference that with a CFVG action. For example (and I'm not 100% sure this would work) you could set a unit's Editor Suffix value to "Assets\Textures\btn-unit-terran-marine.dds."

    Could be worth a try. You would have to set one for each unit, but you would no longer need to use variables and functions for referencing those icons.

    My Projects:
    Malum Ruina: SC2Mapster
    Eternal Exile: SC2Mapster
    Spine Crawler Madness: SC2Mapster
    Xeno Crisis: SC2Mapster

    #10 Feb 05, 2013 at 14:22 UTC - 0 likes

    I tried doing that already using the 'description' field, but I had some kind of strange tooltip thing returned instead of the message I put in there. Maybe I did something wrong though, I didn't really spend much time with it.

    #11 Feb 05, 2013 at 14:55 UTC - 0 likes
    Quote from rtschutter: Go

    I tried doing that already using the 'description' field, but I had some kind of strange tooltip thing returned instead of the message I put in there. Maybe I did something wrong though, I didn't really spend much time with it.

    I'm pretty sure the description field is text. You would have to use a string field, if anything.

    #12 Feb 05, 2013 at 15:04 UTC - 0 likes

    As far as I know its not possible to directly get the main actor type of a unit type, this is, in fact, a very old problem.

    However, most units use the convention that the ID of the main actor equals the units ID. This might be helpful to setup a system that works for most cases.

    If there is no actor with the units ID in the actor catalog you can have some sort of fallback to a placeholder icon or smth similar.

    Last edited Feb 05, 2013 by Mille25

    http://i55.tinypic.com/wio5t0.jpg

    Starcraft Universe lead programmer

  • 12 posts

You must login to post a comment. Don't have an account? Register to get one!