Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to OrnsteinDragonslayer
User Avatar
6 years ago
Auto-translated
OrnsteinDragonslayer
Technically, it is possible to make a small creature appear large. However, the model will remain the same; it will simply occupy a 2x2 grid. But this is not done directly in the editor; it requires modifying the game's internal files.
Thank you:)

Added 1 minute ago
Here's another question: how can I prevent the AI from buying an army in a castle and recruiting creatures from dwellings? So that it simply stays in the castle?
In reply to John_Lock
User Avatar
6 years ago
Auto-translated
User01322342
You're welcome :)

Added 1 minute ago
Here's another question: how can I prevent the AI from buying an army in a Castle and recruiting creatures from dwellings? So that it just stays in the Castle?
Well, you can simply disable the AI for a hero using this command:
EnableHeroAI("heroname", nil)
, where heroname is the script name of the hero.
In reply to OrnsteinDragonslayer
User Avatar
6 years ago
Auto-translated
OrnsteinDragonslayer
Well, you can simply disable the AI for a hero by using the following command:
EnableHeroAI("heroname", nil)
, where heroname is the script name of the hero.

I tried adding a hero to a town and disabling him using EnableHeroAI("heroname", nil), but the computer continues to buy an army in the town and purchase units from dwellings.
In reply to John_Lock
User Avatar
6 years ago
Auto-translated
User01322342
I tried adding a hero to a town and then disabling him using EnableHeroAI("heroname", nil), but the computer continues to buy an army in the town and purchase units from dwellings.
Are you sure you entered the hero's name correctly?
In reply to OrnsteinDragonslayer
User Avatar
6 years ago
Auto-translated
OrnsteinDragonslayer
Did you enter the hero's name correctly?
Yes, I checked it several times. I partially managed to achieve what I wanted. Using the SetRegionBlocked command, the computer can no longer buy creatures from dwellings, but it continues to manage the city, specifically: buying creatures, building structures, etc. I've seen this done in many maps, but I can't remember which ones.
In reply to John_Lock
User Avatar
6 years ago
Auto-translated
User01322342
Yes, I checked it several times. I partially managed to achieve what I wanted. Using the SetRegionBlocked command, the computer can no longer buy creatures from dwellings, but it continues to manage the town, specifically: buying creatures, building structures, etc. I've seen this done in many maps, but I can't remember which ones.
Well, you can restrict the town itself so that it doesn't have buildings that generate creatures. This can be done directly in the editor.
In reply to OrnsteinDragonslayer
User Avatar
6 years ago
Auto-translated
OrnsteinDragonslayer
Well, you can limit the city itself so that it doesn't have buildings that provide creature generation. This is done directly in the editor.
Everything is done correctly now. Thanks for the help!
User Avatar
6 years ago
Auto-translated
Could you please tell me how to insert a counter into the quest window?
In reply to Grigoriy
User Avatar
6 years ago
Auto-translated
Grigoriy
Could you please tell me how to insert a counter into the quest window?
As I understand, the counter represents the stages of completing a quest, right? Let's say, killing monsters. In that case, you'll need ProgressCommentsFileRef. ProgressCommentsFileRef is used if the quest consists of several stages (for example, killing 3 groups of monsters).
This screenshot shows where the quest stages are defined (they can be displayed as a counter)

The command that can be used to update the quest stages is SetObjectiveProgress(‘SCRIPT_NAME_OF_THE_QUEST’, progress);
progress is the sequential number in ProgressCommentsFileRef.

I took part of the answer from Jack_of_shadows' message and added some of my own. I hope I understood the question correctly.
Attachments 1
1 file attached • Total size: 11.6 KB
In reply to John_Lock
User Avatar
6 years ago
Auto-translated
User01322342
As I understand it, the counter represents the stages of completing tasks, right? For example, killing monsters, in which case ProgressCommentsFileRef would be needed. ProgressCommentsFileRef – if the task consists of several stages
(for example, kill 3 groups of monsters).
This screenshot shows where the stages of the task are set (it can be done in the form of a counter)

The command that can be used to update the stages of the task is SetObjectiveProgress(‘SCRIPT_NAME_OF_THE_TASK’, progress);
progress is the sequential number in ProgressCommentsFileRef.

I took part of the answer from Jack_of_shadows' message, and added the rest myself).
I hope I understood the question correctly.

Not stages, but a counter. Like "0 out of 9 dragons found".
User Avatar
6 years ago
Auto-translated
the counters are implemented through stages and are updated accordingly. only in this case will the stages be displayed as follows:
"0 out of 9 dragons found", "1 out of 9 dragons found" ... "9 out of 9 dragons found".
In reply to Gerter
User Avatar
6 years ago
Auto-translated
Gerter
The counters are implemented through stages and tasks. Only in this case will the stages be like:
"0 out of 9 dragons found", "1 out of 9 dragons found" ... "9 out of 9 dragons found"
To be honest, I don't quite understand how it will be displayed correctly if one dragon, for example, triggers the stage "1 out of 9 found," while another might immediately trigger the stage "9 out of 9 found," but I'll take a look, thank you.
User Avatar
6 years ago
Auto-translated
You create a variable that tracks the number of dragons found. You set the stages relative to it. That is, when 1 dragon is found, the stage "1 out of 9 found" is displayed; when 2 dragons are found, "2 out of 9" is displayed, and so on.
In reply to Gerter
User Avatar
6 years ago
Auto-translated
Gerter
You create a variable that tracks the number of dragons found. You set the stages relative to it. That is, when 1 dragon is found, the stage "1 out of 9 found" is displayed; when 2 dragons are found, "2 out of 9" is displayed, and so on.
Hmm, you're right... I'm starting to get confused with this map... Thanks.
In reply to Gerter
User Avatar
6 years ago
Auto-translated
Gerter
You create a variable that tracks the number of dragons found. You set the stages relative to it. That is, 1 dragon found - the stage "1 out of 9 found" is set, 2 dragons found - "2 out of 9", and so on.
Thank you for the idea! Could you please show how this would look in code?

Statistics

Welcome our newest member: recijeb