I mean not only official scenarios, but also any user-created ones.
I mean not only official scenarios, but also any user-created ones.
New here? I'm Roha — want a quick tour?
Question about animations on the map.
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.
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)?
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.
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:
Here's what the console says:
You have `elemF` written without quotes, although in the next line everything is correct. This is where the error comes from.
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?
It might be possible to create new tree objects using old models, but without blocking tiles.