Posts from Day and night cycle.
I remember in the last mission for Arantir, when he was passing through a garrison, the lighting on the map changed, or the file responsible for it was replaced with another. Could we do the same, but when a new day arrives? For example, I move, the AI moves, a new day arrives, and the lighting changes to night, and so on for each new "day-night" and "day-day" cycle.
Yes, yes, this is changed with scripts... in the maps of respected comrades Dyrman, RedHeavenHero, Ment, or other mapmakers - I seem to remember something like that... the lighting changed from day to night! :smile04:

---------------------------------------------
Неудачное планирование ведёт к неудаче ...
NCF - мод, добавляющий дополнительных существ в HeroesV 3.1
Next, each lighting element needs to have a script name added to its settings (it should be in one of them, but I don't remember exactly, so I'm writing it in both). -
And then you need to write a script using the SetAmbientLight() function. It has 4 parameters:
-script name of the lighting
-level at which the lighting changes (GROUND/UNDERGROUND)
-use a delay when changing the lighting (nil - no, 1 - yes)
-delay duration in seconds
In the end, if, for example, your goal is to change the lighting every day, the code will be approximately like this (using a 5-second change as an example):
curr_light = 'day'
function NewDay()
if curr_light == 'day' then
SetAmbientLight('night_lighting_name', GROUND, 1, 5.0)
curr_light = 'night'
else
SetAmbientLight('day_lighting_name', GROUND, 1, 5.0)
curr_light = 'day'
end
end
Trigger(NEW_DAY_TRIGGER, 'NewDay')
SetAmbientLight(GROUND, 'night_lighting_name', 1, 5.0) and so on.
Trigger(NEW_DAY_TRIGGER, 'Days')
function Days()
local Day_W = GetDate(DAY_OF_WEEK)
if Day_W == 1 then
SetAmbientLight(GROUND, 'PreLight', not nil, 1);
end
end
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
yes, I added the light in the MapPropertiesTree, it is an existing light in the game, not created by me. and I have tried with 0,1,2 .... nothing.
Gm... Ok, to add light it's needed:
Go to Map Properties Tree => Ground/Underground Ambient Lights => Add element with Internal Name in properties.
Than write in script SetAmbientLight(floor, name, fade, time).
Could you try to write only string with SetAmbLight function in console and tell results?
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
However, this will only work on maps that specify MapScript.lua (otherwise, the advmap-startup.lua files themselves will not run), which means it won't work on generated maps. Or, a map handler is needed that adds an empty MapScript to them.
In general, there is no such mod (yet), correct me if I'm wrong.
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________