Connection ErrorBad RequestThis page went staleSession 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.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
Error Details:
Share Link
Current questions and answers regarding the map editor.
The parser probably crashed on this line.
Second, if the script crashes, it's good practice to check the console and provide the error message here (it can often help you understand the problem yourself).
Third, if you're aiming for a moderately complex scripted map (>200 lines of code), I recommend a different approach to code structure. Currently, all your initialization functions are located at the top level in a disorganized manner. As a result, even a small error in the code can cause the interpreter to crash, the scripts to stop working completely, and, most importantly, it becomes unclear where to look for the problem.
I recommend placing everything that is executed directly when the map starts into a separate function, supplementing it with periodic `print` statements:
This code is placed at the very end of the script, and when the map starts, we first look at the console.
If there is a syntax error in the code that the Lua interpreter cannot handle, the console will be empty; the `InitMap()` function will simply not be reached.
If everything is fine, the console will end with the line 'init finish'.
If we try to initialize something incorrectly, for example, we make a mistake with the region name "rew", the console will show:
init start init heroes OK some error in red font
and based on this log, it will be immediately clear in which lines to look for the error.