Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
12 years ago
Auto-translated
Could you please tell me where the error is in my script? ```html

function Missiya1F()
MessageBox ("\Maps\SingleMissions\Missiya_1\Missiya2_ts");
Trigger(OBJECT_TOUCH_TRIGGER, ”Missiya1”, ”nil” );
end;














Trigger(OBJECT_TOUCH_TRIGGER, ”Missiya1”, ”Missiya1F” );
``` I created the text in the editor and removed the line break. To clarify, the object used to display the message is called "Wizard's Hut." Also, do you know of a script that prevents a hero without a Castle from losing after a week has passed, and where should I insert it? Thank you in advance.
In reply to Иней
User Avatar
12 years ago
Auto-translated
function Missiya1F()
MessageBox ("\Maps\SingleMissions\Missiya_1\Missiya2_ts");
Trigger(OBJECT_TOUCH_TRIGGER, “Missiya1”, “nil” );
end;














Trigger(OBJECT_TOUCH_TRIGGER, “Missiya1”, “Missiya1F” );
The quotes are incorrect, the slashes are wrong, "nil" should be written without quotes, and the file extension .txt is missing from the path to the text. And why so many empty lines?

Added 45 seconds later
I'll answer right away: the object used to display the message is called "Wizards' Hut".
Maybe it's a prophet's hut?

Added 5 minutes later
And also, do you know a script so that a hero without a Castle doesn't lose after a week, and where to put it? Thank you in advance.
These are not scripts; you need to set it to false in the editor in the property tree: objectives/Primary/PlayerSpecific/[player number]/DieInWeekWithoutTown.
In reply to RedHeavenHero
User Avatar
12 years ago
Auto-translated
Could it be the Prophet's Hut?
No. The original name is Hut of the Mage. This object allows you to see the area around the Mage's Eye.

It still doesn't work. I wrote the script like this, but it still doesn't work:

function Missiya1F()
MessageBox ("\Maps\SingleMissions\Missiya_1\Missiya2_ts.txt");
Trigger(OBJECT_TOUCH_TRIGGER, "Missiya1", "Missiya1F" );
Trigger(OBJECT_TOUCH_TRIGGER, "Missiya1", nil );
end;
end;
In reply to Иней
User Avatar
12 years ago
Auto-translated
Frost
No. The original name is Hut of the Mage. This object allows you to see the area around the Mage's Hut.
This is a mage's hut.
It still doesn't work. I wrote the script like this, but it still doesn't work:
The slashes haven't been fixed, and the trigger has been unnecessarily placed in a function. There's an extra "end."
function Missiya1F()
MessageBox ("/Maps/SingleMissions/Missiya_1/Missiya2_ts.txt");
Trigger(OBJECT_TOUCH_TRIGGER, "Missiya1", nil );
end;

Trigger(OBJECT_TOUCH_TRIGGER, "Missiya1", "Missiya1F" );
User Avatar
12 years ago
Auto-translated
How to create a new faction?

Added 14 hours and 6 minutes ago
If it's not possible to create a new one, how can I replace an existing one? I can open .xdb files with Notepad, but what can I use to edit them, because after I make changes, the file is saved in .txt format? How do I create new alternative creatures? How do I create new neutral creatures?
User Avatar
12 years ago
Auto-translated
The notepad can also save in the xdb format. And you can also rename the finished file. For neutral creatures, there is a new ncf project (see the "Mods" section here on the forum). Creating new alternative creatures is tedious, but there was a mod for the fourth column, I think even here.
User Avatar
12 years ago
Auto-translated
And how do you create alternative creatures? How do you create a new faction? If creating a new one isn't possible, how can you replace an existing one?
User Avatar
12 years ago
Auto-translated
Could you please tell me why my script isn't working?
function StudyMon()
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "MonL", nil );
MessageBox("/Maps/SingleMissions/learning/mon");
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "MonL", "StudyMon" );
User Avatar
12 years ago
Auto-translated
Error in the message box. At a minimum, it should end with .txt.
User Avatar
12 years ago
Auto-translated
The script still doesn't work. The console displays "empty message text."
User Avatar
12 years ago
Auto-translated
Is the path correct? And is the .txt file in Unicode or ANSI format? Does the region name exactly match the one you reference in the scripts? It must match, including the case of the letters.
User Avatar
12 years ago
Auto-translated
Is there a script that disables the abilities of an artifact (so that the artifact does nothing and can only be carried)?
User Avatar
12 years ago
Auto-translated
Haha. Well, for that purpose, I would create a copy of the artifact with the same model, based on some kind of Frida... If it has to be done with scripts, you can implement a check to see if the hero has the artifact, and if so, remove the stats that the artifact gives. But this method isn't very good; some bonuses can't be removed (+ to initiative, for example), and it seems like there isn't a function in the game to check if an artifact is equipped or not (only a check for the number of equipped artifacts from one set, although I might be wrong).
In reply to Ment
User Avatar
12 years ago
Auto-translated
Besides, there doesn't seem to be a function in Heroes that checks whether an artifact is equipped or not.
If the third argument of HasArtefact is 1, the function will return 1 only if the artifact is equipped.
User Avatar
12 years ago
Auto-translated
Well, basically... I need help again. Actually, I've asked something similar before, but I can't open that map right now. I want to create a script like this: --assign the name "hut" to all huts --output to a touch trigger --when touched, check for a hero and a specific quest. --if it matches, enable the hut + quest box --if okay, then "blah-blah-blah"; if not, remove the enabled state. I actually only need the script for the first line right now. How can I give all the huts on the map the name "hut" and assign them a single touch_trigger?

Statistics

Welcome our newest member: recijeb