_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
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?
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.
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.
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?
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)
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.
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.