What is SetStandState actually used for?
apparently, it is used to store information that is later used in scripts (I haven't found any other use for it). It's like SetObjectiveState, which we assign to a player, and then a task is activated/completed for them, and then we check its state with if GetObjectiveState ... and perform some actions. The same applies to SetStandState, only it doesn't change anything in the game, but simply sets a number, by checking which, various conditions can be performed in scripts.
Added 2 minutes ago
while 1 do
x, y = GetObjectPosition("Hero2");
MoveHeroRealTime("Hero3", x+1, y, -1);
sleep(20);
end;
or even like this:
while 1 do
if IsObjectExists("Hero2") == true then
x, y = GetObjectPosition("Hero2");
MoveHeroRealTime("Hero3", x+1, y, -1);
else return;
end;
sleep(10);
end;
P.S. This probably needs to be moved to the "Scripts" topic
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация