• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

SetHeroProperName

Status
Not open for further replies.
Haven't tested it but this might work:
JASS:
    local unit h = hero
    local string s = GetHeroProperName(h)
    local string s2
    local unit h2
    local integer str = GetHeroStr(h,false)
    local integer agi = GetHeroAgi(h,false)
    local integer int = GetHeroInt(h,false)
    local integer lvl = GetHeroLevel(h)
    //get items... etc... anything else you need
    loop
        exitwhen s2 == s
        set h2 = CreateUnit(player,GetUnitTypeId(h),x,y,270)
        set s2 = GetHeroProperName(h)
        //if/then block, if s2 != s then remove h2 blah blah
    endloop
    //add items.. attributes.. etc.. then null unit vars..

Yeah, a rough code of what you could try out. This is if you want to make a unit with the same name as some other unit.

Otherwise:
JASS:
    local string s = "Hero Name"
    local unit h2
    local string s2
    loop
        exitwhen s == s2
        set h2 = CreateUnit(Player,id,x,y,270)
        set s2 = GetHeroProperName(h2)
 //if/then block, if s2 != s then remove h2 blah blah
    endloop

Would probably be used if you want them to be created with a specific name.

ermm.. Something like that.

EDIT: This doesn't work. The problem is, is that Blizz doesn't like to have heroes wandering around with the same names. :( Thus, I tried this and it caused a loop up to 50 before it stopped. The thing is, is that after a hero is made with a same name, they add things like "XVII" or "VI" as a suffix. Thus, the names never end up the same. At first, I thought it was just for the paladin, but nope, it is for all of them, even the liches with their bizarre names. :\
 
Last edited:
They need a function for GetUnitVertexColor too, and GetUnitTimeScale. I don't understand why there are methods of setting these unit fields but no method of retrieving their current value.
 
Status
Not open for further replies.
Back
Top