Skip to content
#164
Auto-translated
Winner
Is it possible to make it so that when a hero enters a region for the first time, one function is executed, and upon subsequent entries, another function is executed?

And also regarding this code:

if GetSavedCombatArmyHero(a1,0)=="Giovanni" then
Loose();
end;
if (GetSavedCombatArmyHero(a1,1)=="Giovanni") and (GetSavedCombatArmyHero(a1,0)=="Zehir") then
MessageBox(GetMapDataPath().."talk_of_grigorio_6.txt");
SetObjectiveState("kill_pl5", OBJECTIVE_COMPLETED, PLAYER_1 );
SetPlayerResource(PLAYER_1 ,GOLD, GetPlayerResource(PLAYER_1 , GOLD)+20000);
end;
What do (a1,0/1) mean here?
Loss/win.
When executing functions:
Set a counter for function execution or a variable that determines the function names.
But it is clearly easier for you to simply write 1 function with a condition for the first and second entry. A flag (variable) will determine the entry.
Like:
if f=1
first case, f is assigned 2
if f=2
second case

Statistics

Welcome our newest member: Emil