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.
I discovered a rather minor, but strange quirk regarding loops iterating over array elements. I usually try to use the standard Lua tool for this, like this: for i, element in table do. So, as an example, I sketched out a code that prints all elements of a table in order: test_table = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; for i, el in test_table do print('i = ', i, ', el = ', el) end. The console outputs the following: i = 13, el = 13 i = 1, el = 1 i = 2, el = 2 i = 3, el = 3 i = 4, el = 4 i = 5, el = 5 i = 6, el = 6 i = 7, el = 7 i = 8, el = 8 i = 9, el = 9 i = 10, el = 10 i = 11, el = 11 i = 12, el = 12. That is, the 13th element comes first, and then all the others in order. And the most interesting thing is that this manifests ONLY when the array size is 13 elements; everything else I tested with a larger or smaller size iterated normally, starting from the 1st element. This is a Lua feature. I encountered this in code where the order of iteration was important.
This is normal behavior. You cannot rely on the order of iteration in such loops.
Translation of the Lua 4.0 manual
The order in which the elements of a table are traversed is undefined, even for numerical indices. If you want to traverse indices in numerical order, use the numerical for.
It may seem strange at first glance, but if you think about it, you can understand that the order is not always unambiguous, because the index can be of any type.
It's understandable that you can't rely on the "order" approach, but as they say, "I've done it this way a thousand times, and it always worked." Now, I've already reworked the critical parts using a different `for` loop.
BlockTownGarrisonForAI - does this prevent an AI hero from recruiting creatures from a town, or does it prevent a hero from hiding in a town?
Is there a way to set an upper limit on development, not for all heroes on the map, but only for some?
People, I need help with the scripts for my mission. I've created a scenario with a huge army. I need it so that when the player approaches the main enemy, a dialogue box pops up saying that they cannot be defeated, and a portal appears in a specific location, with enemies guarding the path to it! Is it possible to do this? Also, I want Biara and Alaric to appear on either side of the final battlefield and start attacking me. Then, I would capture the battlefield and win!
:D I don't know if this is a script or not, but how do I specify the number of creatures? :D
:smile50:
Added after 4 minutes
How do I create a quest where the hero must survive, and how do I make it so that no player needs to capture a Castle within one week?
People, I'm creating a mission, help me with the scripts. I made a location with a huge army in the mission. I need a dialog box to appear when you approach it, saying that they cannot be defeated.
This is not difficult to do. Just create a region and attach a trigger to it. I can send you a manual that describes this in detail.
Added 5 minutes ago Dark messain
and a portal appears in a certain place.
But this is unlikely. Objects of this type cannot be created or moved.
Added 9 minutes ago Dark messain
And also, I want Biara and Alaric to appear on both sides of the last location and start attacking me. And then I take the location and win!!!
This can be done using standard functions. Read the file with them; everything is very clear there.
Added 5 minutes ago Dark messain
:D I don't know if this is a script or not, but how do I specify the number of creatures? :D :smile50:
Added 4 minutes ago How do I make a quest where the hero has to survive, and how do I make it so that none of the players have to capture a Castle within a week?
No, it's not a script. Just select the object with the mouse and press the spacebar.
Everything about quests is also described in detail in the topic "Questions about the editor." If I find the right post, I'll post it here
Friends! To avoid bothering you with my silly questions, could you please share a link to the Nival's Map Editor Manual? Just a recent link, please, as I checked the previous posts, and the links there are no longer available:( Thanks in advance!
Прокрастинирую... "...Завтра станет лучше но солнце так и не взошло..."
Friends! To avoid bothering you with my silly questions, could you please provide a link to the Map Editor Manual by Nival? Just a fresh link, please, as I checked the previous posts, and the links there are no longer available:( Thank you in advance!