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.
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.
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.
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:
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.
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.
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.
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.
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.
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.