Skip to content

A number of questions regarding map creation.

#9
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.