Auto-translated
h=1;
while h==1 do
x, y = GetObjectPosition("Hero2");
MoveHeroRealTime("Hero3", x+1, y, -1);
end;
end;
New here? I'm Roha — want a quick tour?
h=1;
while h==1 do
x, y = GetObjectPosition("Hero2");
MoveHeroRealTime("Hero3", x+1, y, -1);
end;
end;
sleep is needed within the loop.
What is SetStandState actually used for?
while 1 do
x, y = GetObjectPosition("Hero2");
MoveHeroRealTime("Hero3", x+1, y, -1);
sleep(20);
end;
while 1 do
if IsObjectExists("Hero2") == true then
x, y = GetObjectPosition("Hero2");
MoveHeroRealTime("Hero3", x+1, y, -1);
else return;
end;
sleep(10);
end;
You just need to block the space around the NPC so it can't move anywhere, and it works.
In what sense?
He can move far away from the hero after pressing "end turn," and then he won't have enough movement points to be near the main character.
ChangeHeroStats("Hero3", 7, 3500);then you can add before MoveHeroRealTimeChangeHeroStats("Hero3", 7, 3500);
in general, I advise you to take a look at how it is done in the developers' campaigns, in the 1st mission of the Fortress, if I'm not mistaken, Laslo follows Frida... They made an in-script function to check the distance, so the heroes constantly stay close to each other.
Does anyone know how many movement points a hero has by default?
Does anyone know how many movement points a hero has by default?
2500 - without logistics, 2749 - initial logistics, 2999 - developed, 3249 - advanced.
Also, the Traveler's Boots give +25% to movement points on top of everything...
P.S. I managed to get a maximum of 4661 movement points, logistics + boots + stables.
Thank you. I just had an idea:
ChangeHeroStats - add movement points
MoveHeroRealTime - the hero moves towards the main hero
ChangeHeroStats - completely remove movement points.
This way, when the "end turn" button is pressed, the hero will stay in place.
start = GetHeroStat("Hero3", 7);
ChangeHeroStat("Hero3", 7, start+3500);
MoveHeroRealTime(...); -- (this function is not modal! I tried to make it modal once, and the game crashed :))
sleep(20);
startThread(end);
function end()
end = GetHeroStat("Hero3", 7);
ChangeHeroStat("Hero3", 7, -end);
end;