Skip to content

Posts from Current questions and answers regarding the map editor. Auto-translated

5.0 (12 ratings)
User Avatar
#5112
Auto-translated
You should only set CanBeHumanPlayer to false; that's all.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#5113
Auto-translated
[/U]
Ment
Instead of isBlocked, use true.
{0TT@6bI4
In the second-to-last script function.
Thank you, I will try it.

Added after 50 minutes
{0TT@6bI4

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.
Regardless, the hero fights (without the above), and also uses spells.
You can read about and download the mega AI mod here (/topic/7746/).

Added after 4 minutes
{0TT@6bI4
function NewDayCheck()
...
end;

Trigger(NEW_DAY_TRIGGER, "NewDayCheck");
Do I need to fill out the body of the function at all? And another question:
Is Trigger(NEW_DAY_TRIGGER) used only once in the script's body? I already have this trigger created, and I simply copied the line SetPlayerResource(1,6,0); into it.

Added after 7 minutes
{0TT@6bI4

4. I haven't seen a function that returns the race of a Castle. For now, I don't have any ideas.
What if we use workarounds?
1) We change the Castle settings in properties town -> the preferred city is specified as the nearest player's city. The Castle has no garrison.
2) Using a script, the Castle is captured by Player 3 and they sit there doing nothing; how can this be implemented?
In reply to }{0TT@6bI4
User Avatar
#5114
Auto-translated
}{0TT@6bI4

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.
I understand the idea... but then the town and hero will be messed up. Maybe it's possible to block the entire string? (It's easy to accidentally turn off a bot at the start... I've attached a screenshot).
Attachments 1
1 file attached • Total size: 63.6 KB
User Avatar
#5115
Auto-translated
It is possible to convert towns using scripts. So, I can suggest a workaround where the factions are not initially selected, but are asked for at the beginning using a message.
 

К А
Стикеры GBF в Telegram
User Avatar
#5116
Auto-translated
Either way, the hero fights.
Great.
You can read about and download the AI mod here.
I don't know, this topic isn't about the mega AI mod. Here's a link to the forum, you'll find it in the list => https://heroes.ag.ru/heroes5/mods/index.html
Do you need to fill in the function body?
No, if there's no need to, i.e., if there's nothing else in the daily function.
That's correct, there can only be one NEW_DAY_TRIGGER in the script, so just copy this line into your existing function.

Added 2 minutes later
At the right moment
SetObjectOwner(nTownname, 3);
And then do everything as described above to immobilize the AI.

Added 2 minutes later
Fallenru
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)
In Multiplayer, turning off the AI seems to be an unkillable option. I don't understand what "entire line" you want to block?
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to Ment
User Avatar
#5117
Auto-translated
Ment
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.
If only in two words, the implementation itself. Simply, the map is usually not launched with specific factions, but with random ones. And displaying all this at the beginning of the game is not very appealing, at least not right now.
User Avatar
#5118
Auto-translated
We ask the player via TalkBox which faction he wants, and depending on the choice, we execute:
TransformTown(nTownname, TOWN_TYPE);
С уважением, }{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
#5119
Auto-translated
}{0TT@6bI4

In multiplayer, turning off computers seems to be an indispensable option. I don't understand what "entire line" you want to block?
Maybe I'm doing something wrong... but in the screenshot I attached, it shows how you can disconnect player 3 with a single key.
User Avatar
#5120
Auto-translated
That's exactly what I meant – you can't disable this feature, and you can always turn off computers with a single key press.
С уважением, }{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
#5121
Auto-translated
}{0TT@6bI4
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."
I understand... I was just surprised that you can't change anything at all when you download a scenario, and that's why I assumed that everything could be locked in multiplayer.
User Avatar
#5122
Auto-translated
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.
Name all the cities using script names (in objectProperties).
Next, use TalkBoxForPlayers. It only allows for 5 options, meaning options 1-4 are cities, and option 5 is a transition to another group of options. When transitioning, also display TalkBoxForPlayers, but for the remaining castles. Depending on the choice, call TransformTown for the cities with the corresponding names.

Select castles either manually or using a random generator separately.

Yes, it doesn't sound great and is a bit more complicated than I'd like...
 

К А
Стикеры GBF в Telegram
User Avatar
#5123
Auto-translated
Well, the scenario is designed in such a way that players don't make any decisions themselves. Therefore, it's impossible to disable anything in it. And multiplayer differs in that the user decides who plays and which factions they choose.
С уважением, }{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
#5124
Auto-translated
}{0TT@6bI4
N

Added 2 minutes later
[/U]At the right moment
SetObjectOwner(nTownname, 3);
And then everything as above to immobilize the companion.
I read the description of this function, but I don't quite understand what it's for, why it's needed, and where it's necessary to write it...><
User Avatar
#5125
Auto-translated
You're 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 automatically be captured by player 3 after something happens? Or did you want the computer to simply start capturing this Castle? Or perhaps initiate a scripted siege of the Castle?

Added 1 minute ago
Ment, we're both answering the same user's question, sometimes I answer first, sometimes you do. This can be a bit confusing for the user. I can leave the conversation, but I hope you can answer all the questions?
С уважением, }{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
#5126
Auto-translated
}{0TT@6bI4
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?
Now I understand what you mean. It's just that if we're going to implement this workaround, how would it look in more detail?
1) Two heroes belonging to player 3 are initially located near the Castles and run towards them. (How would we implement this?)
2) How do we get them into the city so that they are actually inside the city?
And then we can do everything you mentioned earlier.

And another important question is, how can we test scripts directly in the game (currently on a Multiplayer map)?
Right now, I have to launch the script editor, then the game itself, wait for everything to load, close the game, and edit.
I saw a method of creating an additional .lua file in the game folder ("Heroes"/data/test/lua) and initializing it in the game @test.lua (I don't remember exactly how), but I couldn't get it to work. Please advise.