String Operations
From Mount&Blade Modding Wiki
Contents |
Operations
Basic Manipulation
- str_is_empty = 2318 # (str_is_empty, <string_register>),
- str_clear = 2319 # (str_clear, <string_register>)
- str_store_string = 2320 # (str_store_string,<string_register>,<string_id>),
- str_store_string_reg = 2321 # (str_store_string,<string_register>,<string_no>), #copies one string register to another.
Basic Display
- display_debug_message = 1104 # (display_debug_message,<string_id>,[hex_colour_code]), #displays message only in debug mode, but writes to rgl_log.txt in both release and debug modes when edit mode is enabled
- display_log_message = 1105 # (display_log_message,<string_id>,[hex_colour_code]),
- display_message = 1106 # (display_message,<string_id>,[hex_colour_code]),
- set_show_messages = 1107 # (set_show_messages,<value>), #0 disables window messages 1 re-enables them.
Graphical Display
- tutorial_box = 1120 # (tutorial_box,<string_id>,<string_id>), #deprecated use dialog_box instead.
- dialog_box = 1120 # (tutorial_box,<text_string_id>,<title_string_id>),
- question_box = 1121 # (question_box,<string_id>, [<yes_string_id>], [<no_string_id>]),
- tutorial_message = 1122 # (tutorial_message,<string_id>, <color>), #set string_id = -1 for hiding the message
- set_tooltip_text = 1130 # (set_tooltip_text, <string_id>),
- talk_info_set_line = 2022 # (talk_info_set_line, <line_no>, <string_no>)
For advanced text display, see module_presentations.
Game Objects
Troop
- str_store_troop_name = 2322 # (str_store_troop_name,<string_register>,<troop_id>),
- str_store_troop_name_plural = 2323 # (str_store_troop_name_plural,<string_register>,<troop_id>),
- str_store_troop_name_by_count = 2324 # (str_store_troop_name_by_count,<string_register>,<troop_id>,<number>),
- str_store_troop_name_link = 2341 # (str_store_troop_name_link,<string_register>,<troop_id>),
Agent/Class
- str_store_agent_name = 2332 # (str_store_agent_name,<string_register>,<agent_id>),
- str_store_class_name = 2346 # (str_store_class_name,<stribg_register>,<class_id>)
Items
- str_store_item_name = 2325 # (str_store_item_name,<string_register>,<item_id>),
- str_store_item_name_plural = 2326 # (str_store_item_name_plural,<string_register>,<item_id>),
- str_store_item_name_by_count = 2327 # (str_store_item_name_by_count,<string_register>,<item_id>),
Other
- str_store_party_name = 2330 # (str_store_party_name,<string_register>,<party_id>),
- str_store_party_name_link = 2342 # (str_store_party_name_link,<string_register>,<party_id>),
- str_store_faction_name = 2335 # (str_store_faction_name,<string_register>,<faction_id>),
- str_store_faction_name_link = 2343 # (str_store_faction_name_link,<string_register>,<faction_id>),
- str_store_quest_name = 2336 # (str_store_quest_name,<string_register>,<quest_id>),
- str_store_quest_name_link = 2344 # (str_store_quest_name_link,<string_register>,<quest_id>),
- str_store_info_page_name = 2337 # (str_store_info_page_name,<string_register>,<info_page_id>),
- str_store_info_page_name_link = 2345 # (str_store_info_page_name_link,<string_register>,<info_page_id>),
- str_store_date = 2340 # (str_store_date,<string_register>,<number_of_hours_to_add_to_the_current_date>),
name_links will refer to the in-game Notes section inside Logs.
Multiplayer
- str_store_player_username = 2350 # (str_store_player_username,<string_register>,<player_id>),
- str_store_server_password = 2351 # (str_store_server_password, <string_register>),
- str_store_server_name = 2352 # (str_store_server_name, <string_register>),
- str_store_welcome_message = 2353 # (str_store_welcome_message, <string_register>),
- str_encode_url = 2355 # (str_encode_url, <string_register>),
Special Characters
These operations may be used inside of strings in the Module System, to call and display certain data, or perform limited conditional operations via parameter substitution.
Character | Description |
---|---|
{!} | The string will not be compiled into the translation csv files. |
@ | Initializes a quick-string which is not defined in module_strings |
Character | Description |
---|---|
\ | Linebreak character. Allows formatting a long string onto the next line, which must be aligned without extra spaces. |
^ | Nextline character. Will visually insert a new line in-game. |
String | Description |
---|---|
{s#} | Outputs the contents of the specified string register. |
{reg#} | Outputs the value of the specified register. |
{reg#?str1:str2} | Displays str1 if the value of reg# is true (anything but 0), otherwise display str2. |
{male/female} | Displays either string depending on the player's gender. |
{playername} | Displays the player's name. |