Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
#1917
Auto-translated
Is it possible to display the hero's reputation in the list of quests? If a value with a global variable is added to the quest description or progress, will it be updated as the reputation changes? Is it possible to add complex messages with values to the quest progress description?
 Создается карта про эльфов: Воссоединение - готовность 71%
In reply to Spectral
User Avatar
#1918
Auto-translated
Spectral
Is it possible to display the hero's reputation in the list of quests? If a value with a global variable is added to the quest description or progress, will it be updated as the reputation changes?

Is it possible to add complex messages with values to the quest progress description?
1) You can create multiple texts with quest progress.

2) No.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#1919
Auto-translated
1) You can create multiple texts showing the progress of the quest.

But then you would have to create several thousand texts, because the reputation value changes from approximately 10 to 4000.
 Создается карта про эльфов: Воссоединение - готовность 71%
User Avatar
#1920
Auto-translated
It could be implemented so that it's not displayed in the task list, but appears when the hero's special ability is activated (like summoning Ilm-Hijra). JonnyP implemented it this way on one of his maps.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#1921
Auto-translated
RedHeavenHero
It could be hidden in the task and appear only when the special ability of the hero is activated (like summoning Ilm-Hijdra). JonnyP did this on one of his maps.
How can this be done? Which trigger should be linked to the activation of the special ability, and where is this special ability defined?
 Создается карта про эльфов: Воссоединение - готовность 71%
In reply to Spectral
User Avatar
#1922
Auto-translated

function activate_custom_ability(hero, custom_ability)
-- ...
end

ControlHeroCustomAbility(hero_name, ability_number(1..4), 1)
Trigger(CUSTOM_ABILITY_TRIGGER, "activate_custom_ability")
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#1923
Auto-translated
How can I completely prevent a player from hiring heroes in taverns?
 Создается карта про эльфов: Воссоединение - готовность 71%
User Avatar
#1924
Auto-translated
AllowHeroHiringByRaceInTown(town_name, race_forbidden_for_hiring, 0(forbidden) or 1(allowed))
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#1925
Auto-translated
RedHeavenHero
AllowHeroHiringByRaceInTown(town_name, race_forbidden_for_hiring_heroes, 0(forbidden)_or_1(allowed))
What about taverns on the map?
 Создается карта про эльфов: Воссоединение - готовность 71%
User Avatar
#1926
Auto-translated
AllowPlayerTavernRace(player, race, permission_0_or_1)

Added 2 hours and 7 minutes ago
Also, in the map properties, each player has a Tavern Filter.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#1927
Auto-translated
Hello. I can't even figure out the simplest script. Please tell me how to make it so that when a garrison is captured, the NEW_DAY_TRIGGER is activated, which adds a specified number of troops to the captured garrison each day?
User Avatar
#1928
Auto-translated
Add a check to your function for the new day to verify that the garrison belongs to that player.
if GetObjectOwner("garrison_name") == player_who_captured_the_garrison then
AddObjectCreatures("garrison_name", type, quantity)
end
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#1929
Auto-translated
RedHeavenHero
Add a check to your function for the start of a new day to verify that the garrison belongs to that player.
if GetObjectOwner("garrison_name") == player_who_captured_the_garrison then
AddObjectCreatures("garrison_name", type, quantity)
end


Thank you very much.

And here is another question. Could you tell me how to specify the damage animation for a creature in the PlayObjectAnimation script? I mean the damage animation that plays when it is hit... But for some reason, the manuals don't list the names of these animations... Thank you in advance.
PlayObjectAnimation("red_warrior", "",
ONESHOT);
User Avatar
#1931
Auto-translated
Here's another question. Could you tell me how to specify the damage animation for a creature in the PlayObjectAnimation script? I mean, the animation that plays when it's hit... Because for some reason, the manuals don't list the names of these animations... Thanks in advance.
You can view the names of all animations in the property tree:
Select the monster, and in the property tree, look for the Shared line. Click on the three dots.
Then, in the window that opens on the right, look for the AnimSet line and click on the three dots again.
Now, a window will appear with a list of animations, where you can see their names.
Attachments 3
3 files attached • Total size: 495.9 KB
 Создается карта про эльфов: Воссоединение - готовность 71%

Statistics

Welcome our newest member: Emil