Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
12 years ago
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.
User Avatar
12 years ago
Auto-translated
The `end` statement should be placed immediately after the function: in some situations, errors may occur.
User Avatar
12 years ago
Auto-translated
in this situation, everything will be fine. Two different creatures can be present in the same building.
User Avatar
12 years ago
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
12 years ago
Auto-translated
It seems like the "end" was missed again...
User Avatar
12 years ago
Auto-translated
Where is it missing?
In reply to Вампир-лорд
User Avatar
12 years ago
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")
User Avatar
12 years ago
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
12 years ago
Auto-translated
Are there any messages in the console at the beginning of the game or while visiting a location?
User Avatar
12 years ago
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
12 years ago
Auto-translated
An object with this name does not exist on the map or it is not possible to enable it.
User Avatar
12 years ago
Auto-translated
Either I mixed up the names, or the object cannot be turned off. What is this object?
User Avatar
12 years ago
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
12 years ago
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.
User Avatar
12 years ago
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: recijeb