1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Is possible Get Unit Id?

Discussion in 'StarCraft II Modding' started by Zombie007, May 15, 2010.

  1. Zombie007

    Zombie007

    Joined:
    Feb 6, 2008
    Messages:
    133
    Resources:
    0
    Resources:
    0
    Is it possible?
     
  2. s3rius

    s3rius

    Joined:
    May 15, 2008
    Messages:
    22
    Resources:
    0
    Resources:
    0
    It's not called "Unit Get Type".
     
  3. Zombie007

    Zombie007

    Joined:
    Feb 6, 2008
    Messages:
    133
    Resources:
    0
    Resources:
    0
    No i don't want Get Unit Type but unit id like in Wc3 GetHandleId(unit)...
     
  4. Re8eL

    Re8eL

    Joined:
    Dec 11, 2004
    Messages:
    94
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I am looking for this as well.. need it for a physic system
     
  5. Re8eL

    Re8eL

    Joined:
    Dec 11, 2004
    Messages:
    94
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I found this.. I don't know anything about coding this, donno any coding and never did jass in warcraft3, but it looks backwards for whats trying to be accomplished...

    native unit UnitFromId (int id);

    Could assign a custom value+1 for every unit in-game and being created... Own custom unitID.. *cough*
     
  6. P-Exodus

    P-Exodus

    Joined:
    Jan 29, 2008
    Messages:
    38
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I tried this one:
    • Debug - Display (Text((String(Test Ability Name)))) as debug output using Type 1, and Do display it in the game window


    I set the name of the test ability to 'Test Ability Name' and it's ID to 'TestAbilityID'. This debug message returned 'TestAbilityID', so I guess this is what you are searching for.

    I used the game link to string conversion. Though it's a bit tricky to use. Take note that, after opening the game link window, you can choose the type and link type at the top of this window. There you can choose any game link, like units, behavior, effects, ect.
     
  7. Re8eL

    Re8eL

    Joined:
    Dec 11, 2004
    Messages:
    94
    Resources:
    2
    Maps:
    2
    Resources:
    2
    What I'm looking for is like the unit ID in Warcraft 3, every individual unit in-game had a 4 digit numeral identifier, such as Footman '0012', Footman '0013', and Grunt '0014', or something like that. Those numbers can be used as arrays for variables in physic systems whereas you select every unit as a unit-group, and every single unit has their own array. This number could also be viewable in the warcraft 3 editor in triggers and by selecting units, whereas in the starcraft 2 editor, the only thing displayed is the unit name and cords.
     
  8. mrzwach

    mrzwach

    Joined:
    Aug 1, 2009
    Messages:
    929
    Resources:
    3
    Tutorials:
    3
    Resources:
    3
    Create it yourself.

    For each unit in a map, give it a unique integer custom value which corresponds to array spots. Whenever a unit dies, pick the unit with the highest custom value and move all of its info to the dying unit's slot in the array.
     
  9. Zackreaver

    Zackreaver

    Joined:
    May 25, 2007
    Messages:
    52
    Resources:
    1
    Maps:
    1
    Resources:
    1
    He doesn't need to, blizzard already put one in... However for some reason I think they changed it.

    Before a recent patch i'm assuming the function
    UnitGetPropertyInt(u, 24, c_unitPropCurrent)
    would return the unique id integer for the unit u, yet for some reason it's not working anymore.

    I got this info from
    http://www.sc2mapster.com/api-docs/functions/unit-get-property-int/
    and when I first used it it was working fine. Though I'm assuming they might have added a property and changed the unique ID's integer.

    I was using it in my map for a trade caravan but then after a recent patch they stopped working right, I noticed through a debug the functions topped getting the unique ID.

    I'm looking to see what blizzard changed it too, but it's definately in there.

    Edit: Nevermind I just found it, apparently to make it work you gotta put any value 24 or above, but since 24 and such don't work, that can mean blizzard probably put something there, don't know what it is but since it just has to be anything above, you can just use something insane like 9000.

    so to get a units unique ID, use the function

    UnitGetPropertyInt(u, 9000, c_unitPropCurrent)

    9000 can be any number thats really high, 24 and below will give specific unit values like health and health percentage. But any number that doesn't have a specific value will return the unique ID.

    Hope this was able to help.