_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
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?
Instead of isBlocked, use true.
In the second-to-last script function.
1. Simply immobilize the computer's heroes in the Castle using the EnableHeroAI function and prevent them from hiring other heroes using the EnableAIHeroHiring function. Attach a trigger to touching the Castle, and within the function called by this trigger, include EnableHeroAI(nHeroName, true); and then disable the trigger. This workaround is necessary because I am not sure if an inactive computer hero can participate in defending against a Castle siege. Whether or not the computer will use spells depends on Elrath, not scripts. But you can download the mega AI mod.
function NewDayCheck()
...
end;
Trigger(NEW_DAY_TRIGGER, "NewDayCheck");
4. I haven't seen a function that returns the race of a Castle. For now, I don't have any ideas.
7. In the map, go to Map Properties Tree => Players => + => Player ID => The StartBonus string is responsible for the bonus. Set CanChangeBonus to false so that it cannot be changed. Next, set CanBeHumanPlayer to false. Then go to Map Properties => Players Properties => Select the player, in MainHero select the main hero, and set TOWN_TYPE to the desired race. Done.
Save the file.
Either way, the hero fights.
You can read about and download the AI mod here.
Do you need to fill in the function body?
I understand the idea... but then the town and hero will be messed up. Maybe it's possible to block the entire line? (you could accidentally turn off the AI at the start... I've attached a screenshot)
It is possible to convert cities using scripts. That is, I can suggest a workaround where the factions are not initially selected, but are asked at the beginning using a message.
In multiplayer, turning off computers seems to be an indispensable option. I don't understand what "entire line" you want to block?
That's exactly what I meant – it can't be disabled, and you can always turn off computers "with the press of a single key."
If I had to summarize the implementation in just a few words. The map usually starts with random factions, not specific ones. Displaying all of this at the beginning of the game isn't very appealing, at least not right now.
N
Added 2 minutes later
[/U]At the right moment
SetObjectOwner(nTownname, 3);
And then everything as above to immobilize the companion.
Are you talking about SetObjectOwner? Well, assigning ownership of an object (in this case, a Castle) to player 3 is equivalent to capturing it. Did you want the Castle to be automatically captured by player 3 after something happens? Or do you just want the AI to start capturing that Castle? Or initiate a scripted siege of the Castle?