Auto-translated
Well, there's a method described in Jack of Shadows' FAQ. The only thing I'll add is that each Lua script should have a corresponding XDB file. In the Map Properties Tree/Map Script, create a new XDB and, in its properties window, specify your Lua file (in the top line of the properties). I think you also need to put test.lua in the game's folder.
Yes, you need to call it like this: @DoFile(MYFILE);
Added 9 minutes later
It's simple: use SetAIHeroAttractor(nHero, nTown, 2); at the appropriate moment.
Then, create a handler for when the town is touched, checking who touched it:
P.S. I can still answer simpler questions.
Yes, you need to call it like this: @DoFile(MYFILE);
Added 9 minutes later
It's simple: use SetAIHeroAttractor(nHero, nTown, 2); at the appropriate moment.
Then, create a handler for when the town is touched, checking who touched it:
function example(heroname)
if heroname=="MYAIHERONAME" then
SiegeTown(...)
...
end;
end;In theory, the AI hero will enter the town on its own. But you can use a workaround, like hiring a hero in that town. In general, too many workarounds are not ideal, but Lua's functionality is limited, so we have to improvise. I'll think more thoroughly about your problem and look at it on my computer tomorrow; right now, I can barely remember anything on my smartphone.P.S. I can still answer simpler questions.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________