Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to Ment
#3396
Auto-translated
Ment
Ooooooh, object-oriented Lua?!
Regarding tables, I only used them once, I think, but it was a trivial case, and I didn't invent anything particularly clever to simplify things.
the023, please tell me what this RPGEngine is and what you use it for; it's very, very interesting. This library, right?


No, it's a custom-made engine.

Currently, Vadim TGAME and I are developing a new global mode called "Battle of Giants": https://www.youtube.com/watch?v=Eu5cMUoJDXA

We should release it by the end of spring. Unfortunately, I can't provide any details, but the mode will live up to its name: it will be gigantic.
eugnazaroff
создание скриптов к HOMM V
User Avatar
#3398
Auto-translated
Hello, dear mapmakers. I have a script that isn't working:

function final()
TransformTown(sTownName, 0);
end;

function final1()
end;

function kvest()
QuestionBox("/Maps/SingleMissions/ludi.nachalo/kvest2.txt", "final", "final1");
end;

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "kvest2", "kvest");

Perhaps I wrote something incorrectly and/or placed the file in the wrong location. Here is my path:

\Editor\H5MMods\ludi.nachalo\Maps\SingleMissions\ludi.nachalo

Can you advise me or point out where my mistake is?
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
#3399
Auto-translated
Darina, having more than two accounts is prohibited on the forum. Please write to Ment or Creator so they can merge your accounts.

Also, what is sTownname? What kind of variable is that?! Or did you just copy it from somewhere? Furthermore, what is the purpose of the empty final function? It's not an error, but it's unclear.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#3401
Auto-translated
}{0TT@6bI4
Comrade Darina, it is forbidden to have more than two accounts on the forum. Write to Ment or Creator so they can merge your accounts.
Okay, I've already written to them.
Author
Next, what is sTownname? What kind of variable is that?! Or did you just copy it from somewhere?
From one of the RDF files, from your group on VK. As I understand it, sTownname is the town that they want to transform into something else. sTownname - that's just the name I gave the town.
Author
Next, why is there an empty function called final? It's not an error, but it's unclear.
I need it so that nothing happens when "Cancel" is pressed, that's why it's empty.

And the problem is that the box itself doesn't even appear. The hero stops in the town - and that's it, nothing else happens.
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
#3402
Auto-translated
If you need nothing to happen, leave it as nil.
Check the console for errors.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#3403
Auto-translated
}{0TT@6bI4
If you need nothing to happen, leave it as nil.
Check the console for errors.
Yes, there was an error, "Empty message text." But I don't understand where I need to put the message text; I thought I put it in the right place, but the error still appears. Can you tell me where to put the messages correctly?
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
#3404
Auto-translated
Just check if the file path is correct. This error doesn't appear when the file is empty, but when the game can't find the specified .txt file at the given path.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#3405
Auto-translated
}{0TT@6bI4
Just check if the file path is correct. This error doesn't appear when the file is empty, but when the game can't find the specified txt file at the given path.
I looked at how messages are displayed in other scenarios, but I still couldn't get it to work. I also tried about 10 different paths, but none of them worked. Can you suggest where my mistake is?
I'm attaching screenshots:
Attachments 3
3 files attached • Total size: 274.3 KB
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
#3406
Auto-translated
Do you create the text file using a script editor or by creating a new text document in the map folder? If it's the latter, the problem is likely due to the file encoding. Create it using a script editor to ensure the correct encoding. Also, to avoid repeatedly specifying file paths and getting confused, you can use this structure:
path = GetMapDataPath()

function kvest()
QuestionBox(path.."kvest2.txt", "final", "final1");
end;
and so on.
Нет войне.
In reply to Gerter
User Avatar
#3407
Auto-translated
Gerter
Do you create the text file using the script editor or by creating a new text document in the map folder? If the latter, the problem is likely due to the file encoding. Create it using the script editor; this will guarantee the correct encoding. Also, to avoid having to specify file paths each time and to prevent confusion, you can use the following structure:
path = GetMapDataPath()

function kvest()
QuestionBox(path.."kvest2.txt", "final", "final1");
end;
and so on.

THANK YOU SO MUCH! It all worked!)
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
In reply to Flame Crystal
User Avatar
#3408
Auto-translated
Hello, dear mapmakers. The script below is not working again: ``` SetRegionBlocked("prohod", true, 1); function Otkrit() SetRegionBlocked("prohod", false, 1); end; Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, "lik", "Otkrit"); ``` And this error message appears, as shown in the picture. Can you tell me what is wrong with the code?
Attachments 1
1 file attached • Total size: 14.1 KB
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
#3409
Auto-translated
This is a warning, not an error. It indicates that the name "false" is not supported in that context, and the interpreter automatically replaced it with "nil". This happens frequently in scripts, even though the manual states that "false" should be used in such functions.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
#3410
Auto-translated
Ment
This is a warning, not an error.
It indicates that the name 'false' is not expected in that context, and the interpreter automatically replaced it with 'nil'. This happens frequently in scripts, even though the manual states that 'false' should be used in such functions.
So, what should I do? If I write 'nil', the same error appears. Does anyone know how to make the warning disappear?
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
#3411
Auto-translated
If you replace it with nil, does the error "Value was NIL when getting global with name false" still appear? Then the error isn't here.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________