Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
#3444
Auto-translated
Inside the function, before the MessageBox, place a trigger that resets:
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "RegionName", nil)
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#3445
Auto-translated
A question arose: there is a created mob with its own characteristics and abilities. Is it possible to edit it, taking into account the selected difficulty level? When loading a map.
Or is it only possible by creating 4 identical mobs with different settings for each of the 4 difficulty levels?
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
User Avatar
#3446
Auto-translated
Do you mean dynamically changing the abilities and characteristics of creatures? No, unfortunately, that is not possible.
С уважением, }{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
#3447
Auto-translated
Hello! This script doesn't work, it crashes with the error Attempt to compare nil with number
HEAL = {}
HEAL.variant = -1

Healing_arts = {{id=176, heal = 50}, {id=177, heal = 10},}

function HEAL.UseHeal(pl, ans)
if not ans then
HEAL.heal_arts_on = {}
for key, art in Healing_arts do
if HasArtefact(MAIN_HERO, art.id) then
table.insert(HEAL.heal_arts_on, art.id)
end
end
HEAL.len = length(HEAL.heal_arts_on)-1
print(HEAL.len, ' - длина 'массива) --Выводит минус единицу - длина массива
sleep()
if 0 < HEAL.len <= 4 then ---ВОТ ЗДЕСЬ ПАДАЕТ СКРИПТ.
print('Проверка') --НЕ ВЫВОДИТСЯ В КОНСОЛЬ
HEAL.variant = 1
local pthheal = "Interface/CustomAbilities/UseFirstAidKit/"
local options = {}
local values = {}
while not values and not options do
sleep()
end
for i=1, HEAL.len do
print (HEAL.len)
print('Проверка 2 ', HEAL.heal_arts_on)
options=pthheal..'Use_'..i..'...'
values= artifacts[HEAL.heal_arts_on].name
--
end
while not options[HEAL.len] do
sleep()
end
options[HEAL.len+1]=Talk.BACK
Talk.mode = 1

Talk.NewDialog(GetIconPath('Heal'), pthheal..'Heal', pthheal..'HealDesc', 'HEAL.UseHeal', options, values)
--
-- elseif HEAL.len > 4 then

elseif HEAL.len <= 0 then
print('Ai?oe') ---ТОЖЕ НЕ ВЫВОДИТСЯ В КОНСОЛЬ
Talk.mode = 1
Talk.NewDialog("/UI/MessageBox/Warning.xdb#xpointer(/Texture)", pthheal.."WarningNoKit", pthheal.."NoKit", nil)
end
elseif ans then
if HEAL.variant == 1 then
if 0<ans<5 then
STALKER.ChangeHealth(artifacts[HEAL.heal_arts_on[ans]].heal)
RemoveArtefact(MAIN_HERO, HEAL.heal_arts_on[ans])
end
end
end
end


This function is called from the spell book, the first call goes fine, but the second one errors out at the specified location. I don't even know what the problem is, though it's probably related to scope. But how to fix it (and more importantly, what exactly) — I have no idea...

С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#3448
Auto-translated
if HEAL.len = -1, then the check 0 < heal.len will return nil, which will then be compared to 4, causing an error. It's simpler to write the condition as if heal.len > 0 and HEAL.len <= 4.
Нет войне.
User Avatar
#3449
Auto-translated
It works, thank you very much!
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
#3450
Auto-translated
function pabota() SetObjectEnabled("slava", false); sleep(10); SetMonsterSelectionType("slava", 0); PlayObjectAnimation("slava", "attack00", IDLE); end; Trigger(NEW_DAY_TRIGGER, "pabota"); The peasants should constantly attack, but they don't. Can you tell me what's wrong?
User Avatar
#3451
Auto-translated
What a name for your function! It would be better to call it "Peas_working". Regarding the fact that it's not working: did you pass the turn? The "new day" function starts working from the second day. Also, are there any errors in the console?
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
#3452
Auto-translated
It actually starts working on the second day. Is it possible to make it work from the very first day?
Attachments 1
1 file attached • Total size: 102.5 KB
User Avatar
#3453
Auto-translated
Outside the function, just in the script, write this block of code.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
#3454
Auto-translated
I thought about it for a long time and finally understood what needs to be done....

But after thinking some more, I realized...

}{0TT@6bI4, thank you very much!
User Avatar
#3455
Auto-translated
Hello. I'm having a problem with this script: ``` function Win() while 1 do sleep(10) if IsHeroAlive("Quroq") == nil then StartDialogScene("/Maps/SingleMissions/ne5/St3/DialogScene.xdb#xpointer(/DialogScene)"); sleep(10) StartDialogScene("/Maps/SingleMissions/ne5/St4/DialogScene.xdb#xpointer(/DialogScene)"); sleep(10) Win(); break; end; sleep(3) end; end; startThread(Win); ``` The dialogs are looping (for some reason I don't understand). The Win command isn't working. Can you tell me where I made a mistake?
User Avatar
#3456
Auto-translated
Here is that snippet:
sleep(10) Win();

It restarts the function because you chose the wrong name. Name the function WinCheckLoop and, accordingly, startThread(WinCheckLoop).
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
#3457
Auto-translated
Do you know if there are any commands that check for a specific amount of money and then deduct a certain amount?
User Avatar
#3458
Auto-translated
pl1gold = GetPlayerResource(PLAYER_number, GOLD)
SetPlayerResource(PLAYER_number, GOLD, pl1gold - d),
where d is the delta. If the player doesn't have that much money, it will return an error.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________

Statistics

Welcome our newest member: artem

Users Online 2 users 1614 guests