Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
6 years ago
Auto-translated
Okay, I’ll need to test it. However, this method is still unreliable because it will be impossible to track units where no one dies.
In reply to Gerter
User Avatar
6 years ago
Auto-translated
Gerter
Okay, I'll need to test it. Although, the method still seems unreliable because it will be impossible to track units where no one dies.
And one more thing, if possible: I noticed that when I set a hero to move to a specific point using MoveHero, they can stop and not move anymore if the path was once blocked. Even after the path is unblocked, the hero will still remain stationary. Is there a way to influence this?
User Avatar
6 years ago
Auto-translated
Ideally, a function like this would allow the hero to continue moving once the obstacle disappears:
function HeroMoveThread(hero, x, y, f)
  while 1 do
    while not IsPlayerCurrent(GetObjectOwner(hero)) do
      sleep()
    end
    local cx, cy, cf = GetObjectPosition(hero)
    if cx == x and cy == y and cf == f then
      break
    end
    MoveHero(hero, x, y, f)
    sleep()
  end
end

startThread(HeroMoveThread, hero_name, destination_coordinates)
If MoveHero is replaced with MoveHeroRealTime, obstacles will be ignored, but the ignoring will be complete, i.e., if the obstacle is, for example, another hero, there will be no battle with him (although I think this can be fixed, but it will be more complicated).
User Avatar
6 years ago
Auto-translated
Thank you very much, once again. I wouldn't have been able to figure this out on my own.
User Avatar
6 years ago
Auto-translated
Is it possible to enable dynamic combat using the `startcombat` function (temporarily)? If so, please provide instructions on how to do it.
User Avatar
6 years ago
Auto-translated
Enable Dynamic Battle Mode in combat. It can’t be disabled, though.
In reply to Gerter
User Avatar
6 years ago
Auto-translated
Gerter
EnableDynamicBattleMode in combat. It can't be disabled, though.
So, does that mean all my battles will be dynamic?
User Avatar
6 years ago
Auto-translated
only in the function where it is called. It seems like you can't disable it again during the battle.
In reply to Gerter
User Avatar
6 years ago
Auto-translated
Gerter
only in the function where it is called. It seems like you can't disable it again during the battle itself.
I understand. And how is the speed of this battle determined?
Would it be correct if I record it like this:
StartCombat(hero, 1, 1, 1, nil, nil, nil, EnableDynamicBattleMode)?
User Avatar
6 years ago
Auto-translated
in combat, I meant in the battle script. I don’t think it’s possible to influence the speed.
In reply to Gerter
User Avatar
6 years ago
Auto-translated
Gerter
in combat, I meant in the combat script. I don't think it's possible to affect the speed.
Evan, it's quite complicated. And maybe you remember if there are any examples of such a function in the original game?
User Avatar
6 years ago
Auto-translated
I don't know about the campaign, but in a regular battle, you can activate dynamic mode by using EnableDynamicBattleMode(1) in the appropriate battle.
In reply to OrnsteinDragonslayer
User Avatar
6 years ago
Auto-translated
OrnsteinDragonslayer
Evan, that's quite complex. Do you recall if there are any examples of a similar function in the original game?
I think there was something like that in the last mission of the last campaign for the Hammers of Fate, involving King Tolgar.
User Avatar
6 years ago
Auto-translated
Hello everyone. Is it possible to increase the size of a creature in the editor? So that the creature is larger.
In reply to John_Lock
User Avatar
6 years ago
Auto-translated
User01322342
Hello everyone. Is it possible to increase the size of a creature in the editor? So that the creature would be larger.
Technically, it is possible to make a small creature appear larger. However, the model will remain the same; it will simply occupy a 2x2 grid space. This is not done directly in the editor but by modifying the game's internal files.

Statistics

Welcome our newest member: recijeb