#Createhero with facet

1 messages · Page 1 of 1 (latest)

inland zephyr
#

DebugCreateHeroWithVariant is no longer spawning a hero with facet, doesn't matter what number I put in. I know some heroes have new FacetID as 3, 4, 5... But not a single hero is working. Did Valve changed how FacetIDs are defined?

hushed harbor
#

for me working normal

honest junco
#

Probably you passing old pre patch format, now they use some "FacetIDv2" that basicly packed hero id + old facet id into single int

#

#1375415550414426194 message

inland zephyr
#

Wait, so what base variant number I should use?

inland zephyr
#

What about lua?

#

WTF is Valve doing

#

It doesn't make sense, why make all this just to break it down again?

honest junco
honest junco
inland zephyr
#

But I still don't undestand what to do on lua?

honest junco
inland zephyr
#

I found a pure code to implement on version 5.1 to make bitwise operations.

Gotta hold to this one. I have a feeling I'll be using this a lot in the future

hushed harbor
#

ask chatgpt to rewrite js to lua

function parseVariant(variant)
    local num = tonumber(variant)
    if not num then return nil end
    local hex = string.format("%x", num)
    hex = string.rep("0", 10 - #hex) .. hex
    local last2 = string.sub(hex, -2)
    return tonumber(last2, 16)
end
inland zephyr
#

I'm still getting heroes with no facets

#

I have a list of all usable FacetIDs of all heroes, I made it manually considering deprecated facets.

#

I wan't heroes to spawn with random facets, I made a custom pick screen and everything

#

I printed everything and it returns all values correctly

hushed harbor
#
    local hHero = PlayerResource:GetSelectedHeroEntity(0)
    local hPlayer = PlayerResource:GetPlayer(0)
    DebugCreateHeroWithVariant( hPlayer, "npc_dota_hero_pudge", 1, DOTA_TEAM_GOODGUYS, false,
        function( hEnemy )
            hEnemy:SetControllableByPlayer( 0, false )
            hEnemy:SetRespawnPosition( hHero:GetAbsOrigin() )
            FindClearSpaceForUnit( hEnemy, hHero:GetAbsOrigin(), false )
            hEnemy:Hold()
            hEnemy:SetIdleAcquire( false )
            hEnemy:SetAcquisitionRange( 0 )
        end )
#

copied from hero demo and working normal

inland zephyr
#

Ok, I tried one thing different

#

in DebugCreateHeroWithVariant you need to choose what team the hero first spawn in. I was choosing team 0 and moving to the player's team after. So I changed it to 6 before moving, and now it spawns with the random facet