Skip to content

Posts from Current questions and answers regarding the map editor. Auto-translated

5.0 (12 ratings)
In reply to }{0TT@6bI4
User Avatar
#5142
Auto-translated
}{0TT@6bI4
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.
In reply to Fallenru
User Avatar
#5143
Auto-translated
Fallenru
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.
Attachments 1
1 file attached • Total size: 375.0 KB
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5144
Auto-translated
}{0TT@6bI4
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!
User Avatar
#5145
Auto-translated
Out of curiosity, how many lines of script have been written so far?
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5146
Auto-translated
}{0TT@6bI4
May I ask, approximately how many lines of scripts have been written so far?
I can't say for sure, but around 70. Although the Script editor shows 138, there are a lot of spaces for convenience + descriptions).
User Avatar
#5147
Auto-translated
Overall, there are very few of them, and for a beginner, it's very, very good! 👍 Will this be your first map with scripts?
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5148
Auto-translated
}{0TT@6bI4
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

then
SetObjectPosition(hero, 41, 86, 1); --40,84можно
print("проверка прошла ",Tile);
else SetObjectPosition(hero, 40, 84, 1);
end;
SetObjectEnabled("Message", nil)
end;
Trigger(4, "Message", "teleport1")
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?
In reply to Fallenru
User Avatar
#5149
Auto-translated
Fallenru
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.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5150
Auto-translated
}{0TT@6bI4

I suggest this code.
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.
Attachments 1
1 file attached • Total size: 7.7 KB
In reply to Fallenru
#5151
Auto-translated
Fallenru
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
In reply to g3cKpunTop
User Avatar
#5152
Auto-translated
g3cKpunTop
As I understand it, this syntax doesn't work in Lua.
Try this:

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 the first one should definitely work.
My apologies, but Fallenru and I have already discussed everything and resolved the issues, and we even tried this method.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#5153
Auto-translated
To those who have added new sounds to maps or know how to do it correctly, please respond. I can't seem to get it working.
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
In reply to MasteR
User Avatar
#5154
Auto-translated
MasteR
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?
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5155
Auto-translated
}{0TT@6bI4
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.





Attachments 3
3 files attached • Total size: 85.8 KB
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
User Avatar
#5156
Auto-translated
The .wav format didn't work either.
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира