Thank you, I'll try. ceil is a rounding function, right?
P.S. Sorry for the silly question, but how do I open the console?
Console activation:
First, open the autoexec_a2.cfg file in Notepad, which is located
in the Profiles folder.
In the // Startup section, add:
setvar dev_console_password = schwinge-des-todes
Save. Then, open the input_a2.cfg file in Notepad,
which is located in the \My Documents\My Games\HOMM5TOE directory.
There, in the // console section, add:
bind show_console '`'
ceil is a rounding up function. I used this function specifically to avoid having a variable equal to 0.
And in general, WEEK is not an absolute week; it doesn't depend on the month and only takes values from 1 to 4. ;)
P.S. The console is the most essential thing in mapmaking, especially when using scripts. It helps identify errors, and sometimes it even tells you what's wrong. You can output variables to check them:
print(variable), etc.