Hy, I always wanted to know the day of the week in the game, so yesterday I decided to learn how to use the module system and see if it could be done. And today I decided to post it here in case someone wants to use it too.
First search in module_scripts.py for the string "game_get_date_text" then add the code after the (assign, ":cur_year", 1257)(which assigns the starting year), make sure you don't modify any of the code you just need to add the code.
Then you need to enter into module_strings.py and search for:
and replace it with:
and also add:
Or you could use the short day version:
Here is an image so you can see how it looks:
The game starts on Friday because according to a post I found 23 march 1257 was a Friday. The post was:
http://forums.taleworlds.com/index.php/topic,116965.msg2820885.html#msg2820885
Also if anyone knows a better way to do it, please tell me.
Edit: I want to thank Ikaguia for helping me simplify the code.
First search in module_scripts.py for the string "game_get_date_text" then add the code after the (assign, ":cur_year", 1257)(which assigns the starting year), make sure you don't modify any of the code you just need to add the code.
Code:
# Aca empieza el codigo de la semana/ Here starts the weekday code
(store_mod, ":week_day", ":num_days", 7),
(val_add, ":week_day", "str_weekday_0"),
(str_store_string, s1, ":week_day"),
# Aca termina el codigo de la semana/ Here ends the weekday code
# 12 hour am pm clock
(store_time_of_day, ":timeofday"),
(try_begin),
(ge,":timeofday",12),
(assign, reg4, 1),
(val_sub, ":timeofday", 12),
(else_try),
(assign, reg4, 0),
(try_end),
(try_begin),
(eq, ":timeofday", 0),
(assign, ":timeofday", 12),
(try_end),
(assign, reg3, ":timeofday"),
Then you need to enter into module_strings.py and search for:
Code:
("january_reg1_reg2", "January {reg1}, {reg2}"),
("february_reg1_reg2", "February {reg1}, {reg2}"),
("march_reg1_reg2", "March {reg1}, {reg2}"),
("april_reg1_reg2", "April {reg1}, {reg2}"),
("may_reg1_reg2", "May {reg1}, {reg2}"),
("june_reg1_reg2", "June {reg1}, {reg2}"),
("july_reg1_reg2", "July {reg1}, {reg2}"),
("august_reg1_reg2", "August {reg1}, {reg2}"),
("september_reg1_reg2", "September {reg1}, {reg2}"),
("october_reg1_reg2", "October {reg1}, {reg2}"),
("november_reg1_reg2", "November {reg1}, {reg2}"),
("december_reg1_reg2", "December {reg1}, {reg2}"),
and replace it with:
Code:
("january_reg1_reg2", "{reg2} January {reg1}, {s1} {reg3}{reg4?pm:am}"), #Agrego el string s2 con el dia de la semana en todos los meses
("february_reg1_reg2", "{reg2} February {reg1}, {s1} {reg3}{reg4?PM:AM}"), #Adds s2 string with the week day
("march_reg1_reg2", "{reg2} March {reg1}, {s1} {reg3}{reg4?PM:AM}"),
("april_reg1_reg2", "{reg2} April {reg1}, {s1} {reg3}{reg4?PM:AM}"),
("may_reg1_reg2", "{reg2} May {reg1}, {s1} {reg3}{reg4?PM:AM}"),
("june_reg1_reg2", "{reg2} June {reg1}, {s1} {reg3}{reg4?PM:AM}"),
("july_reg1_reg2", "{reg2} July {reg1}, {s1} {reg3}{reg4?PM:AM}"),
("august_reg1_reg2", "{reg2} August {reg1}, {s1} {reg3}{reg4?PM:AM}"),
("september_reg1_reg2", "{reg2} September {reg1}, {s1} {reg3}{reg4?PM:AM}"),
("october_reg1_reg2", "{reg2} October {reg1}, {s1} {reg3}{reg4?PM:AM}"),
("november_reg1_reg2", "{reg2} November {reg1}, {s1} {reg3}{reg4?PM:AM}"),
("december_reg1_reg2", "{reg2} December {reg1}, {s1} {reg3}{reg4?PM:AM}"),
and also add:
Code:
("weekday_0", "Friday"), # Genero los strings de los dias de la semana
("weekday_1", "Saturday"), # Generating weekdays strings
("weekday_2", "Sunday"),
("weekday_3", "Monday"),
("weekday_4", "Tuesday"),
("weekday_5", "Wednesday"),
("weekday_6", "Thursday"),
Or you could use the short day version:
Code:
("weekday_0", "Fri"), # Genero los strings de los dias de la semana
("weekday_1", "Sat"), # Generating weekdays strings
("weekday_2", "Sun"),
("weekday_3", "Mon"),
("weekday_4", "Tue"),
("weekday_5", "Wed"),
("weekday_6", "Thu"),
Here is an image so you can see how it looks:
The game starts on Friday because according to a post I found 23 march 1257 was a Friday. The post was:
http://forums.taleworlds.com/index.php/topic,116965.msg2820885.html#msg2820885
Also if anyone knows a better way to do it, please tell me.
Edit: I want to thank Ikaguia for helping me simplify the code.