Posts from Scripts
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
I didn't understand the last question.
Here, you can choose from a list, for example, 8 names, and select one for the specific case (example: blockedTavern[3]). Is it possible to exclude a specific name? Specifically for my case, i.e., select all 8 names and then exclude, for example, the 3rd one.
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
if IsObjectExist('mon') == true then
MessageBox(GetMapDataPath().."mes.txt");
else...
and in general, you can use:
if IsObjectExist('mon') == not nil then
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
You can choose from a list, for example, 8 names, and select one for the specific case (example: blockedTavern[3]), but is it possible to exclude a specific name? This is exactly what I need – to select all 8 names and then exclude, for example, the 3rd one.
It still doesn't work. It says "attempt to call a nil value".
Either put it in the array at index i, or simply iterate through the first two elements of the array first, and then through the rest. Don't compare with nil, but with true. Or, as I think, still with false, but then for equality, and not the other way around.
function regF()
if IsObjectExist('mon')=true then
MessageBox(GetMapDataPath().."mes2.txt");
else MessageBox(GetMapDataPath().."mes.txt");
end;
end;
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, "reg", "regF");?
if IsObjectExist ('mon')==true then
MessageBox (GetMapDataPath().."mes2.txt");
else MessageBox (GetMapDataPath().."mes.txt");
end;
end;
Trigger (REGION_ENTER_WITHOUT_STOP_TRIGGER, "reg", "regF");
(It happens :smile04:, that's why I advised using a script editor to check).
Oligarch, in your case, you need
if IsObjectExists ('mon')==nil ...
Use prints - it's the ideal option for catching errors
print (IsObjectExists('mon')); - and check the console.
if IsObjectExists ('mon')==true then, sorry, here's my advice - but there's an error in the IsObjectExists function - the letter S is required at the end. If there is no monster, it outputs nil (exactly nil, and not all sorts of true and false).
(It happens :smile04:, that's why I advised using a script editor to check).
Oligarch, in your case, you need
if IsObjectExists ('mon')==nil ...
Use prints - it's the perfect option for catching errors
print (IsObjectExists('mon')); - and look in the console
And I wrote Exist instead of Exists! I fixed it, and it worked right away.:smile52:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация