Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
I was writing from my phone, so I might have missed a space between `sleep(1)` and `end`. Please add it there. I will "clarify" the number and position of the `end` commands from my computer.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
Auto-translated
I added a space, but nothing changed; the map freezes, and it can't be loaded. Am I writing everything correctly?
function GarrisonBlock()
while 1 do
if GetObjectOwner("Fortress_2")==GetObjectOwner("Dungeon_1") then
SetObjectEnabled("Garnizon_1", 1, GetObjectOwner("Dungeon_1"))
while not IsObjectEnabled("Garnizon_1") do sleep(1)end
end
for i=1,8 do
if GetPlayerState(i)==PLAYER_ACTIVE and i~=GetObjectOwner("Dungeon_1") and i~=GetObjectOwner("Fortress_2") and IsObjectEnabled("Garnizon_1") then
SetObjectEnabled("Garnizon_1", nil, i)
end;
end;
end;
sleep(1)

end;

startThread(GarrisonBlock)
Added 1 minute ago I probably added commas unnecessarily, but I removed them, and nothing changed.
User Avatar
Auto-translated
You don't need to put semicolons at all.
function GarrisonBlock()
  while 1 do
    if GetObjectOwner("Fortress_2")==GetObjectOwner("Dungeon_1")  then
      SetObjectEnabled("Garnizon_1", 1, GetObjectOwner("Dungeon_1"))
      while not IsObjectEnabled("Garnizon_1") do sleep(1) end
    end
    for i=1,8 do
      if GetPlayerState(i)==PLAYER_ACTIVE and  i~=GetObjectOwner("Dungeon_1") and i~=GetObjectOwner("Fortress_2") and IsObjectEnabled("Garnizon_1") then
        SetObjectEnabled("Garnizon_1", nil, i)
      end;
    end;
  sleep(1)
  end;
end;

startThread(GarrisonBlock)


I put the second sleep(1) in the wrong place, so the loop was running without a pause, and the game would freeze if the condition wasn't met.

С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
Auto-translated
Yeah, now everything works. Thanks! You'll end up writing the whole map for me.
In reply to Марта
User Avatar
Auto-translated
1. Good afternoon, I need a script for a quest, specifically a quest type where the objective is to reach a specific region. 2. Also, is there a script that adds creatures to the army after a dialogue?
User Avatar
Auto-translated
Alinksolo, I'm curious, have you tried to find an answer to your question in any way? For example, by reading the list of functions from the developers. And maybe you would have noticed "AddHeroCreatures" with your own eyes. How would you translate that? 🤔 I don't know. But question number 2 would be solved.

And question number 1 would also be solved if you just thought about it and knew what triggers are.

1. In the quest properties, set OBJECTIVE_KIND_MANUAL.
In the script:
function ReachRegion(hero)
if hero=="Hero Name" then
SetObjectiveState("Scripted quest name", OBJECTIVE_COMPLETED)
sleep(20)
Win()
end
end

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "Region Name", "ReachRegion")

2. AddHeroCreatures("Hero Name", ID, quantity)
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to Alinksolo
User Avatar
Auto-translated
Alinksolo
1. Good afternoon, I need a script for a quest, that is, a quest where you need to reach a specific region.
2. And also, is there a script that adds creatures to the hero's army after a dialogue?
The script AddHeroCreatures adds creatures to a hero's army. AddHeroCreatures("hero name", creatureID, quantity)


Added 4 minutes later
}{0TT@6bI4
Alinksolo, I'm just curious, did you even try to find an answer to your question? Well, let's say, by reading the list of functions from the developers. And maybe you would have noticed "AddHeroCreatures" with your own eyes. How would you translate that? 🤔 I don't know. But question number 2 would be solved.

And question number 1 would also be solved if you just thought about it and knew what triggers are.

1. In the quest properties, set OBJECTIVE_KIND_MANUAL.
In the script:
function ReachRegion(hero)
if hero=="Hero Name" then
SetObjectiveState("Scripted quest name", OBJECTIVE_COMPLETED)
sleep(20)
Win()
end
end

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "Region Name", "ReachRegion")

2. AddHeroCreatures("Hero Name", ID, quantity)

If I understand correctly, he needed the quest to be completed. But then why Win? With it, the player automatically wins. Although, I might be wrong.
User Avatar
Auto-translated
Automatic victory depends on the task settings. Since I don't know them, I've added a victory condition after a 4-second delay, just in case. This won't cause any errors.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
Auto-translated
Alinksolo, I strongly recommend that you read the HOMM5_Editor_Practical_Guide file, which should be located in the Editor Documentation folder within the game files. Also, in general, study all the files in this folder.
In reply to Азгалор
User Avatar
Auto-translated
Azgalor
Alinksolo, I highly recommend reading the HOMM5_Editor_Practical_Guide file, which should be located in the Editor Documentation folder within the game files. In general, study all the files in this folder.
It's a very useful resource, especially when it comes to design. It helps avoid creating a forest of sticks and allows you to understand how the original design was made.
User Avatar
Auto-translated
It seems that without reading the manuals, users can't place different types of trees, only identical ones. And even the most beautiful designs were created by fans like Alexey Mepravy, not the developers. Therefore, I recommend looking at various popular maps and learning different tricks from them. P.s. Azgalor is still right, and the developer's manual should be read in your free time.
С уважением, }{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
I apologize, I will definitely take a look. 😁
I have a file about script commands, but they are all in English, and I can't translate everything, so I'm asking about the script name so that I can find that script, copy it, and translate it. I apologize again.
In reply to Alinksolo
User Avatar
Auto-translated
Alinksolo
I apologize, I will definitely take a look. 😁
I have a file about script commands, but they are all in English, and I can't translate everything, so I'm asking about the script name so that I can later find that script, copy it, and translate it. I apologize again.
In the folder with the original game, there should be a Russian version. They are, in my opinion, generally the same.
In reply to Григорий Ковалев
Auto-translated
Hottabych, I have a question that's not entirely on topic. Where can I download maps by this Alexey Mepravy? I looked through the forum, but it seems to only have links to HMM 3. I really love beautiful designs, and if he created anything for HMM5, I would like to check it out.

Statistics

Welcome our newest member: Emil