As the title implies I'm having a trouble increasing a hero level above 20.
The custom map I'm developing should have a fixed level for a spawned hero. That way his health pool, attack, speed, etc are easier to manage and is more eye-catchy. However, increasing the level above 35 doesn't work as expected. For example:
In the code above the index value is unbounded and may (possibly) reach 2^31 - 1. However the "SetHeroLevel" function doesn't even gradually increment the hero's level! In the current code example it will start from 35, then jump to 51 and stay there for a minute, until the hero level SUDDENLY reaches the "GameConstant -> Hero Maximum Level".
I tried using a direct "Grant XP" function with 100K as an increment, but it's too small of a value to reach, say, level 120. Using a bigger value to XP increments repeats the above problem: no effects at all for a minute, then jump to the maximum level.
Also, worth mentioning is that "Hero -> XP Gained -> Hero", "Hero -> XP Gained -> Normal", "Hero -> XP Required" are all set to custom values.
How would you deal with it and did you encounter that problem?
The custom map I'm developing should have a fixed level for a spawned hero. That way his health pool, attack, speed, etc are easier to manage and is more eye-catchy. However, increasing the level above 35 doesn't work as expected. For example:
JASS:
local integer index = 1
local integer iloops = 10
local integer ilevel = R2I( 60.0 * 1.5 )
local unit ucaller = GetEnteringUnit() // implies that the unit enters a region
// set wanted level and slowly increment it over N iloops
loop
//exitwhen ( index > iloops ) or ( GetHeroLevel( ucaller ) >= ilevel )
exitwhen ( GetHeroLevel( ucaller ) >= ilevel )
// call SetHeroLevel( ucaller, index * ilevel / iloops, false )
call TriggerSleepAction( 0.5 )
set index = index + 1
endloop
In the code above the index value is unbounded and may (possibly) reach 2^31 - 1. However the "SetHeroLevel" function doesn't even gradually increment the hero's level! In the current code example it will start from 35, then jump to 51 and stay there for a minute, until the hero level SUDDENLY reaches the "GameConstant -> Hero Maximum Level".
I tried using a direct "Grant XP" function with 100K as an increment, but it's too small of a value to reach, say, level 120. Using a bigger value to XP increments repeats the above problem: no effects at all for a minute, then jump to the maximum level.
Also, worth mentioning is that "Hero -> XP Gained -> Hero", "Hero -> XP Gained -> Normal", "Hero -> XP Required" are all set to custom values.
How would you deal with it and did you encounter that problem?
Last edited: