Skip to content

Posts from Current questions and answers regarding the map editor. Auto-translated

5.0 (12 ratings)
User Avatar
#4768
Auto-translated
Not entirely on topic, but... could you please tell me the names of scenarios where the patrol mechanic is present in some way (for example, like in the first mission of the Necromancer campaign)?
I mean not only official scenarios, but also any user-created ones.
Автор карт:
Долина расхитителей
Выбор мира
User Avatar
#4769
Auto-translated
Question regarding animations on the map. When I run a script where two creatures start fighting (a water elemental and a fire elemental), the actions happen, but they appear to lose their visual effects. The fire elemental loses its fire effect and looks like an orange snake, and the same happens with the water elemental. Is it possible to restore their effects, or is this how it's supposed to be?
Автор карт:
Долина расхитителей
Выбор мира
User Avatar
#4770
Auto-translated
Question about animations on the map.
Are you setting the animation type to IDLE? They are (probably) incorrectly defined for these creatures. I suggest creating the battle as a series of ONESHOT animations. It works perfectly, and you can also set a floating interval between attacks, which looks much more realistic. That's what I always did:
function BattleThread()
  while (true) do
    if (IsObjectExists(CREATURE 1)) then
      PlayObjectAnimation(CREATURE 1, 'attack00', ONESHOT);
    end
    sleep(random(10)+5);
    if (IsObjectExists(CREATURE 2)) then
      PlayObjectAnimation(CREATURE 2, 'attack00', ONESHOT);
    end
    sleep(random(10)+5);
  end
end

startThread(BattleThread);
You can experiment with the intervals, types of attacks, you can set that when one creature attacks, the other receives the hit, and a whole bunch of other things.
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо
User Avatar
#4771
Auto-translated
Not entirely on topic, but... could you please tell me the names of scenarios where the patrol mechanic is present in some way (for example, like in the first mission of the Necromancer campaign)?
I think Master had something like that, but I'm not sure.
 

К А
Стикеры GBF в Telegram
In reply to Jack_of_shadows
User Avatar
#4772
Auto-translated
Jack_of_shadows
Are you setting the animation type to IDLE? They are (probably) incorrectly defined for these creatures. I suggest creating a battle as a sequence of ONESHOT animations. It works perfectly, and you can also set a variable interval between attacks, which looks much more realistic. That's how I always did it:
function BattleThread()
while (true) do
if (IsObjectExists(CREATURE 1)) then
PlayObjectAnimation(CREATURE 1, 'attack00', ONESHOT);
end
sleep(random(10)+5);
if (IsObjectExists(CREATURE 2)) then
PlayObjectAnimation(CREATURE 2, 'attack00', ONESHOT);
end
sleep(random(10)+5);
end
end

startThread(BattleThread);

You can experiment with the intervals, types of attacks; you can set it so that when one creature attacks, the other receives the attack, and a whole lot more.
Hmm, is it necessary to select the animations themselves in the shared properties of the creatures? I have some fire and water element animations selected there, but your function doesn't work, and the units just stand there. Here's what I entered, just in case. Also, the print statement doesn't indicate that the animation is complete.
function BattleThread()
while (true) do
if (IsObjectExists(elemF)) then
PlayObjectAnimation("elemF", "attack00", ONESHOT);
end
sleep(random(10)+5);
if (IsObjectExists(elemW)) then
PlayObjectAnimation("elemW", "attack00", ONESHOT);
end
sleep(random(10)+5);
print("animation elemov complete")
end
end

startThread (BattleThread);
Here's what the console says:
Автор карт:
Долина расхитителей
Выбор мира
In reply to OrnsteinDragonslayer
User Avatar
#4773
Auto-translated
OrnsteinDragonslayer

Here's what the console says:
You have `elemF` written without quotes, even though in the next line everything is correct. This is the cause of the error.
#4775
Auto-translated
Hello. I often play with huge maps against combined AI opponents. And 8 heroes are often not enough to defend, attack, and provide reinforcements simultaneously.
I thought it was a minor issue, as you could go into the editor and set the desired number of heroes for each player. But it turned out that setting 9, 10, etc., made the game unplayable. You couldn't switch to those heroes and play with them, and when the AI attacked such a hero, it would simply freeze.
Does anyone know how to set more than eight playable heroes for one player?
In reply to OrnsteinDragonslayer
User Avatar
#4777
Auto-translated
OrnsteinDragonslayer
Regions. I made it so that a certain region is blocked for a certain player. Is there a script that will remove this block during the game?
If you are talking about the SetRegionBlocked function, then its second parameter is true or nil. Just write the same function for the same region, but with nil instead of true, and the block will be removed.
User Avatar
#4778
Auto-translated
Thanks, here's another question. It's about the dialogues. I created one line, positioned the camera where I wanted. I pressed the "+" on the numpad, set everything up, and it works. But when I want to create a second line (a continuation of the previous one, but I want to change the camera), I press "+", but it still offers me to create a camera position for the first line, and there's no second one. How do I control the camera in these dialogues?

Added 1 hour 7 minutes ago
I figured it out, but I won't delete the question. Maybe someone else will need it. Basically, in this menu, I only have 0, even though there should be 2 dialogues.

But if you remove the dropdown menu and just click up and down with the keys on the right, then the dialogues will switch accordingly, so I have 0 and 1.

Added 1 hour 53 minutes ago
Another question. What script command can change the owner of a building? I need it for a town. Transformtown seems to only change the type of town, but I want to keep my town, but just change the owner, so to speak. Is that possible?
Автор карт:
Долина расхитителей
Выбор мира
User Avatar
#4779
Auto-translated
SetObjectOwner('object name', player number)
Нет войне.