_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
New here? I'm Roha — want a quick tour?
You made a mistake, dear BlueHeavenHero. It's not necessary to explicitly specify passing nil as a parameter (except in rare cases, which I can explain), as any undeclared value is initially considered nil. That is, the last three (four) nil values can be omitted altogether. Furthermore, REGION_ENTER_... is a variable with a mnemonic name that stores the trigger's ID number. And this number can be passed manually, as Loli Nikita did. Of course, if he made a mistake with the number and 6 refers to the trigger that changes the quest state, then you are right.
Please advise on one thing. On my map, there is a castle belonging to the fourth player, but the city lacks a tavern, and there are no heroes on the map. However, he summons troops from buildings on the map, and caravans travel to his castle. Is there a way to prevent him from doing this, perhaps with a script?
As an alternative: place a region in front of the city and block it for the fourth player.
No, just output it through a message box, for example, MessageBox.
Hello. Can anyone help me with a script? I don't understand how the StartCombat command works at all. For example, I want a message to appear when entering a region, and then a battle to begin. I came up with the following script:
function Region1F()
sleep(5);
MessageBox("/Maps/SingleMissions/MapochkaTEST3/battletext.txt");
sleep(5);
StartCombat("RedHeavenHero04", "Ottar", 4, 166, 100, 166, 100, 167, 75, 169, 50, 170, 15);
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"Region1",nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"Region1","Region1F");
But it doesn't work - the message appears, but the battle doesn't start.
And my second question is - how can I make creatures play animations on the map? For example, I want two stacks of creatures on the map to play attack animations against each other. Please tell me how I can implement this.
Thank you in advance.
Today I'll share a script for creature attack animations.
I'd be grateful 😊
I'll be grateful 😊
function battle()
local PlayObjectAnimation = function(mob, anim)
if IsObjectExists(mob) then
PlayObjectAnimation(mob, anim, 3)
end
end
while IsObjectExists("name of attacking creature") do
if IsObjectVisible(1, "name of attacking creature") then
PlayObjectAnimation("name of attacking creature", "attack00")
sleep(4)
PlayObjectAnimation("name of defending creature", "hit")
sleep(15 + random(15))
PlayObjectAnimation("name of defending creature", "attack00")
sleep(4)
PlayObjectAnimation("name of attacking creature", "hit")
end
sleep(15 + random(15))
end
end
startThread(battle)
Sorry, I completely forgot about my promise. Here's the script:function battle()
local PlayObjectAnimation = function(mob, anim)
if IsObjectExists(mob) then
PlayObjectAnimation(mob, anim, 3)
end
end
while IsObjectExists("name of attacking creature") do
if IsObjectVisible(1, "name of attacking creature") then
PlayObjectAnimation("name of attacking creature", "attack00")
sleep(4)
PlayObjectAnimation("name of defending creature", "hit")
sleep(15 + random(15))
PlayObjectAnimation("name of defending creature", "attack00")
sleep(4)
PlayObjectAnimation("name of attacking creature", "hit")
end
sleep(15 + random(15))
end
end
startThread(battle)
No worries about the time. To be honest, I didn't expect a response in the next few days.)
Hello. Can anyone help me with a script? I don't understand how the StartCombat command works at all. For example, I want a message to appear when entering a region, and then a battle to begin. I came up with the following script:
function Region1F()
sleep(5);
MessageBox ("/Maps/SingleMissions/MapochkaTEST3/battletext.txt");
sleep(5);
StartCombat ( "RedHeavenHero04", "Ottar", 4, 166, 100, 166, 100, 167, 75, 169, 50, 170, 15);
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"Region1",nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"Region1","Region1F");
But it doesn't work - the message appears, but the battle doesn't start.
And my second question is - how can I make creatures play animations on the map? For example, I want two stacks of creatures on the map to play attack animations against each other. Please tell me how I can implement this.
Thank you in advance.
Try using this instead of your current start combat:
StartCombat ( "RedHeavenHero04", "Ottar", 5,166, 100, 166, 100, 167, 75, 169, 50, 170, 15);
If it doesn't work, it means that either the hero Ottar doesn't exist in the map, or he is NOT in the enemy player's reserve. If Ottar is on the global map as just a hero, the battle won't start - you need to put him in the enemy player's reserve.
Thank you, I didn't know about the reserve, and indeed, he wasn't reserved. I'll try to redo it tomorrow, I've temporarily removed Ottar completely. I just put a strong group of neutral gnomes as a temporary fix.