Skip to content
User Avatar
#3264
Auto-translated
Thank you! I managed to solve the previous problem, but now a new one has emerged. I'm trying to implement a change in lighting every in-game day.

function Sutki()

if GetDate(DAY_OF_WEEK)==1 then
SetAmbientLight(0,"d1",true, 5);
end;
if GetDate(DAY_OF_WEEK)==2 then
SetAmbientLight(0,"d2",true, 5);
end;
if GetDate(DAY_OF_WEEK)==3 then
SetAmbientLight(0,"d3",true, 5);
end;
if GetDate(DAY_OF_WEEK)==4 then
SetAmbientLight(0,"d4",true, 5);
end;
if GetDate(DAY_OF_WEEK)==5 then
SetAmbientLight(0,"d5",true, 5);
end;
if GetDate(DAY_OF_WEEK)==6 then
SetAmbientLight(0,"d6",true, 5);
end;
if GetDate(DAY_OF_WEEK)==7 then
SetAmbientLight(0,"d7",true, 5);
end;
end;


Trigger(NEW_DAY_TRIGGER, "Sutki");

The problem is that the game doesn't react to any of this; the lighting remains the same as on the first day throughout the week. Moreover, the console is silent; there are no error messages, and nothing happens. Initially, I did everything according to the example of a user named Khottabych, who was a few pages above, but then the console complained about an incorrect value for argument 1. After that, I looked at how the developers implemented this in the fifth mission for Arantir. There, I noticed that they had a "0" before the lighting name, so I added it to mine. The console stopped complaining, but it still didn't work. I've tried setting "True" as the developers did, and I've also tried replacing it with "GROUND" as Khottabych suggested, but there's no difference; the console remains silent in both cases. The InternalName of the lighting is specified correctly, and the lighting itself is duplicated in the map files. But it still doesn't work. Please advise on what the problem might be.