Skip to content

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

5.0 (12 ratings)
In reply to }{0TT@6bI4
User Avatar
#5402
Auto-translated
}{0TT@6bI4
I haven't tested which buffs can be applied via script; Waterfall is more knowledgeable in this area, as he has tested it.

Well, I also haven't tested what can be applied via script (because I've never written a single script).
But each skill has a BUFFS graph, and you can put something in there. xD
For example, here's an example: the Berserker Rune is entered into the buffs graph, and now the Knight's center perk allows his army to attack twice.
Ссылка на мой мод Heroes 5 Armageddons Blade

Ссылка на мои уроки по модостроению в Героях 5

Ссылка на мой Artstation
User Avatar
#5403
Auto-translated
Okay. I need to test which buffs can be applied using a script. If I'm not mistaken, this includes at least the "bonuses" of cities.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#5404
Auto-translated

Hello again! 👻 I have another question: is it possible to move the progress counter change out of scripts into a text file? I know this works with MessageBox, after opening the 3rd campaign map for Ornella and Arantir. There it looks like this:

            addedCreatures = ZOMBIE_COUNT - difLevel*5;
MessageBox({"Maps/Scenario/A2C1M3/MessageBox10_GraveYardZombie.txt"; quantity = addedCreatures});

 

and in the text file itself:

"Вы наняли на этом погосте <value=quantity> зомби!"


What I want is to use something similar for SetObjectiveProgress. I wrote the script:

red_troops_count = 0;

function red3()
print("Проверяем сколько челов собрал Влад");
if red_troops_count ~= 3 then
red_troops_count = red_troops_count + 1;
print("Влад собрал ", red_troops_count ," демонов из 3");
sleep(1);
SetObjectiveProgress( "test_obj", red_troops_count );
else
if red_troops_count == 3 then
SetObjectiveProgress( "test_obj", red_troops_count );
print("Влад собрал всех демонов. Arrivederci Signor Giocatore!");
end;
end;
end;

for i = 1, 3 do
Trigger( OBJECT_TOUCH_TRIGGER, "rh"..i, "red3" )
end;

And the quest progress text:

Собрано <value=red_troops_count> из 3 демонов


The script works (though I wish someone would teach me how to place 'end's properly, because sometimes +100500 scenario restarts just to check for script errors start to get tedious), but the quest progress text doesn't pick up that very progress, leaving the space between "Collected" and "of" empty. 

User Avatar
#5405
Auto-translated
Azgalor does not support this feature in quest descriptions, and besides, you invented the syntax yourself. For it to work (where it can work), it must be written exactly as in the example – in curly braces, separated by semicolons, in the form of an assignment of a name from the text file and a value. But if there are only a few quest progress stages, you can create a separate description for each: "1 out of 3 demons collected," "2 out of 3 demons collected," and so on. This is described in the FAQ in my signature.
Azgalor
Someone should teach me how to properly place the `end` statements.
Just indent all internal code blocks relative to the outer block, for example:
function red3()
  print("Checking how many troops Vlad has collected");
  if red_troops_count ~= 3 then
    red_troops_count = red_troops_count + 1;
    print("Vlad has collected ", red_troops_count, " demons out of 3");
    sleep(1);
    SetObjectiveProgress( "test_obj", red_troops_count );
  else
    if red_troops_count == 3 then
      SetObjectiveProgress( "test_obj", red_troops_count );
      print("Vlad has collected all the demons. Arrivederci, Signor Giocatore!");
    end;
  end;
end;
And there will be no problems with `end` statements; everything will be visually clear.
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо
User Avatar
#5406
Auto-translated
I also recommend using a script editor that kindly prompts you about missing `end` statements and highlights which block is not closed.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to Jack_of_shadows
User Avatar
#5407
Auto-translated
Jack_of_shadows
Azgalor does not support this feature in quest descriptions, and besides, you invented the syntax yourself. For it to work (where it can work), it must be written exactly as in the example - in curly braces, separated by semicolons, in the form of an assignment of a name from the text file and a value. But if there are only a few quest progress steps, you can create a separate description for each: "1 out of 3 demons collected", "2 out of 3 demons collected", etc. This is described in the FAQ in my signature.
Just indent all internal code blocks relative to the outer block, for example:
function red3()
print("Checking how many creatures Vlad has collected");
if red_troops_count ~= 3 then
red_troops_count = red_troops_count + 1;
print("Vlad has collected ", red_troops_count ," demons out of 3");
sleep(1);
SetObjectiveProgress( "test_obj", red_troops_count );
else
if red_troops_count == 3 then
SetObjectiveProgress( "test_obj", red_troops_count );
print("Vlad has collected all the demons. Arrivederci Signor Giocatore!");
end;
end;
end;


And there will be no problems with the 'end' statements, everything will be visually clear.

Yes, after submitting my question, I tried to write ObjectiveProgress like a message box, and received an error that the first argument was incorrect. It's a pity that the developers didn't implement this functionality for ObjectiveProgress as well, because, for example, I need the progress to change for each creature, and there are 20-30 of them planned (I only set 3 for testing the script), and for this I will have to create 30 text files?... Well, okay, true heroes always find a workaround, as they say. 😄 For now, I'll download the FAQ from your signature and read what's in it.

Are internal code blocks relative to the outer block things like checks and sub-functions? Like if, while, SetObjectiveState? I'm a complete zero in scripting terms. 💀



Added 1 minute ago
}{0TT@6bI4
I also recommend using a script editor that kindly prompts you about missing 'end' statements and highlights which block is not closed.
I downloaded it, but haven't used it. I only read the introduction about Lua and what checks there are, etc. Thanks to it, I learned what an array is. I need to try working with it.
User Avatar
#5408
Auto-translated
Azgalor
There are plans for 20-30 of them.
It would also look good to make progress every 5 or 10 creatures.
Azgalor
Are the internal code blocks relative to the external block, like various checks and sub-functions? Like if, while, SetObjectiveState?
Yeah, everything that starts with a keyword and ends with end or else.
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо
User Avatar
#5409
Auto-translated
And another question that has been bothering me for a while. Basically, there's a function called MakeHeroReturnToTavernAfterDeath. The situation is this: I have an allied Knight with the hero Dugald. I've set it up so that this ally doesn't hire anyone except Dugald, meaning everything is set to zero through AllowPlayerTavernRace, and Dugald is allowed through AllowPlayerTavernHero(player, "Orrin", 1), and MakeHeroReturnToTavernAfterDeath is enabled so that the brave knight fights until he's defeated. The time comes, and this indeed happens; the player-Dugald loses, and now there's either a bug or something I don't understand: I can't rebuild Dugald. That is, I block him from being hired by the defeated player, allow him for myself, and, just to be sure it "works," I set his return to the tavern after death to zero, but he doesn't appear. A week or two goes by, and he still doesn't show up. Is there any way to fix this?
#5410
Auto-translated
Guys, please tell me how to create custom weekly challenges on a map, for example, so that there is only a "week of gold" or a specific creature?
User Avatar
#5411
https://vk.com/wall-197578149_226
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#5412
Auto-translated
Hello. I have a couple of interesting questions.
1) Is it possible to transfer the specialization of any hero (for example, Shadia) to a hero of another faction, but with their own description and icon (it is probably possible to do this, but I am asking just in case).
2) When creating my own dwelling, I encountered a problem: the indicator of belonging to the player is half-hidden in the texture (screenshot attached). Is it possible to fix this?
3) I remember seeing an old icon of Godric (where he is holding a sword on his shoulder) somewhere. I have searched half the Internet, looked among the icons of the Tribes of the East, but I couldn't find it anywhere. Maybe someone knows where it is located.
Attachments 1
1 file attached • Total size: 405.6 KB
Сценарий: "Наследие прошлого"
Кампании:
"
Новый порядок", "Серый Альянс""Поиски Истины"

Трейлер №2 кампании "Дыхание Пустоты": https://www.youtube.com/watch?v=XkHKXk5BctA&ab_channel=%D0%90ndrei_21

User Avatar
#5413
Auto-translated
1) How do I create my own hero?
2) Honestly, I don't know. Perhaps you could change the position of the effect, but then it will also shift upwards in all other places.
3) This icon?
Attachments 1
1 file attached • Total size: 19.7 KB
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#5414
Auto-translated
Thank you for the clarification, }{0TT@6bI4, the icon is indeed the correct one. It was just displayed in full size on some artwork.
Сценарий: "Наследие прошлого"
Кампании:
"
Новый порядок", "Серый Альянс""Поиски Истины"

Трейлер №2 кампании "Дыхание Пустоты": https://www.youtube.com/watch?v=XkHKXk5BctA&ab_channel=%D0%90ndrei_21

User Avatar
#5415
Auto-translated
Hello. And here I am again with my problems. The first one is related to mission 4 of my campaign. Judging by the feedback on the forum and walkthroughs on YouTube, the Necropolis castle is not destroyed. Although in the "Razed" section, it shows the ruins of a human city. Personally, everything works for me; the city explodes under "Meteor Shower" (screenshots are attached). I don't understand what causes this bug. The second problem: I don't understand how to systematize the appearance of "red heroes" in the tavern. Some players cannot hire heroes at all. Restarting the map solves the problem, but I would like to know: is it possible to eliminate this random probability?
Attachments 4
4 files attached • Total size: 1.6 MB
Сценарий: "Наследие прошлого"
Кампании:
"
Новый порядок", "Серый Альянс""Поиски Истины"

Трейлер №2 кампании "Дыхание Пустоты": https://www.youtube.com/watch?v=XkHKXk5BctA&ab_channel=%D0%90ndrei_21

User Avatar
#5416
Auto-translated
Regarding the castle, I don't have any ideas yet, but hiring heroes is quite straightforward. You need to use the function AllowPlayerTavernRace(player number, TOWN_XXX, nil) for all races except humans, and AllowPlayerTavernHero(player number, "hero name", nil) for all heroes except the red ones.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________