Skip to content
Conner Olsen edited this page Jun 26, 2026 · 3 revisions

CMM Text

Note: Text settings are singleplayer only.

You can create a text input using cmm_register_text_setting:

cmm_example_register_mod = {
	cmm_register_text_setting = {
		mod_id = cmm_example
		setting_id = example_text
		tab_id = general
		group_id = general_values
		character_limit = 42  # Maximum number of characters allowed
		quote_text = 1        # 1 = wrap submitted text in double quotes, 0 = do not wrap
	}
}
  • character_limit - the maximum number of characters the player can enter. Must be at least 1.
  • quote_text - when set to 1, CMM wraps the submitted text in double quotes before passing it to your effect. This is needed for use in some cases, such as change_country_name = $text$.

Text settings use a scripted effect callback instead of a Scripted GUI. Create an effect that will run when text is submitted:

cmm_example__example_text_on_changed = {
	# This effect receives the submitted text as $text$.
	# In this example it changes the country name to whatever the player typed.
	change_country_name = $text$
}
  • The callback must be named [Your_Mod_ID]__[Your_Setting_ID]_on_changed.
  • The submitted text is available as $text$.

Clone this wiki locally