Skip to content

Current questions and answers regarding the map editor.

#785
Auto-translated
Ment
Does anyone have any ideas on how to determine if a person didn't answer the Sphinx's riddle? I have an idea, but it's poor and doesn't work well.

There is a solution:

SetTrigger( COMBAT_RESULTS_TRIGGER, "MyCombatResultsHandler" ) -- the trigger is activated at the end of each battle on the map, including battles between computers
function MyCombatResultsHandler( combatIndex )
if (GetSavedCombatArmyHero( combatIndex, 1 )==GetSavedCombatArmyHero( combatIndex, 0 )) -- the functions read the script names of the winning and losing heroes
then print('It's a Sphinx') -- if the names are equal, then it was definitely a Sphinx
else print('It's not a Sphinx')
end
end;

A description of this trigger and the functions for reading battle results can be found in HOMM5_A2_Script_Functions.pdf in the TRIBES OF THE EAST FUNCTIONS section.

Statistics

Welcome our newest member: leyu