Skip to content

Current questions and answers regarding the map editor.

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"
_________________