Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
Special – for example, “repair” for Goblins, “lightning” for Titans. Passive – does not depend on the player's actions, for example, “Acid Breath,” “Burning,” “Magic Resistance.” Passive skills cannot be lost because they do not have, and cannot have, an animation.

Whatever
User Avatar
Auto-translated
The `end` statement should be placed immediately after the function: in some situations, errors may occur.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
in this situation, everything will be fine. Two different creatures can be present in the same building.

Whatever
User Avatar
Auto-translated
Help! The script isn't working. Why?
function share()
MessageBox( GetMapDataPath().."marketclosed.txt");
if HasArtefact("Linaas", 57) then
QuestionBox( GetMapDataPath().."proposalswap.txt","swap","noswap");
else MessageBox( GetMapDataPath().."goodbye.txt");
function noswap()
MessageBox( GetMapDataPath().."theworseswap.txt");
Trigger(OBJECT_TOUCH_TRIGGER, "proposalswap", nil );
end;
function swap()
MessageBox( GetMapDataPath().."commitswap.txt");
RemoveArtefact("Linaas",57);
GiveBorderguardKey(1,7);
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER, "proposalswap", "share");
User Avatar
Auto-translated
It seems like the "end" was missed again...

Whatever
User Avatar
Auto-translated
Where is it missing?
In reply to Вампир-лорд
User Avatar
Auto-translated
Vampire Lord
Help! The script isn't working. Why?
function share()
MessageBox( GetMapDataPath().."marketclosed.txt");
if HasArtefact("Linaas", 57) then
QuestionBox( GetMapDataPath().."proposalswap.txt","swap","noswap");
else MessageBox( GetMapDataPath().."goodbye.txt");
end
function noswap()
MessageBox( GetMapDataPath().."theworseswap.txt");
Trigger(OBJECT_TOUCH_TRIGGER, "proposalswap", nil );
end;
function swap()
MessageBox( GetMapDataPath().."commitswap.txt");
RemoveArtefact("Linaas",57);
GiveBorderguardKey(1,7);
end;
Trigger(OBJECT_TOUCH_TRIGGER, "proposalswap", "share");
This is one of those cases where the location of the function matters.
function share()
MessageBox( GetMapDataPath().."marketclosed.txt");
if HasArtefact("Linaas", 57) then
QuestionBox( GetMapDataPath().."proposalswap.txt","swap","noswap");
else MessageBox( GetMapDataPath().."goodbye.txt");
end
end
function noswap()
MessageBox( GetMapDataPath().."theworseswap.txt");
Trigger(OBJECT_TOUCH_TRIGGER, "proposalswap", nil );
end;
function swap()
MessageBox( GetMapDataPath().."commitswap.txt");
RemoveArtefact("Linaas",57);
GiveBorderguardKey(1,7);
end;
Trigger(OBJECT_TOUCH_TRIGGER, "proposalswap", "share")
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
The script still doesn't work. And along with it, another script doesn't work either!
--Disabling the standard operation of the closed market

SetObjectEnabled("proposalswap", nil);

--Exchange with the closed market merchant: the merchant gives the hero a border guard key, and the hero gives the merchant an artifact

function share()
MessageBox(GetMapDataPath().."marketclosed.txt");
if HasArtefact("Linaas", 57) then
QuestionBox(GetMapDataPath().."proposalswap.txt", "swap", "noswap");
else MessageBox(GetMapDataPath().."goodbye.txt");
end
end
function noswap()
MessageBox(GetMapDataPath().."theworseswap.txt");
Trigger(OBJECT_TOUCH_TRIGGER, "proposalswap", nil);
end;
function swap()
MessageBox(GetMapDataPath().."commitswap.txt");
RemoveArtefact("Linaas", 57);
GiveBorderguardKey(1, 7);
end;
Trigger(OBJECT_TOUCH_TRIGGER, "proposalswap", "share")
In reply to Вампир-лорд
User Avatar
Auto-translated
Are there any messages in the console at the beginning of the game or while visiting a location?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
At the beginning of the game, there is a message (it is highlighted in red): object "proposalswap" does not exist or is not interactive.
User Avatar
Auto-translated
An object with this name does not exist on the map or it is not possible to enable it.

Whatever
User Avatar
Auto-translated
Either I mixed up the names, or the object cannot be turned off. What is this object?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
Help! The script isn't working. It seems simple enough. I'm probably just not paying attention.

--Message from the Secret Library with a guardian

function stooop()
MessageBox(GetMapDataPath().."libraryharm.txt");
end;
Trigger(OBJECT_TOUCH_TRIGGER, "secretlibrary", "stooop");
User Avatar
Auto-translated
There is a high probability that the error lies in the library name or the text file name... Also, the problem might be in the text file itself, specifically with the encoding. And, by the way, I would recommend adding an extra condition, otherwise, the enemy might also visit the library, and then you will receive messages.
 

К А
Стикеры GBF в Telegram
User Avatar
Auto-translated
How can I make some heroes look like creatures? On the Unity of Elements map, the Titan named Titanus looks like a Titan creature.

Statistics

Welcome our newest member: Emil