Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to Navkratis
User Avatar
Auto-translated
Navkratis
I have the first guide from the link; I tried to write a script based on it, as well as the Novikov one, but honestly, I didn't really understand it – it gives a line of code, says what it does in the game, but doesn't provide the complete script with it, and for me, as someone with no background in programming, that's not obvious at all :o. Also, back in the day, I made maps for Heroes 2 and 4, created many campaigns for the first Starcraft, and made a test map in Age of Wonders 2 – and I learned all of that on my own. As for the editor for Heroes 5, studying it at any stage turns into a constant, never-ending headache :D. And if I take a few months off from Heroes, I feel like I've already forgotten half of it. Although, maybe I'm just getting old.

Okay, I've complained a bit, I'll go download the two remaining links, maybe something will come of it). In any case, thank you for your time.

Have you checked if the piece of code I wrote for you works?
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
Auto-translated
}{0TT@6bI4
Did you check if the code snippet I wrote for you works?
Yes, thank you very much, it all works, I was even surprised :) For now, I'll limit myself to just this script, otherwise I'll never finish the map, especially since two other problems have emerged that are not related to scripts).
In reply to Navkratis
User Avatar
Auto-translated
Navkratis
Yes, thank you very much, everything works now, I was even surprised :) For now, I'll limit myself to this one script, otherwise I'll never finish the map, especially since two other problems have emerged that are not related to scripts.
Well, at this level, I already write scripts flawlessly) so I'm not surprised. Never say you'll limit yourself to this - keep learning new things) And if anything, I'll help, or someone from the old guard, or just good people will :D
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
Auto-translated
}{0TT@6bI4
Well, at this level, I can write scripts flawlessly, so I'm not surprised. Never say you'll limit yourself – keep learning new things! And if you need help, I or one of the veterans or just good people will assist you :D
Thank you, then one last question, not related to scripts: for some reason, the additional quest (type capture_object), related to capturing a neutral town, is not displaying. I checked the script name of the town, and it's exactly the same. https://ibb.co/7vSbbML
In reply to Navkratis
User Avatar
Auto-translated
Navkratis
Thank you, then one last question, not related to scripts :) - for some reason, the additional quest (type capture_object), related to capturing a neutral town, is not displayed. I checked the script name of the town, and it is exactly the same. https://ibb.co/7vSbbML
Remember - all object names must be in English! To create a name for your town, click on the town; if you do it correctly, it will be highlighted in red; in the window on the left, in the town parameters, select Name, enter any name in English, and then enter this name where you wrote Ia-Ditan.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
Auto-translated
Thank you. After assigning an English name to the city, the quest appeared, even though `ignore: true` was set. Regarding this – the manual states that “when set to ‘true’, it is not taken into account when checking for victory or defeat,” and since this is an optional quest, I intentionally set it to this value. In any case, the quest is now displayed, so I’ll start a test playthrough. I hope it will be more successful than yesterday, when it kept crashing on the fifth day of the third week of the second month :D
Auto-translated
hello dear friends
please help me
I suddenly realized that I want to create maps in Heroes
but I realized that I'm completely clueless, please help me with the scripts

function kingblok
if GetObjectiveState("sec2") == OBJECTIVE_COMPLETED
then SetRegionBlocked("block", nil, -1);
end;
end;

what's wrong here?
In reply to Marek
User Avatar
Auto-translated
There is no trigger that starts the function. It should be something like this: function kingblok while 1, GetObjectiveState("sec2") == OBJECTIVE_COMPLETED do sleep(5); SetRegionBlocked("block", nil, -1); end; end; startThread(kingblok);
In reply to Долгий
Auto-translated
then the question arises again, what does the command do?

startThread(kingblok);
and what trigger should be used here if the function should work after the side quest is completed?

Added 2 minutes ago
and the script editor gives an error on the second line.

function kingblok while 1, GetObjectiveState("sec2") == OBJECTIVE_COMPLETED do sleep(5); SetRegionBlocked("block", nil, -1); end; end; startThread(kingblok);
In reply to Marek
User Avatar
Auto-translated
startThread(kingblok); this launches the function for the first time, and the function will continue to run at intervals using sleep() until the task is completed. It throws an error because there are no parentheses next to kingblok.

function kingblok()
while GetObjectiveState("sec2", --replace_with_player_id) ~= 3 do
sleep(5);
end;
SetRegionBlocked("block", nil, -1);
end;
startThread(kingblok);
In reply to Долгий
Auto-translated
thank you

Added 37 minutes ago
a new problem has appeared. I set up a quest.
In it, you need to kill 4 heroes who will appear after a month.
And with their appearance, it's player 2.
Player 1 should receive the quest.
But something isn't working.

function sec2_active()
SetObjectiveState("sec2", OBJECTIVE_ACTIVE, 1);
end;

Trigger(PLAYER_ADD_HERO_TRIGGER, "sec2_active", 2);
In reply to Marek
User Avatar
Auto-translated
First, the ID, then the function name

Trigger(PLAYER_ADD_HERO_TRIGGER,2,"sec2_active");
User Avatar
Auto-translated
Fellow Heroes enthusiasts, please help me with the following questions: 1) How can I create a large message window, not the standard MessageBox, but a larger one? (the one with the scroll on the left) 2) Is it possible to edit the Mission Log? (the one where dialogues and quest assignments are recorded) 3) How can I make it so that when purchasing a map from a cartographer, both water and land are revealed? Thank you in advance!

Statistics

Welcome our newest member: Emil