Posts from Messages
setCount = 0;
function setInfo()
setCount = setCount+1;
if setCount == 1 then
MessageBox(GetMapDataPath()..'count1from8.txt');
elseif setCount == 2 then
MessageBox(GetMapDataPath()..'count2from8.txt');
elseif setCount == 3 then
MessageBox(GetMapDataPath()..'count3from8.txt');
elseif setCount == 4 then
MessageBox(GetMapDataPath()..'count4from8.txt');
elseif setCount == 5 then
MessageBox(GetMapDataPath()..'count5from8.txt');
elseif setCount == 6 then
MessageBox(GetMapDataPath()..'count6from8.txt');
elseif setCount == 7 then
MessageBox(GetMapDataPath()..'count7from8.txt');
elseif setCount == 8 then
MessageBox(GetMapDataPath()..'count8from8.txt');
GiveArtefact("heroname", artifact1Id);
GiveArtefact("heroname", artifact2Id);
ChangeHeroStat("heroname", STAT, count);
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard1', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard2', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard3', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard4', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard5', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard6', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard7', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard8', 'setInfo');
If anything is unclear, I'll describe everything that happens here in more detail.
P.S. All of this is actually in the "scripts" topic, although you'll have to search for it there for a very long time
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Added 1 hour and 3 minutes later
Another problem arose: I'm creating a second ghost necromancer, and when I change his special ability in the shared settings, the special ability of the first one also changes. What should I do?:smile45:
Added 8 minutes later
And the function also needs to include a check for accuracy:
setCount = 0;
function setInfo(object, hero)
setCount = setCount+1;
heroname = hero;
sleep(5);
if IsHeroAlive(heroname) ~= true then
return;
end;
if setCount == 1 then
MessageBox(GetMapDataPath()..'count1from8.txt');
elseif setCount == 2 then
MessageBox(GetMapDataPath()..'count2from8.txt');
elseif setCount == 3 then
MessageBox(GetMapDataPath()..'count3from8.txt');
elseif setCount == 4 then
MessageBox(GetMapDataPath()..'count4from8.txt');
elseif setCount == 5 then
MessageBox(GetMapDataPath()..'count5from8.txt');
elseif setCount == 6 then
MessageBox(GetMapDataPath()..'count6from8.txt');
elseif setCount == 7 then
MessageBox(GetMapDataPath()..'count7from8.txt');
elseif setCount == 8 then
MessageBox(GetMapDataPath()..'count8from8.txt');
GiveArtefact("heroname", artifact1Id);
GiveArtefact("heroname", artifact2Id);
ChangeHeroStat("heroname", STAT, count);
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard1', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard2', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard3', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard4', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard5', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard6', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard7', 'setInfo');
Trigger(OBJECT_TOUCH_TRIGGER, 'dragonGuard8', 'setInfo');
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
do I need to write the line ChangeHeroStat("heroname", STAT, count) four times? i.e., in the first one, stat_attack, in the second, stat_defence, and so on?
stats = {STAT_EXPERIENCE, STAT_ATTACK, STAT_DEFENCE, STAT_SPELL_POWER, STAT_KNOWLEDGE, STAT_LUCK, STAT_MORALE};
for i = 1, length(stats) do
ChangeHeroStat("heroname", stats, count);
end;
something like this
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация