Skip to content

Current questions and answers regarding the map editor.

User Avatar
#5973
Auto-translated
Magnificent
I haven't heard of any specific limitations. I don't know what checks are required in your case, but I would try replacing several threads with separate checks with sequential checks in one thread, if possible, as this would be more reliable. I only used startThread once (I needed a function call each time the hero gains experience), and it worked well; I used sleep(5). Freezing is possible due to an infinite loop (somewhere in the --some code)?
There is no infinite loop; the condition is very specific, and I debugged it. One example of where I used startThread is to check if the enemy player has no towns and heroes (except for reserve ones). With this approach, the code will be cleaner and simpler, in my opinion.

If this check is done with triggers, it will turn out that one function will have to be written in several places - in the function triggered by the loss of a hero, and in the functions triggered by the capture of towns (and each group of towns has its own separate handler function). This makes code maintenance more complex.

Plus, checking for one-time events - for the new day trigger function, I planned to write regular events so as not to overload it.

Сценарии:
"Холм мертвецов"
"Священное древо"