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
Posts from Current questions and answers regarding the map editor.Auto-translated
1. n1 is the player number of the former owner, n2 is the player number of the new owner, s1 is the name of the hero who captured the object, and s2 is the name of the object. 2. 2 is indeed the player number. 3. Attach a touch trigger to the marker, set the object's inactive state, and after the object is touched, display ShowFlyingSign, where you can configure the message's flight time. 4. It is absolutely impossible for two players to enter simultaneously, so you can add a game lock to the teleport, the teleport itself, and move the player up one cell (y+1), then unlock the game. Also, add a check to see if the coordinates of the first object that moved (we find out the name in the trigger attached to the pseudo-teleport) are equal to the coordinates of the second object, but with y being 1 less, and depending on this, either move the hero up one cell or don't move it. But this is a workaround; your solution is correct; I was just offering an alternative. 5. These undocumented functions are simply not included in the developers' manuals. There are many such functions; if needed, you can ask those who know them. 6. There is a function called SetHeroesExpCoeff... 7. Maintaining order is a good thing. I recommend simply separating the different parts of the script with a lot of hyphens and a description of what each part does.
1. Where do these values come from? Why are there only 4 of them? 3. Oh man... I have about 20 of these markers with messages... I don't want to configure all of them... is there a way to quickly redo everything or combine them into an array? 5. That's a shame. 6. Could you provide more details, as there seems to be no information available based on a search on Yandex on this topic. Hmm... 7. This is already done! I just wanted it to be separate.
1. Where do these values come from? Why are there only 4 of them? 3. Oh man... I have about 20 of these message pointers... I don't want to configure all of them... is there a way to quickly redo everything or combine them into an array? 5. That's a shame. 6. Could you provide more details, as there seems to be no information on this topic based on a search on Yandex. 7. This has already been done! I just wanted it separately.
1. Each trigger has a specific set of values that the function it calls will return. The variables whose values you want to return with the function are written in parentheses immediately after the function name. They are arranged in a strict order, and there is a fixed number of them. You can enter no variables, or just one, but attempting to return 5 values from an "on capture" trigger will not yield good results. You can see which values the functions return after being called by a specific trigger in the script manual, which I have attached here, on pages 57-59. IMPORTANT! Do not confuse this with the values that need to be set by the trigger, which are described first in the manual, and only then are the returned values. 3. At the beginning of the script, set all the pointers to a non-working state by attaching a trigger to them (you can do this in a single conditional loop). However, each of these triggers will call one function - the message function. It will return 2 parameters, the 2nd being the name of the object. Run a bunch of checks on the names in the function, and depending on the name of the pointer, display the appropriate message. It's a bit of a workaround to check everything manually instead of in a loop. However, there is a variable in the properties that controls the duration of the messages. And why have kilometers of text on the pointers?.. 6. SetHeroesExpCoeff(COEFFICIENT); The default coefficient is 1, and the minimum possible is 0.01. Feel free to set it.
And why have kilometers of text on the signposts?.. 6. SetHeroesExpCoeff(COEFFICIENT); The default coefficient is 1, the minimum possible is 0.01. Feel free to adjust it.
I will check everything else as usual now. When I was creating the map, I had no idea that the text on the signposts disappears so quickly... There is text on a couple of signposts that needs to be displayed slowly. I won't redo everything. I understand why I couldn't find it - SetHeroesExpCoeff(One extra 'f'). And also, I wouldn't have written so many commands in my map script if I hadn't been using HOMM5_A2_Script_Functions. It's just that I'm not thinking clearly late at night. But still, thank you!
Overall, it's quite a few, and it's very good for a start! This will be your first map with scripts?
Firstly, I think it's the best way to fully understand and use them. :smile15: Secondly, the map is not yet finished. Thirdly, I think you can use much more scripts in non-Multiplayer maps (except for Arenas). And it doesn't make much sense to stuff a Multiplayer map with a ton of scripts. Fourthly, you can say that this is generally the first map:D, because until recently I didn't create maps and didn't even think about maps. Fifthly, thank you for your help!:smile14: And the saddest thing is that testing scripts in a Multiplayer map takes a lot of time and is frustrating. Because you have to restart everything 100 times. (
Added after 8 minutes For the future, I wanted to ask. What is the difference when creating a scenario and a Multiplayer map? (I read something about it briefly... but I don't remember anymore.)
Added after 14 minutes Oh... time wasted, and the result didn't bring the desired effect...
function teleport1(hero) Tile = IsTilePassable(41, 86, 1); MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()),"/Maps/RMG/515474A1-8A71-43BF-80ED-90E00B05311A/message.26.txt"); sleep(5); if Tile == 1
IsTilePassable(41, 86, 1); - returns 1 a) even if the hero is initially on that tile b) even if the hero is teleported to that tile.
Added after 3 minutes
Returns 1 if the tile at (X, Y) on the surface (Floor_ID = 0) or underground (Floor_ID = 1) is passable, or "zero" if it is blocked. It takes the mask into account, but ignores temporary blockades (e.g., a stack of monsters, a player hero, etc.).
><
Added after 1 minute I'll have to write another workaround... why couldn't they make IsTilePassable more functional?
Firstly, for a complete understanding and use of them, I think this is the best way:smile15: Secondly, the map is not yet finished) Thirdly, I think that in non-Multiplayer maps, you can use much more scripts (except for arenas). And it doesn't quite make sense to stuff a Multiplayer map with a ton of scripts. Fourthly, you can say that this is generally the first map:D, because until recently, I didn't create maps and didn't even think about maps. Fifthly, thank you for your help!:smile14: And the saddest thing is that testing scripts in a Multiplayer map takes a lot of time and is annoying. Because you have to restart everything 100 times(
Added 8 minutes ago For the future, I wanted to ask. What is the difference when creating a scenario and a Multiplayer map? (I read something about it briefly... but I don't remember anymore)
Added 14 minutes ago Ugh... time wasted, and the result didn't bring the desired effect...
IsTilePassable(41, 86, 1); - returns 1 a) even if the hero is initially on that tile b) even if the hero is teleported to that tile.
Added 3 minutes ago
Added 1 minute ago I'll have to write a workaround again... why couldn't IsTilePassable be made more functional?
In Multiplayer, you can configure any number of computers, and you can block players.
IsTilePassable checks the passability of a tile as a whole. And it considers a tile impassable only if it contains a blocked tile. And a hero does not contain a blocked tile under him; he has an active tile. Logically, the game considers the tile passable. I suggest the following code.
firstvis=0; function teleport(heroname, teleport) if firstvis==0 then xt,yt,zt=46, 84, 1; SetObjectPosition(heroname, 46, 84, 1); MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()), GetMapDataPath().."successfulteleport.txt"); x,y,z=GetObjectPosition(heroname) firstvis=firstvis+1; elseif firstvis>=1 and xt,yt,zt == x,y,z then SetObjectPosition(heroname, x+1, y+1, 1); MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()),GetMapDataPath().."successfulteleport.txt"); firstvis=firstvis+1; x,y,z=GetObjectPosition(heroname); xt,yt,zt=xt+1,yt+1,zt; elseif firstvis>=1 and xt,yt,zt <> x,y,z then SetObjectPosition(heroname, 46, 84, 1); MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()),GetMapDataPath().."successfulteleport.txt"); firstvis=firstvis+1; x,y,z=GetObjectPosition(heroname); xt,yt,zt=46,84,1; firstvis=0; end; end;
Trigger(4, "Message", "teleport");
I'll explain the principle of operation: Check if this is the first time. If so, then 3 variables - the coordinates of the final teleportation cell, move the current hero there, display a message, the other 3 variables are set to the coordinates of the hero, set a variable indicating that the first time has passed. If it's the second or later time, then check if the coordinates of the final teleportation cell and the previous teleported hero match; if so, then teleport the second hero to the cell to the right and up from the previous hero, display a message, set the number of attempts to 2, 3 variables - the previous coordinates of the final cell - increase by 1, except for the floor (zt), 3 variables - the coordinates of the previous hero - set to the coordinates of the current hero. As a result, if there are a hundred players, teleporting, standing in place, each of them will simply be teleported to the right and up. If the coordinates of the final teleportation cell and the previous teleported hero do not match, then teleport to the initial cell, and set that the next attempt will again be the first, allowing our function to work again.
I knew I should check the code... even though I didn't see any errors at first glance. 1) firstvis=0; how does this variable behave outside the function? (Does it need to be initialized with anything? Global or something else?) 2) Did we write xt, yt, zt == x, y, z correctly? Without declaring the data type. 3) The script editor gives an error in the line below. elseif firstvis>=1 and xt,yt,zt == x,y,z then *I'm not familiar with the Lua language, but I tried the following: *Specifying the data type... number or something else... the error didn't disappear. *Deleting the condition (firstvis>=1 and xt,yt,zt == x,y,z) then it stopped complaining. *Putting the entire condition in parentheses also didn't help.
I knew I should check the code... even though I didn't see any errors at first glance. 1) firstvis=0; how does this variable behave outside of functions? (Does it definitely not need to be assigned anything? Is it global or something else?) 2) Did we write xt, yt, zt == x, y, z correctly? Without declaring the data type. 3) The script editor gives an error in the line below. elseif firstvis>=1 and xt,yt,zt == x,y,z then *I'm not familiar with the Lua language, but I tried the following: *Specifying the data type... number or something else... the error didn't disappear. *Deleting the condition (firstvis>=1 and xt,yt,zt == x,y,z) then it stopped complaining. *Putting the entire condition in parentheses also didn't help.
As I understand it, this syntax doesn't work in Lua. Try:
elseif firstvis>=1 and xt == x and yt == y and zt == z then
as a last resort:
elseif firstvis>=1 and {xt,yt,zt} =={x,y,z} then
but, in theory, the first one should definitely work
To those who have added new sounds to a map or know how to do it correctly, please respond. I can't seem to get it to work.
I added it. Quite recently. A sound for a secret area in a new scenario (which I'm working on); the sound plays, although it's a bit quiet. The sound was taken from the game Quake and consists of a metallic-voiced phrase: "You found a secret area." The format is .wav. I think I can help. What's not working for you?
I added it. Very recently. Sound for the secret zone in the new scenario (which I am currently working on); the sound plays, though a bit quietly. The sound is taken from the game Quake and consists of the phrase "You found a secret area" spoken in a metallic voice. Format .wav. I think I can help. What isn't working for you?
When attempting to play the sound, the console shows an error: Can't load the sound... I don't understand what I did wrong.