Connection ErrorBad RequestSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
Guys, I need some help: How can I make it so that when a hero enters a region, the number of all their creatures is reduced by half? Thanks in advance.
The simplest solution is to apply something like this to the region:
for slot = 0, 6 do local creature, count = GetObjectArmySlotCreature(hero, slot) if not (creature == 0 or count == 0) then RemoveHeroCreatures(hero, creature, count/2) end end
Нет войне.
Sverhrazum
Auto-translated
Hello everyone! Can you help me figure out how to increase the number of action points for a hero?
Valkar
Auto-translated
It is known that the "RazeTown" spell can be used to destroy a town. But can it be used in reverse? For example, if there are ruins on the map initially, and upon fulfilling a certain condition, the ruins are replaced with a functioning town.
Лишь тот в советах – солнце, в битвах – лев, кто разумом смирять умеет гнев.
I need the reserved hero to appear at the beginning of the second week of the month, but a quest should also be triggered at the same time. The quest is triggered, but the hero (as I already mentioned) does not appear.
function Blue () SetObjectiveState("blue", OBJECTIVE_ACTIVE); local MONTH=GetDate (2) if day == 0 then DeployReserveHero ("Maeve", 66, 3, 0, 0) sleep (5) MoveCamera (66, 3, 0, 50, 0, 0, 1, 1) end ; end;
Gerter
Auto-translated
Is there a way to enable/disable object highlighting (the one that appears when Alt is held down) through code? I'm sure there's no script for it, but maybe there's a console command?
Is there a way to enable/disable object highlighting (the one that appears when you hold down Alt) using code? I know there's no script for it, but maybe there's a console command?
If such a cheat existed, we would have known about it long ago, and frankly, it's a necessary evil in a game like Heroes, especially in its 3D iteration.
I'm having a different issue, though. I'm trying to implement a quest with two possible solutions: one involves paying gold and waiting a certain number of days, and the other involves finding and destroying a specific creature. The waiting period isn't working correctly; the script just won't execute, no matter how I try to modify it, and there are no errors in the console. Script:
function Centaurquesttrader() if GetCurrentPlayer()==1 and centavr == 1 and trader == 1 then QuestionBox("Maps/SingleMissions/orcs2/centtext5.txt", "Traderyes", "Traderno"); end; end;
function Traderyes() if GetPlayerResource(PLAYER_1, GOLD) >= 10000 then dealtime = GetDate(ABSOLUTE_DAY); SetPlayerResource(PLAYER_1, GOLD, GetPlayerResource(PLAYER_1, GOLD) - 10000 ); sleep(1); trader = 2; RemoveObject("thief"); sleep(1); elseif GetPlayerResource(PLAYER_1, GOLD) < 10000 then MessageBox("Maps/SingleMissions/orcs2/ubivectext6.txt"); end; end;
Trigger(NEW_DAY_TRIGGER, 'TradeDay'); function TradeDay() if ((GetDate(ABSOLUTE_DAY) - dealtime) == 4) then MessageBox("Maps/SingleMissions/orcs2/centtext8.txt"); GiveArtifact("главныйгерой", 17); trader = 3; end; end;
function Traderno() MessageBox("Maps/SingleMissions/orcs2/centtext7.txt"); end;
function Thiefdead() while 1 do sleep(10); if IsObjectExists ("thief") == nil and trader == 0 then MessageBox("Maps/SingleMissions/orcs2/centtext9.txt"); trader = 3; break; elseif IsObjectExists ("thief") == nil and trader == 1 then MessageBox("Maps/SingleMissions/orcs2/centtext9.txt"); trader = 3; break; elseif IsObjectExists ("thief") == nil and trader == 2 then MessageBox("Maps/SingleMissions/orcs2/centtext6.txt"); break; end; end; end;
startThread( Thiefdead );
Jack_of_shadows
Auto-translated
Grigoriy, it's not a very good idea to post a hundred lines of code and ask people to find the error in it. For starters, just add print statements in each function and inside each if statement.
РПГ-сценарий для HoMM5: Путь героя ЧаВо по созданию карт для HoMM5: ЧаВо
Grigoriy, it's not a very good idea to post a hundred lines of code and ask people to find the error in it. For starters, just add print statements in each function and inside each if statement.
I'll keep that in mind for the future, thank you. In the meantime, the script is working as it should; I just needed to place the trigger for the new day after the function, not before it. It's quite interesting.
thenekoor
Auto-translated
Hi, do you remember in the last mission for Arantir, there were cities where you could only upgrade creatures to one level? I have three questions: 1. How do you do that? 2. Can this be done with other factions? 3. Can you only upgrade to the 1st level, and not the 2nd?
Hi, do you remember in the last mission for Arantir, there were cities where you could only upgrade creatures to one level? I have three questions. 1. How do I do that? 2. Can this be done for other factions? 3. Can I only allow the 1st upgrade, and not the 2nd?
In the editor, select the city, and on the left in the properties tree, find CreaturesUpgradesFilter, and expand it. To prevent the 1st upgrade, add lines to ForbiddenBasicUpgradeTiers (right-click - Add) and enter the level of the desired creature in them. Accordingly, to prevent the entire upgrade path, you need to add 7 elements and specify levels from 1 to 7 in them. ForbiddenAlterUpgradeTiers - it's all the same, only for preventing the 2nd upgrade. You can also combine them.
Added 23 hours 32 minutes later Has anyone encountered this, or does anyone have any ideas? The game crashes when using MoveHeroRealTime or even CalcHeroMoveCost on an adjacent, empty cell. It doesn't crash at the beginning of the map, but in the second half, closer to the end.
I can assume that the game struggles with a large number of functions, such as the talkbox. And based on my observations, functions related to calculating moves also put a significant load on the game – if, for example, you run CalcHeroMoveCost in an infinite loop, the game will start to noticeably lag. And while the game might still handle it at the beginning, it may run out of resources closer to the end of the map, which could be the cause of the crashes. But these are just assumptions, I can't say for sure.
Нет войне.
Jack_of_shadows
Auto-translated
So, what are the terms of use? Could adding values to the table cause a memory leak? I wouldn't be afraid of Talkbox. It works like a charm.
РПГ-сценарий для HoMM5: Путь героя ЧаВо по созданию карт для HoMM5: ЧаВо
So, what are the usage conditions? Maybe adding values to the table causes a memory leak?
If we're talking specifically about CalcHeroMoveCost, you can just write it to the console, and the game will crash. It's hard to say about the part of the map that has already been traversed; there are many factors involved. I tried to reproduce the bug twice, going to the point of the crash with the same conditions, and it worked normally both times. Gerter
And based on my observations, the functions related to calculating the turn also put a significant load on the game – if, for example, you run CalcHeroMoveCost in an infinite loop, the game will start to noticeably lag. And if at the beginning the game can still handle it, then closer to the end of the map, it may run out of resources, hence the crashes.
That sounds reasonable; I'll try running MoveHeroRealTime more often at the beginning and in the middle of the map, maybe something will happen.
Added 1 hour 49 minutes ago No, no matter how hard I tried, I couldn't trigger a crash manually.
Is there a way to enable/disable object highlighting (the one that appears when Alt is held down) through code? There's definitely no script for it, but maybe there's a console command?
If it's still relevant: the command ui_adventure_hilight_radius 0 disables the highlighting; to re-enable it, replace 0 with a value greater than 0. It's best to use the value that was originally set.
If it's still relevant: the command ui_adventure_hilight_radius 0 disables the highlight. To re-enable it, replace 0 with a value greater than 0. It's best to use the value that was originally set.
I tried this command, but it doesn't work, unfortunately. I was interested in the possibility of enabling the highlight effect in the game, i.e., simulating pressing the Alt key, but it seems that this is not possible.