Skip to content

Current questions and answers regarding the map editor.

User Avatar
#5392
Auto-translated
Create a new script (xdb and lua) and link it to your hero using the function SetHeroCombatScript("Hero Name", "/Path to script/ScriptName.xdb#xpointer(/Script)")

In the combat script itself:
function Start()
--We only consider the case when our hero attacks; if the "bad counter" increased when we were attacked, that would be unfair.

local EnemyCreat = GetDefenderCreatures()
flag = 1
for key, unit in EnemyCreat do
if GetCreatureType(unit)=="Bad ID" or GetCreatureType(unit)=="Bad ID 2" then --N blocks of "bad ID" checks
SetGameVar("BadCounter", GetGameVar("BadCounter")+1)
flag = nil
break
end
end
if flag then
SetGameVar("GoodCounter", GetGameVar("GoodCounter")+1)
end
end
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________