Skip to content
User Avatar
#4031
Auto-translated
Dogenator, I answered both questions in my FAQ. 1. The script starts executing at the beginning of the first day, so the NEW\_DAY\_TRIGGER will not work for the first turn; it is not yet set at that moment. You can simply add a manual call to the first\_day() function at the end of the entire script. 2. When checking the day of the week, you can call not one function, but several: ```lua function first_day () if GetDate (0) == 3 then -----Checking the day of the week (Wednesday) function_1(); function_2(); end; end; ``` 3. And as a bonus: calling all functions in a new thread using startThread(day\_1) will work in this case, but if you are not sure why you are doing this, and you just saw it somewhere, then this is potentially a source of bugs, for example, if there is code like this: ```lua startThread(function_1) -- some code startThread(function_2) -- another code that assumes the code from function_1 has already been executed ``` then it will not work (or even worse, it will not always work), since these two functions are actually launched in parallel, and it is impossible to say for sure which of them will be executed first. You can simply do this: ```lua function_1(); function_2();
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо