Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
5 years ago
Auto-translated
Comrades, I have a question. I need a trigger for a new day to count down 7 days from the current day and only then execute the function, but it counts down to the 7th day of the week and executes the function. --- Trigger(NEW_DAY_TRIGGER, "Training_camp1") function Training_camp1() if GetDate(DAY) == DAY+7 then MessageBox("/Maps/SingleMissions/No_Mans_Lands/Text_Training_Camp1_is_over.txt") Trigger(OBJECT_TOUCH_TRIGGER, "tower1", "camp_1quest_complete"); end; end;
...И справедливость я несу
На острие меча.


Кампания "Искупление" - 15%



О кампании

"Искупление" - это мой амбициозный проект. Давняя мечта. С детства играя в героев, я восхищался персонажами и ландшафтами, сюжетом и стилем оригинальной трилогии, я мечтал привнести что-то свое в эту игру,  и наконец, более-менее освоив нелегкий труд картостроителя, взялся за воплощение мечты. Кампания расскажет о будущем выживших рыцарей Кровавой Стали, о пути, который они избрали, и о том, куда этот путь их приведет. К слову, мне нужен тестер-оценщик. Если хочешь принять участие в создании и есть определенный опыт, то - добро пожаловать!



User Avatar
5 years ago
Auto-translated
I don't understand your idea. If you need it to count down 7 days from a specific moment, store the date of that moment in a variable and compare it daily. If you simply need 7 days from the start of the game, use GetDate(DAY)==8.
С уважением, }{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
5 years ago
Auto-translated
}{0TT@6bI4
I don't understand your idea. If you need it to count down 7 days from a specific moment, then remember the date of that moment in a variable and compare it daily. If you just need 7 days from the start of the game, then use GetDate(DAY)==8.
The problem is that I don't know how to store the date in a variable.
...И справедливость я несу
На острие меча.


Кампания "Искупление" - 15%



О кампании

"Искупление" - это мой амбициозный проект. Давняя мечта. С детства играя в героев, я восхищался персонажами и ландшафтами, сюжетом и стилем оригинальной трилогии, я мечтал привнести что-то свое в эту игру,  и наконец, более-менее освоив нелегкий труд картостроителя, взялся за воплощение мечты. Кампания расскажет о будущем выживших рыцарей Кровавой Стали, о пути, который они избрали, и о том, куда этот путь их приведет. К слову, мне нужен тестер-оценщик. Если хочешь принять участие в создании и есть определенный опыт, то - добро пожаловать!



User Avatar
5 years ago
Auto-translated
...Script event
Shift=GetDate(DAY)
...
function TrainingCamp_1() --I recommend naming it NewDay
if GetDate(DAY) == Shift+7 then
Code
end
end
С уважением, }{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
5 years ago
Auto-translated
}{0TT@6bI4
...Scripted event
Shift=GetDate(DAY)
...
function TrainingCamp_1() --I recommend naming it NewDay
if GetDate(DAY) == Shift+7 then
Code
end
end
I actually tried to do that, but I made a mistake by entering the variable in the wrong place, and it counted from the beginning of the game instead of from the event. Thank you very much!
...И справедливость я несу
На острие меча.


Кампания "Искупление" - 15%



О кампании

"Искупление" - это мой амбициозный проект. Давняя мечта. С детства играя в героев, я восхищался персонажами и ландшафтами, сюжетом и стилем оригинальной трилогии, я мечтал привнести что-то свое в эту игру,  и наконец, более-менее освоив нелегкий труд картостроителя, взялся за воплощение мечты. Кампания расскажет о будущем выживших рыцарей Кровавой Стали, о пути, который они избрали, и о том, куда этот путь их приведет. К слову, мне нужен тестер-оценщик. Если хочешь принять участие в создании и есть определенный опыт, то - добро пожаловать!



In reply to }{0TT@6bI4
User Avatar
5 years ago
Auto-translated
}{0TT@6bI4
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.
No, a different error appears. Here's the script: (image 1)
function Mess()
SetObjectEnabled("z", nil);
SetMonsterSelectionType("z", 0);
end;
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, "podskazka", "Mess");

Another error was also found: (image 2)
function final()
TransformTown("pop", 0);
end;

I understand that I have many errors and requests for help, but I want to create a map that will be better than my previous ones, so please help me understand the scripts...
Attachments 2
2 files attached • Total size: 61.6 KB
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
In reply to Flame Crystal
User Avatar
5 years ago
Auto-translated
Flame Crystal
No, another error appears. Here's the script: (image 1)
function Mess()
SetObjectEnabled("z", nil);
SetMonsterSelectionType("z", 0);
end;
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER, "podskazka", "Mess");

Another error was also found: (image 2)
function final()
TransformTown("pop", 0);
end;

I understand that I have many errors and requests for help, but I want to create a map that will be better than the previous ones, so please help me understand the scripts...

I know how to solve your problem from image 1. Put a pause between the two commands like this:
SetObjectEnabled("z", nil);
sleep(1)
SetMonsterSelectionType("z", 0);
end;
...И справедливость я несу
На острие меча.


Кампания "Искупление" - 15%



О кампании

"Искупление" - это мой амбициозный проект. Давняя мечта. С детства играя в героев, я восхищался персонажами и ландшафтами, сюжетом и стилем оригинальной трилогии, я мечтал привнести что-то свое в эту игру,  и наконец, более-менее освоив нелегкий труд картостроителя, взялся за воплощение мечты. Кампания расскажет о будущем выживших рыцарей Кровавой Стали, о пути, который они избрали, и о том, куда этот путь их приведет. К слову, мне нужен тестер-оценщик. Если хочешь принять участие в создании и есть определенный опыт, то - добро пожаловать!



User Avatar
5 years ago
Auto-translated
Isn't it clear from the English text what the game wants?)) Error 1: the creature is not disabled. But the line exists. Just add a simple `sleep(1)`, and we can avoid the check. Also, I suggest giving more meaningful names than "z".
The second error clearly indicates that there is no city named "pop" suitable for transformation.
С уважением, }{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
5 years ago
Auto-translated
}{0TT@6bI4

The second error clearly hints that there is no "pop" town suitable for transformation.
The most interesting thing is that the town exists, but it doesn't want to transform.
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
5 years ago
Auto-translated
Make sure you have the script name spelled correctly. For example, 'p' and 'р', 'o' and 'о' are different letters! I mean, the keyboard layout. So, it's better to give the town a script name like "Town" or something similar.
С уважением, }{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
5 years ago
Auto-translated
}{0TT@6bI4
Make sure you have the script name written correctly. For example, p and р, o and о are different letters! I mean, the keyboard layout. So, it's better to give the city a script name like "Town" or something similar.
I have already fixed the error. Apparently, "destroyed" cities are not considered "cities." I replaced the "destroyed" human castle with a necromancer's castle, and it worked.
С уважением, ваша Дарина)
Мои сценарии:  
Лесной хранитель (лесной союз)
Путь к свету (чернокнижник)
Фалькон Сокол (орден порядка)
Инквизиция Ариоха (некроманты) - готово на 90%
User Avatar
5 years ago
Auto-translated


Then I will gladly remind you that the type of objects is determined not by their appearance and location in the editor, but by the Shared type. I'm glad you figured out the problem.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to inQizitOr
User Avatar
5 years ago
Auto-translated
I'm having trouble figuring out how to manage a player's resources if I don't know their quantity in advance. For example, a player approaches an object, and the object takes 500 gold from them. I only found scripts for determining the current amount of resources, but nothing more. Thank you in advance.
User Avatar
5 years ago
Auto-translated
Following the logic, it is very easy to write such a function.
function AddPlayerResource(pl, res, delta)
if GetPlayerResource(pl, res)+delta>=0 then
SetPlayerResource(pl, res, GetPlayerResource(pl, res)+delta)
else _ERRORMESSAGE("Resource quantity cannot be negative!")
end
end

In principle, you can write every time: set the resource to CurrentResourceAmount+Addition. This is obvious. But it is better to wrap it up and make it short: AddPlayerResource(1, GOLD, -5000)

There is also a function AddResource("HeroName", ResourceID, Delta)
Simulates a hero picking up a resource; the delta will be added to the current amount, and a message with an icon and the amount received will be displayed from the hero.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
5 years ago
Auto-translated
Good day, I had an idea for its implementation: is it possible to close the fog of war in a specific location using scripts? I couldn't find anything similar in the documentation.
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация

Statistics

Welcome our newest member: recijeb