Skip to content

Posts from A number of questions regarding map creation.

No ratings yet — be the first to rate!
Auto-translated
Hello. I could have asked questions in existing threads, but there are quite a few of them, and new ones will appear from time to time for one reason or another, because I'm creating a map, at least for the 5th installment, for the first time. And while I don't have any particular problems with creating the terrain, etc., or with turning a hero from a cutscene into a fully-fledged hero, I do have problems with the scripting part. So...

I wrote a script for a monster so that it displays text upon the first encounter, but here's the problem. When I attack it again after that, it displays the same text after the battle, which, as you can imagine, is not quite what I want. Plus, when the turn passes to another player, they also see the text from the monster, but they haven't even interacted with it. And as far as I understand, this situation will probably happen with any text. Is it possible to make it so that the text is displayed only to the hero who activated the script, only to the player who activated it? And how realistic is the idea of a story-driven multiplayer map in general?

Here's the script I wrote...
function tekstmob1(heroname)
MessageBox(GetMapDataPath().."lesorubnecro.txt");
SetObjectEnabled('Lesorub',true);
sleep(5);
MakeHeroInreractWithObject(heroname,'Lesorub');
Trigger(OBJECT_TOUCH_TRIGGER,'Lesorub',nil);end;
SetObjectEnabled('Lesorub',nil);
Trigger(OBJECT_TOUCH_TRIGGER,'Lesorub','tekstmob1');

The map size is Incredible or something like that. I'm planning for four players, and if it's feasible, each player will have their own storyline. The game will be three against one.
And also, what's the best way to organize quests, through scripts or a lot of secondary quests, where the next one is given upon completion of the previous one? And if it's not too much trouble, could you give an example of how to create a quest using scripts? I just haven't worked with them before; in the third game, events were enough.
User Avatar
Auto-translated
And how realistic is the idea of a story-driven multiplayer map in general?
It's quite realistic; they just don't make them very often, but you can still find them sometimes.
TalkBoxForPlayers
This function exists in patch 3.1; it has many features, not just displaying a message to a specific player. If the message is small, I think ShowFlyingSign(messageName, objectName, targetPlayerID = -1, time = 1.0) is the ideal option because it doesn't require any action from the player and is very convenient from a gameplay perspective.
I'm planning for four players, and if it's feasible, each player will have their own storyline. The game will be three against one.
I don't think that's a very good idea. For multiplayer, it's better if the players are more or less equal. In Heroes 3, since you mentioned playing it, there's "The Perfect New World," a good example of a multiplayer map where different players have different strategies and quests (although the quests are limited to prophet's huts, but still). And three against one will always be unbalanced, even if the fourth player is clearly stronger than the other three.
 

К А
Стикеры GBF в Telegram
Auto-translated
It's quite possible, it's just that they rarely make such things, but sometimes you can still find them.
I could have tried it on a smaller scale, but I decided that if I'm going to do it, it should be something epic. Of course, it's probably not ideal for a full-fledged multiplayer game due to its size, but there will probably be some fans. As it is, the idea is to have several storylines that can be played through in single-player mode. That is, if there is a choice of who to play as, then on one map it would be possible to create several stories in the context of a general one.
TalkBoxForPlayers
This function exists in patch 3.1, and it has many functions, not just displaying a message to a specific player. If the message is small, then I think ShowFlyingSign(messageName, objectName, targetPlayerID = -1, time = 1.0); is the ideal option, because it does not require the player to take any action and is very convenient from a gameplay point of view.

It's an interesting thing, but according to the description, it requires many files. Is it necessary to specify all the links, or can you simply put empty quotes in the item with the icon? And did I understand correctly that you always need to create a file with answers, or can you somehow make it so that there is just text and no options, just "OK"? I apologize if the question is stupid, but this is my first experience working with scripts.
I don't think it's a very good idea. For multiplayer, it's better for players to be more or less equal. In Heroes 3, which you said you played, there is "The New World," a good example of a multiplayer map where different players have different strategies and quests (although the quests there are limited to the prophet's huts, but still). And three against one will still be unbalanced, even if the fourth player is clearly stronger than the other three.

Hmm, maybe you're right. On the other hand, I already have a plot in my head. In short, once upon a time, they defeated the Necromancer, but he didn't die, but fell into a state of suspended animation, and now he has awakened. Slight amnesia does not prevent him from gaining power, which can even be realistically shown in the game, for example, if, as soon as the game starts, the lighting on the map is daytime, and after a while it changes to a Necropolis-like one. You can balance the players with strong monsters that will slow down one side and speed up the other. But, perhaps, there will also be a game with 1 against 1 or 2, or even 2 against 2. I am making the map primarily for myself and my wife.

Regarding the whirlpool. Can it be used as a teleport, entering on the surface and exiting underground?

Added after 4 hours 32 minutes
TalkBoxForPlayers

There is a problem with the function. There is no main text to the right of the icon. As I understand it, I need to add a configuration file in the Russian patch so that the function works correctly. But which pack should I put it in?

a2p1-data.pak
a2p1-texts.pak
data.pak
sound.pak
sound.pak
texts.pak
User Avatar
Auto-translated
Is it necessary to specify all links, or can you simply use empty quotes in the item with the icon?
I haven't checked, but it probably accepts the value nil. Empty quotes are undesirable.
And did I understand correctly that a file with answers must be created in any case, or can it be done so that there is just text and simply "OK" without options?
Yes, it is most likely possible without them.
Regarding whirlpools. Can it be used as a teleport, entering on the surface and exiting underground?
If there is no specific feature, then yes, it is possible; it's not the most complex script. A trigger on a zone (single-cell, above the whirlpool) or perhaps even on touch, and then the SetObjectPosition function.
There is a problem with the function. There is no main text to the right of the icon. As I understand it, I need to add a configuration file to the Russian patch so that the function works correctly. But in which pack should I do this?
In reality, in any pack, BUT! This will only work for you. You need it to work for everyone. Therefore, it is more reasonable to embed the file in the archive with the map itself, along the path that is given there.
 

К А
Стикеры GBF в Telegram
Auto-translated
I haven't checked, but it probably accepts the value 'nil'. Empty quotes are undesirable.

It does accept it, but I understand that it's better to put some value there; otherwise, there's just a white square, which doesn't look good.
Yes, you can probably do without them.
I tried it without, but it didn't work. As a result, the script simply doesn't run. So, some kind of response is definitely needed.
If there isn't any specific requirement, then yes, you can; it's not a very complex script. A trigger on a zone (a single-cell zone, on top of the whirlpool) or maybe even on touch, and then the function SetObjectPosition.
You can probably do it with a script, but what if there's just one whirlpool at the top and one at the bottom? Or do the whirlpools only work within their own level? In theory, they are like portals themselves, but only on water and with a chance of losing troops. Plus, there's an element of randomness as to where it will move you if there are more than two whirlpools.
In reality, it can be anywhere, BUT! This will only work for you. You need it to work for everyone. Therefore, it's better to embed the file in the archive with the map itself, following the path given there.
I tried putting it in the files, but it didn't help. But packaging it into the map works perfectly; thank you very much. It's a pity I didn't see a system for giving positive feedback, otherwise I would have given you one in gratitude.

Summary regarding the function. You might already know this, but it might be useful for others who see it.
1. It's better to put an icon; otherwise, there's just a white square instead.
2. There isn't much space for text to the right of the icon, no matter what you do. Unless you do something like, indicate there that you should right-click on the icon and read the text that way. There's a lot of space in the icon description, and everything will definitely be visible there.
3. There's an additional text field, as I understand it; it's for the responses. I haven't checked how much space there is, but it's definitely not much.
4. The ability to have up to 5 answer options is good, especially if you can specify a different result for each answer.

That's the situation. As for my script, it works, but... How can I make it so that when I touch the same monster again, when I'm already attacking it, it doesn't display the same text with the answer options after the battle? The problem isn't just with this; even when it was just a message box, it would still display the text after the battle, which isn't good because it's no longer relevant after the battle. Here's my script...

function tekstmob1(heroname)
s = GetMapDataPath()..'lesorubnecro.txt';
bb = GetMapDataPath().."ezdadalee.txt";
TalkBoxForPlayers (PLAYER_1,nil,s, s, nil, TALK, 0, nil, nil, 0, bb)
SetObjectEnabled('Lesorub',true);
sleep(5);
MakeHeroInreractWithObject(heroname,'Lesorub');
Trigger(OBJECT_TOUCH_TRIGGER,'Lesorub',nil);
end;
SetObjectEnabled('Lesorub',nil);
Trigger(OBJECT_TOUCH_TRIGGER,"Lesorub","tekstmob1");
Auto-translated
There's this thing...
http://forum.heroesworld.ru/showpost...39&postcount=2
It's good, but only I will be able to see it displayed like that. I've embedded the file so that it displays correctly. But still, thank you.

Another problem has arisen here. I'm creating a script according to the instructions in the manual, but it doesn't work. That is, when I interact with the object, the text doesn't appear, even though the code is like this...

function hatF()
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub" nil );
MessageBox (GetMapDataPath().."lesorubnecro.txt");
end;
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub" "hatF" );

I tried applying it as to a mob, that is, a monster, and also to another item, just to check. The effect is the same, that is, nothing happens.
In reply to Ichigame
User Avatar
Auto-translated
function hatF()
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub", nil );
MessageBox (GetMapDataPath().."lesorubnecro.txt");
end;
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub", "hatF" );

Added 1 minute ago
I embedded the file so that it displays correctly.
What file are you talking about?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Auto-translated
function hatF ()
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub", nil );
MessageBox (GetMapDataPath().."lesorubnecro.txt");
end;
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub", "hatF" );
Thank you. It works, but with a caveat. The text appears after the contact effect. That is, if it's a monster, the battle will start first, and only then will the text appear. But such text can also be added to the monster's settings without a script. But I need the text to appear *before* the battle. Well, in the case of a column that gives experience or something similar, the situation is the same. It gave experience first, then the text. It needs to be the other way around. It seems that the script needs to disable the object you're interacting with at the moment the script runs, so you can read the text calmly, and then it turns back on, and you can fight or do something else. That is, this code is more likely to work...
function tekstmob1(heroname)
Trigger(OBJECT_TOUCH_TRIGGER,'Lesorub',nil);
MessageBox(GetMapDataPath().."lesorubnecro.txt");
SetObjectEnabled('Lesorub',true);
sleep(5);
MakeHeroInreractWithObject(heroname,'Lesorub');
end;
SetObjectEnabled('Lesorub',nil);
Trigger(OBJECT_TOUCH_TRIGGER,'Lesorub','tekstmob1');
Am I understanding correctly? But how do I make it so that the text is only visible to the player who activated it, and doesn't pop up for other players during their turn...?
TalkBoxForPlayers can be used, but then the text will have to be moved to the description of the icon in the question mark, because there isn't much space to the right of the icon. Of course, this can be called a price for providing information, but I'm not sure if players will like having to click on the icon to read the next text of the quest or the text before the battle with a monster.
In general, there are some difficulties with displaying text in Multiplayer...
What is this file?
File: UI/CommonBoxes/TalkBox/Text.txt
Content:

File format: plain Unicode text (save in NOTEPAD as Unicode)

It is recommended to distribute this file as part of the map archives that use TalkBoxForPlayers.

..............................
That is, you create a folder in the map archive so that the text file is in the archive at the described path. The file is in Unicode, as usual. And in the file itself, it should be written

Then, for the person who launches your map, this script will work normally in terms of the text to the right of the icon. But there is little space, a scrollbar like in the message box does not appear, so you can't write much at all. It most resembles the Sphinx's interaction with its question and three answer options.
Sorry if I'm writing too much detail.
In reply to Ichigame
User Avatar
function hatF()
SetObjectEnabled('Lesorub', 1)
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub", nil)
MessageBox(GetMapDataPath().."lesorubnecro.txt")
end
SetObjectEnabled('Lesorub', nil)
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub", "hatF")
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
Auto-translated
RedHeavenHero
function hatF()
SetObjectEnabled('Lesorub', 1)
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub", nil)
MessageBox(GetMapDataPath().."lesorubnecro.txt")
end
SetObjectEnabled('Lesorub', nil)
Trigger(OBJECT_TOUCH_TRIGGER, "Lesorub", "hatF")
It works. However, it seems my idea can't be implemented, but... Is it possible to prevent this text from being displayed to other players when a turn is passed?
In reply to Ichigame
User Avatar
Auto-translated
Ichigame
It works. However, it seems my idea can't be implemented, but... is it possible to prevent this text from being displayed to other players when a turn is passed?
MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()),GetMapDataPath().."lesorubnecro.txt")
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Auto-translated
RedHeavenHero, thank you. It should work now. And since there was no such function in the manual, thank you even more.

Statistics

Welcome our newest member: Emil