Skip to content

Heroes V - Remake "File restructuring, 'junk' cleanup, and game optimization"

User Avatar
#39
Auto-translated
The game doesn't throw any errors, the console is clean, but the script doesn't work. Any ideas where to look?
You wrote the function, but you didn't write what should trigger it...
For example, startThread. Outside the function.
The second problem is that your function will only run once. To make the game constantly check something, create a loop inside, an infinite one:
while 1 do
end;

But don't forget to add sleep, otherwise the game will freeze.
GetHeroLevel(TownStrongholdHero1) == 3
Starting from level 3? But you wrote that it starts from level 1... I don't understand...
Only for one hero? It would be better to search for all heroes of the stronghold on the map, probably. Also, there's a problem: if this hero dies, the function will crash with an error. You need to check IsHeroAlive.
And ideally, add a break after the skill is acquired, to exit the loop.
If the goal is to wait for the level to reach 3, you can use a trigger instead of an infinite loop; there seems to be a level-up condition there, so check it out.
P.S. Yes, scripts are like that. What did you expect? )
 

К А
Стикеры GBF в Telegram