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.
so, maybe pcall will work? pcall (f, arg1, ···) Calls the function f with the given arguments in protected mode. This means that if any error occurs inside the function f, it will not be passed further; instead, pcall intercepts the error and returns a status.
Мои карты: Town Готовится:Чума (40%), Сосиска(42%), Война Грааля
so, maybe pcall will work? pcall (f, arg1, ···) Calls the function f with the given parameters in protected mode. This means that if any error occurs inside the function f, it will not be passed further; instead, pcall intercepts the error and returns a status.
Yes, he wrote it. But this is an extension for the language, not a built-in construct, and it's not for implementation in the game. The game uses version 4.0 of Lua, not 5.1. The developers have removed almost all built-in functions.
No. It creates too many simultaneous threads. Besides, this workaround is needed for every standard function. And even in the simplest situation, you have to write a lot of conditions before the development functions so that they don't crash.
Surely there aren't even any exception handling mechanisms. Do I have to write them myself?
No. It results in many simultaneous threads. Besides, this workaround is needed for every standard function. And even in the simplest situation, you have to write many conditions before the development functions so that they don't crash.
Surely there aren't even any exception handlers. Do I have to write them myself?
Threads start and end... Should all functions work without errors, regardless of what is passed to them as parameters? What should these exception handlers do?
Streams have a beginning and an end... Is it necessary for all functions to work flawlessly, regardless of the parameters passed to them? What should these exception handlers do?
For a test database, there should be infinite streams. Combining them into a single stream leads to script delays and the inability to perform its functions, plus a high probability of the script crashing. Splitting it into many streams leads to delays in the game itself. For now, there is a way to use a mixed system: some parts sequentially, some in parallel, but as the system approaches infinity, the delay will increase. The most optimal solution would be to skip those functions that cause failures. Strangely enough, even a failing function can be beneficial. In a single-player game, this is not so critical, but in a multiplayer game (not hotseat), it's a complete disaster!
There is a possibility of creating a stack-based replacement system, where one function is incompletely processed and replaced by another, in order to save resources. But such a system is poor for testing.
Added 5 minutes later I will have to choose a simple, optimal system in which errors (stack-based) have already been eliminated, but also create a second environment for testing (parallelized). I will test it and see.
Added 8 minutes later The maximum number of active heroes on one map is 127. This is actually the limit of "infinity". But 127 simultaneous infinite streams is a lot!
But there don't seem to be any other ways to bypass the error besides using startThread.
That's bad. :( By the way, I'll rework your Hafad: I'll make it so that his ability also affects heroes, even if they are in the town. You can, of course, do it yourself. You'll just need one function without triggers and forced adjacency.
Bad :( By the way, I'll modify your Hafad: I'll make his ability work on heroes too, even if they are in the town. You can, of course, do it yourself) You'll only need one function without triggers and forced interactions.
Maybe errorHook will work? void errorHook( fCallback )
Allows you to set an error handler. By default, when a script error occurs, the current thread terminates. Thanks to this function, you have the opportunity to adjust this behavior – before stopping, control will be passed to the fCallback function. Found it at Novik's. If this doesn't help, then there are no more options.
Мои карты: Town Готовится:Чума (40%), Сосиска(42%), Война Грааля
Dyrman
Auto-translated
RedHeavenHero
Won't it be too powerful for the heroes? After all, the plague kills a fairly large percentage of the total number.
It will kill fewer ;)
Added after 59 seconds Oligarch
Maybe errorHook would be suitable? void errorHook( fCallback )
Allows you to set an error interceptor. By default, when a script error occurs, the current thread terminates. Thanks to this function, you have the opportunity to adjust this behavior – before stopping, control will be passed to the fCallback function. Found it at Novik's. If this doesn't help, then there are no more options.
In the first mission and in the second, only the number near target mission changes. I think I copied it from the developers' file, with some small changes. However, recently, the hero has stopped transitioning to the next mission. I can't figure out what same is wrong...
Whatever
Heroist
Auto-translated
Okay, so how about the function `
AllowPlayerTavernRace ?
I need it so that in cities under player control, Necromancers, Mages, Orcs, and Elves never appear. It seems like this function should work, but when I try to write a script for it, it throws an error saying "nil" in the third parameter, even though I have no idea why, because the manual says it should be true/nil....
In the first and second missions, only the number near "target mission" changes. I copied it, and it seems to be from the developers' file, with minor changes. However, recently, the hero has stopped transferring to the next mission. I can't understand what's wrong...
As I understand it, this snippet saves the heroes whose names are listed in the pool, preserving their stats as they were at the end of the mission. Maybe you used @Win() and the hero remained at level one, which is why he didn't transfer to the next mission with anything. TargetMission should be equal to the current mission. You can try writing the campaign file name in TargetCampaign.