You can only transfer data through SetGameVar, though.
There is a trigger for the end of the battle, which passes the battle index to the function. And using the battle index, you can get all the information about the destroyed creatures using GetSavedCombat.... It's in the tutorial and also on the forum, Jack of Shadows explained it (searching for GetSavedCombatArmy site:heroesworld.ru should give you results).
Added 1 hour 50 minutes ago
I don't understand how these functions work. I wrote the script:
enemieskilledcounter = 0;
SetTrigger( COMBAT_RESULTS_TRIGGER, "WR_Revenge" );
function WR_Revenge( combatIndex )
print("Function started")
if ( GetSavedCombatArmyHero( combatIndex, 1, "WR" ) == true ) and ( GetSavedCombatArmyCreaturesCount( combatIndex, 2, 112 ) == true ) then
print("Passed the checks")
local revenge_target, count, died = GetSavedCombatArmyCreatureInfo( combatIndex );
print("Passed local")
if revenge_target == 112 and died >= 1 then
print("Passed the check for the death of at least one angel")
enemieskilledcounter = enemieskilledcounter + died;
print("Hero killed ", enemieskilledcounter ," angels");
end
end
endHowever, "print("Passed the checks")" is not displayed, which means the checks are not working. How should I write them then? The developers described everything vaguely in the document, i.e., not at all.