Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to RobinMobin
User Avatar
Auto-translated
RobinMobin
This means the player doesn't have the required script name that you wrote in the script.

Yes, the script name and regions are correct; I checked the manual, and everything seems to be right, but the scripts still don't work on these idiots.
Делаю кампанию "Последний Феникс"
User Avatar
Auto-translated
Then I don't know, download the HOMM5 Scripts Editor program; it shows the line number where the error is and what the error is.
Кампании
К оружию!
______________________________
Нужна помощь:
Делать ролики
Писать скрипты
In reply to RobinMobin
User Avatar
Auto-translated
RobinMobin
Then I don't know, download the HOMM5 Scripts Editor program; it shows in which line the errors are and what they are.

I've had the program downloaded for a long time; I use it to write scripts, but it shows that everything is fine, and meanwhile, the editor complains about
function new_day(), saying that it is not defined.
Делаю кампанию "Последний Феникс"
User Avatar
Auto-translated
Hmm... then I don't know.
I'll think about what the problem is.
Кампании
К оружию!
______________________________
Нужна помощь:
Делать ролики
Писать скрипты
In reply to RobinMobin
User Avatar
Auto-translated
RobinMobin
I need the script to reset after the hero completes the task.
The script is as follows: SetRegionBlocked("Region", true, 1);
Read the documentation for this function and the meaning of each of the three parameters, and the question will answer itself.

Added 3 minutes later
Aleha
function new_day()
local day = GetDate(day)
if day == 1 then
DeployReserveHero("Necromancer", 29, 60, 1)
end
end

Trigger(NEW_DAY_TRIGGER, 'new_day')
The NEW_DAY_TRIGGER trigger does not work on day 1, only from the second day. Everything you want to execute at the start of the map can simply be written in the code without any functions:
DeployReserveHero("Necromancer", 29, 60, 1)
User Avatar
Auto-translated
Hi everyone:) Can you suggest a script? I need to be able to recruit Death Knights in the refugee camp. And is it possible to do this?
Кто шарит в скриптах отпишите плиз:)
In reply to Grimrock
User Avatar
Auto-translated
Here, it seems to be written correctly:

function hire1(hero)
hire1_hero = hero
MessageBox("path to the message text in Unicode format");
QuestionBox("path to the question text", "hire1_ok");
end

function hire1_ok()
local gold = GetPlayerResource(PLAYER_1, GOLD)
if gold >= hiring_cost then
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "region_name", nil);
SetPlayerResource(PLAYER_1, GOLD, gold - hiring_cost);
AddHeroCreatures(hire1_hero, creature_type, quantity);
else
-- you can add a message about insufficient funds here
end
end;


Added 2 minutes ago
And yes, for "creature_type", you need to find the creature ID.
Делаю кампанию "Последний Феникс"
User Avatar
Auto-translated
Thank you.

Added 1 minute ago
And one more question: how do I prevent creatures from increasing in number each week? Or is this not done through scripts?
Кто шарит в скриптах отпишите плиз:)
In reply to Jack_of_shadows
User Avatar
Auto-translated
1
Кампании
К оружию!
______________________________
Нужна помощь:
Делать ролики
Писать скрипты
In reply to Jack_of_shadows
User Avatar
Auto-translated
Jack_of_shadows
Everything you want to execute at the start of a map can simply be written in the code without any functions:
DeployReserveHero("Necromancer", 29, 60, 1)

It says - hero Effig is not in reserve player 6.
Делаю кампанию "Последний Феникс"
User Avatar
Auto-translated
hero Effig is not in reserve player 6
In order for the "bring from reserve" function to work, the corresponding hero must first be placed in the reserve. This is done in the editor in the properties menu, it seems on the players tab.
In reply to Grimrock
User Avatar
Auto-translated
Grimrock
Thank you.

Added 1 minute ago
And another question, how do I prevent creatures from increasing in number over the weeks? Or is this not done with scripts?
In the creature's properties tree, there is a parameter called DoesNotGrow, which, when set to true, will prevent the number of creatures from increasing over time.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to Jack_of_shadows
User Avatar
Auto-translated
Jack_of_shadows
For the "retrieve from reserve" function to work, you need to first place the corresponding hero in the reserve. This is done in the editor in the properties menu, I think on the players tab.

I found this, but my map isn't in the AdvMapHero menu.

Added 3 minutes later
More precisely, I clicked on ReserveHeroes and a menu appeared with the AdvMapHero tab (there are DialogScenes, Maps, Test there), and my map doesn't appear in Maps/SingleMission.
Делаю кампанию "Последний Феникс"
User Avatar
Auto-translated
I clicked on ReserveHeroes and a menu appeared with an AdvMapHero tab.
If you need a standard hero, there's a more convenient dialog in "Map Properties" (not in "Map Properties Tree," where you're looking). If the hero is completely custom, then I don't know how to do it.
In reply to Jack_of_shadows
User Avatar
Auto-translated
Jack_of_shadows
If you need a standard hero, there's a more convenient dialog in "Map Properties" (not in "Map Properties Tree," where you're looking). If the hero is completely custom, then I don't know how to do it.

As far as I understand, it's in Player Properties, but there's one problem... when I select the desired player, the editor crashes.
Делаю кампанию "Последний Феникс"

Statistics

Welcome our newest member: Emil