Here I am again with TalkBoxForPlayers.
The problem is this: there's a working code snippet, and it's written 8 times for 8 players, triggered by touching 8 different objects. And that's where the biggest issue starts.
For the first 2 functions, everything works perfectly.
For functions 3-8, the dialog box isn't called.
For these same functions 3-8, the else messagebox line is called....
Here's the code:
function pokrov1F(hero)
human = hero
if HasHeroSkill(human, 80)
then
DialogBox("/UI/MessageBox/Message.xdb#xpointer(/Texture)","/UI/MessageBox/TalkBox/text.txt", "/Maps/Multiplayer/arena/pokrov1.txt", 1, "pokrov1otvetF", "/Maps/Multiplayer/arena/pokrov2.txt", "/Maps/Multiplayer/arena/pokrov3.txt", "/Maps/Multiplayer/arena/pokrov4.txt", "/Maps/Multiplayer/arena/pokrov5.txt")
Trigger (OBJECT_TOUCH_TRIGGER, "pokrov1", nil);
else MessageBox("/Maps/Multiplayer/arena/netpokrov.txt");
end;
end;
Trigger (OBJECT_TOUCH_TRIGGER, "pokrov1", "pokrov1F");
function pokrov1otvetF(pl, ans)
if (ans==1)
then
ChangeHeroStat(human, STAT_ATTACK, 3);
elseif (ans==2)
then
ChangeHeroStat(human, STAT_SPELL_POWER, 3);
elseif (ans==3)
then
ChangeHeroStat(human, STAT_KNOWLEDGE, 3);
elseif (ans==4)
then
ChangeHeroStat(human, STAT_LUCK, 2);
end;
end;
Of course, I change the parameters so that it works for different players.
I change them to the numbers 2, 3, and so on, up to 8; I've highlighted the parameters that are being changed in yellow.
I don't know where the problem is because in ALL the functions, the presence of perk 80 is actually checked, because when it's not present, the else messagebox is shown, but how is it that it works for numbers 1 and 2, but not after that?