Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to KioM
#426
Auto-translated
KioM
That's the problem; they don't reach the trigger. I'm starting to think that the region acts as an obstacle for them... although there are no region-based restrictions at all (the larger I make the region, the further away from the destination the heroes stop).
So, that's it. If there's a region along the path to the target point, the heroes stop, even though the trigger should activate. I have no idea what's going on.
User Avatar
#427
Auto-translated
the heroes simply didn't have enough movepoints, and the first hero had logistics + a racial skill...

P.S. too bad, I thought the MoveHeroRealTime command allowed you to cover absolutely any distance in one go, but it turns out it only covers the distance for which there are enough movepoints (and you can't make it higher than the maximum movepoints with the command, if you believe the manual. But in the developers' campaign scripts, I found adding a certain number of points to the hero before executing the MoveHeroRealTime command, why, I wonder? if again, according to the manual: "The hero will jump to the specified point. Regardless of whose turn it is and whether or not he has movepoints"! There is an inconsistency...) in general, it's sad :)
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
In reply to KioM
#428
Auto-translated
KioM
The heroes simply didn't have enough movepoints, and the first hero had logistics + a racial skill...

P.S. It's a pity, I thought that the MoveHeroRealTime command allows you to cover absolutely any distance at once, but it turns out it only covers the distance for which there are enough movepoints. (and you can't make it higher than the maximum movepoints with the command, if you believe the manual. But in the campaign scripts, I found that the developers added a certain number of points to the hero before executing the MoveHeroRealTime command, why, I wonder? if again, according to the manual: "The hero will jump to the specified point, regardless of whose turn it is and whether he has movepoints or not"! There is an inconsistency...) in general, it's sad :)
Well, since the points run out, make a check in the process, and, for example, when there are less than half, add the necessary points to the hero. ;)
Or, more simply, teleport closer to the desired point, and then let them run.
By the way, about the manual with errors - there are other ones too :)
In reply to JonnyP
User Avatar
#429
Auto-translated
JonnyP
Since the points are running out, implement the check within the loop, and, for example, when they are less than half, add them to the appropriate hero. ;)

Here's an idea ;) thank you!

It won't look good to teleport them to the middle of the map) They run from the Dungeon (from the point where the player can't see them) through the visible part (large) of the map... so it can only be done this way :)

Added 8 minutes later
I tried, but it doesn't work. I put a sensor that shows that the points are added every second by 2500, but it still runs its distance and stops earlier than it should... I don't understand why the developers didn't come up with such a functional command to move a hero using normal movement over long distances in real time...
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
In reply to KioM
#430
Auto-translated
KioM
Here's an idea ;) thanks!

It won't look good to teleport them to the middle of the map). They run from the Dungeon (from a point where the player can't see them) across the visible part (the large part) of the map... so it has to be this way :)

Added 8 minutes later
I tried it, but it doesn't work. I set up a sensor that shows that points are added every second, 2500 at a time, but it still runs its distance and stops earlier than it should... I don't understand why the developers didn't come up with a functional command to move a hero over long distances in real time using normal movement...
Wow, it really just stopped! :eek:
I'm done giving advice - it won't get you very far :smile17:
In reply to KioM
#431
Auto-translated
KioM
Here's an idea ;) thanks!

It won't look good to teleport them to the middle of the map. They run away from the Dungeon (from the point where the player can't see them) through the visible part (the large part) of the map... so it can only be done this way :)

Added 8 minutes later
I tried, but it doesn't work. I put a sensor that shows that points are added every second by 2500, but it still runs its distance and stops earlier than it should... I don't understand, did the developers really not come up with such a functional command to move a hero by means of normal movement over long distances in real time...


There is such a function - I don't have the source code at hand right now, but you can check the script in the prologue of the Orcs campaign in Lords;

There is also a bug with the hero stopping, related to him passing through the garrison gate - there you can also pull off a "trick," related to creating a point region in the gate.
User Avatar
#432
Auto-translated
antonag07, it's nonsense there... ``` function MoveHeroRealTimeAndReachPoint( heroName, x, y, floor ) moveCost = CalcHeroMoveCost( heroName, x, y, GROUND ); ChangeHeroStat( heroName, STAT_MOVE_POINTS, moveCost ); sleep(1); MoveHeroRealTime( heroName, x, y, GROUND ); end; ``` I made something similar, but the MoveHeroRealTime command doesn't work as it should... I did it using the old MoveHero command instead.
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
User Avatar
#433
Auto-translated
I wouldn't recommend relying on the "sleep" function; it's not a stable script. Its functionality will depend on how fast the hero moves.
 

К А
Стикеры GBF в Telegram
In reply to KioM
#434
Auto-translated
KioM
antonag07, it's nonsense...

function MoveHeroRealTimeAndReachPoint( heroName, x, y, floor )
moveCost = CalcHeroMoveCost( heroName, x, y, GROUND );
ChangeHeroStat( heroName, STAT_MOVE_POINTS, moveCost );
sleep(1);
MoveHeroRealTime( heroName, x, y, GROUND );
end;
I made something similar, and the MoveHeroRealTime command doesn't work as it should... I did it using the good old MoveHero instead.


Why say it's nonsense right away?! It works there...
In reply to KioM
User Avatar
#435
Auto-translated
KioM
That's the thing, they don't even reach the trigger; I'm starting to think that the region acts as an obstacle for them... although there are absolutely no region-based restrictions (the larger I make the region, the further away from the destination the heroes stop :))

I don't know if it's related, but I placed a Mask in one location on the map to prevent anyone from entering. However, as soon as an object (art) is teleported there using scripts, the mask stops working.
User Avatar
#436
Auto-translated
That can’t be. I think you’re teleporting it to the edge of the mask. So, when a hero approaches the mask, they end up on a tile adjacent to the artifact, allowing them to interact with it. If there was another tile of the mask separating them, they wouldn’t be able to reach it.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
#437
Auto-translated
Ment
That can't be. I think you're teleporting it to the edge of the mask. So, when a hero approaches the mask, they end up on a tile adjacent to the artifact, allowing them to interact with it. If there was another tile of the mask separating them, they wouldn't be able to reach it.
Ah, that's how it works. And in one of my maps, this caused me a lot of trouble with object placement.
In reply to Ment
#438
Auto-translated
Ment
That can’t be. I think you’re teleporting him to the edge of the mask. So, when a hero approaches the mask, he ends up on a cell adjacent to the artifact, so he can interact with it. If there was another cell of the mask separating them, he wouldn’t be able to approach.
That’s right – the same applies to moving heroes – when he is moved to a cell where another hero is already standing, the teleported hero ends up on a free cell next to it.
In reply to antonag07
User Avatar
#439
Auto-translated
antonag07
Why immediately call it nonsense?! It works...

it doesn't work (if the hero doesn't have enough maximum movement points, he won't go anywhere; I checked it many times). The distance is simply shorter (they use a smaller distance).

I found a clever way to make the hero run across the entire map using transit regions. I determined the exact distance the hero can travel. I placed regions with additional movement points and a send command at the end points (it all works :). Otherwise, I don't think it's possible to force the hero to travel such distances).
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
In reply to KioM
User Avatar
#440
Auto-translated
KioM
it doesn't work (if the hero doesn't have enough maximum movement points, they won't go anywhere; I've checked this many times). The distance is simply too short (they use it).

I found a clever way to make the hero run across the entire map using transit regions. I determined the exact distance the hero can travel. I placed regions with additional movement points and a send command at the end points (it all works :). Otherwise, I understand that you can't force the hero to travel such distances.
Why force the hero to run across the entire map when you can simply teleport them?
Карты для Heroes of Might and Magic V
Цикл "Закадычные враги": "Особенное гостеприимство, "Супероружие", "Меж молотом и наковальней"
"Падение Шантири"

Кампания для "Кодекса Войны"
"Выбор Сагиттеля"

Statistics

Welcome our newest member: Emil