jik
Knight
Ok, while I was waiting on an answer (thanks MartinF) for one of my questions, I thought that I would pre-emptive strike on an in game string typer. This KIT allows you to create a text string (much like typing your name) in game.
[EDIT: Fixed the problem with the f and a keys]
###UPDATED (02/23/2009)###
Thanks to MartinF and Jinnai, I have gotten this to a more usable state. Can use letters,numbers and spaces. Backspace will delete the most recent character. You can toggle the caps for the next char with either left or right shift. Press Delete to clear the string. Press enter to view the current full string. I have it set to hold a max of 25 characters, but this can be changed in the script file.
this has 3 parts, but the third is just for info:
This is the mission_template, placed anywhere:
This script will convert the key strokes to the text string s10. You still need to, at the end of the process, dump the text of s10 into what ever you are renaming.
This is the dialog for the dialog box that tells the player how it works. I put this at the bottom of module_stirngs.py:
This is far from complete (as in v0.2), but I did most of the grunt work (adding in all the letters both caps on and off). This is in hopes that we can rename certian aspects of the game. I have heard that we can re-name towns, but I would like to use it to name offspring in my mod, as well as founded villiages and the like.
I used hareck in my tutorial to call it up with this dialog option:
One more note to add. This is a presentation version of kit (on the second page of this thread). I'll link it here, so it doesn't get lost:
http://forums.taleworlds.com/index.php/topic,57775.msg1503015.html#msg1503015
(SIDE NOTE: in adding the string at the bottom, I noticed that I made the credits in the feedback section.. Woo hoo!)
[EDIT: Fixed the problem with the f and a keys]
###UPDATED (02/23/2009)###
Thanks to MartinF and Jinnai, I have gotten this to a more usable state. Can use letters,numbers and spaces. Backspace will delete the most recent character. You can toggle the caps for the next char with either left or right shift. Press Delete to clear the string. Press enter to view the current full string. I have it set to hold a max of 25 characters, but this can be changed in the script file.
this has 3 parts, but the third is just for info:
This is the mission_template, placed anywhere:
##JIK's typing in game. Call this mission_template to any scene. I have tested calling it
##from a dialog, and pointing it to town_1_arena as the scene.
##Use with party_set_name to change the name of a party(town) and faction_set_name to
##change the name of a faction.
("type_out_words",mtf_no_blood,-1,"Type In a Name",
[(56, mtef_visitor_source|mtef_team_0, af_override_horse, aif_start_alarmed, 1, []),
#(58, mtef_visitor_source|mtef_team_2, af_override_horse, aif_start_alarmed, 1, []),
],
[common_inventory_not_available,
(ti_question_answered, 0, 0, [], ##Question answer code : yes/no outcome
[(store_trigger_param_1,":answer"),
(try_begin),
(eq,":answer",0),
(finish_mission,0),
(try_end),
]
),
(1,0,ti_once,[], ##first clear the string, reset capslock, reset string counter
[(str_clear,s10),
(assign,"$caps_on",0),
(dialog_box,"str_texttype_mission_info"),
(assign,"$str_len",0), ##Reset the string length
]
), #make sure the string to use is empty to start, turn off caps lock
(ti_tab_pressed, 0, 0, [],[(question_box,"str_do_you_wish_to_leave_tutorial"),]),
##Special keys with functionality
(0, 0, 0,[(key_clicked, key_delete)], ## to erase and start anew
[(str_clear,s10),(assign,"$str_len",0),(display_message, "@Clearing the current string",0xaa0000)]
),
(0, 0, 0,[(this_or_next|key_clicked, key_left_shift),(key_clicked, key_right_shift)],
[(try_begin),
(eq, "$caps_on",1),
(assign, "$caps_on",0),
(display_message, "@The next letter will be lowercase..."),
(else_try),
(assign, "$caps_on",1),
(display_message, "@THE NEXT LETTER WILL BE UPPERCASE..."),
]
),
(0, 0, 0,[(key_clicked, key_backspace)], ## to erase the last typed character
[(try_begin),
(gt,"$str_len",0),
(troop_set_slot, "trp_temp_array_b", "$str_len",0), #test
(val_sub,"$str_len",1),
(assign,reg2,"$str_len"),
(display_message, "@Deleted last later. $str_len is now {reg2}",0x550055),
(call_script,"script_show_text_string"),
(else_try),
(display_message, "@Nothing to delete!"),
(try_end),
]
),
(0, 0, 0,[(key_clicked, key_enter)], ## show the string
[(call_script,"script_show_text_string"),]
),
##tip : (troop_set_slot, "trp_temp_array_b", reg(12),reg(12)), #Initialize temp_array_b such that temp_array_b = i
## Letter work here :
(0, 0, 0,[(key_clicked, key_space)],
[(assign,":val",key_space),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_1)],
[(assign,":val",key_1),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_2)],
[(assign,":val",key_2),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_3)],
[(assign,":val",key_3),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_4)],
[(assign,":val",key_4),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_5)],
[(assign,":val",key_5),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_6)],
[(assign,":val",key_6),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_7)],
[(assign,":val",key_7),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_],
[(assign,":val",key_,
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_9)],
[(assign,":val",key_9),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_0)],
[(assign,":val",key_0),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_a)],
[(assign,":val",key_a),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_b)],
[(assign,":val",key_b),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_c)],
[(assign,":val",key_c),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_d)],
[(assign,":val",key_d),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_e)],
[(assign,":val",key_e),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_f)],
[(assign,":val",key_f),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_g)],
[(assign,":val",key_g),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_h)],
[(assign,":val",key_h),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_i)],
[(assign,":val",key_i),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_j)],
[(assign,":val",key_j),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_k)],
[(assign,":val",key_k),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_l)],
[(assign,":val",key_l),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_m)],
[(assign,":val",key_m),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_n)],
[(assign,":val",key_n),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_o)],
[(assign,":val",key_o),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_p)],
[(assign,":val",key_p),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_q)],
[(assign,":val",key_q),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_r)],
[(assign,":val",key_r),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_s)],
[(assign,":val",key_s),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_t)],
[(assign,":val",key_t),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_u)],
[(assign,":val",key_u),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_v)],
[(assign,":val",key_v),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_w)],
[(assign,":val",key_w),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_x)],
[(assign,":val",key_x),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_y)],
[(assign,":val",key_y),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_z)],
[(assign,":val",key_z),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
],
),
##from a dialog, and pointing it to town_1_arena as the scene.
##Use with party_set_name to change the name of a party(town) and faction_set_name to
##change the name of a faction.
("type_out_words",mtf_no_blood,-1,"Type In a Name",
[(56, mtef_visitor_source|mtef_team_0, af_override_horse, aif_start_alarmed, 1, []),
#(58, mtef_visitor_source|mtef_team_2, af_override_horse, aif_start_alarmed, 1, []),
],
[common_inventory_not_available,
(ti_question_answered, 0, 0, [], ##Question answer code : yes/no outcome
[(store_trigger_param_1,":answer"),
(try_begin),
(eq,":answer",0),
(finish_mission,0),
(try_end),
]
),
(1,0,ti_once,[], ##first clear the string, reset capslock, reset string counter
[(str_clear,s10),
(assign,"$caps_on",0),
(dialog_box,"str_texttype_mission_info"),
(assign,"$str_len",0), ##Reset the string length
]
), #make sure the string to use is empty to start, turn off caps lock
(ti_tab_pressed, 0, 0, [],[(question_box,"str_do_you_wish_to_leave_tutorial"),]),
##Special keys with functionality
(0, 0, 0,[(key_clicked, key_delete)], ## to erase and start anew
[(str_clear,s10),(assign,"$str_len",0),(display_message, "@Clearing the current string",0xaa0000)]
),
(0, 0, 0,[(this_or_next|key_clicked, key_left_shift),(key_clicked, key_right_shift)],
[(try_begin),
(eq, "$caps_on",1),
(assign, "$caps_on",0),
(display_message, "@The next letter will be lowercase..."),
(else_try),
(assign, "$caps_on",1),
(display_message, "@THE NEXT LETTER WILL BE UPPERCASE..."),
]
),
(0, 0, 0,[(key_clicked, key_backspace)], ## to erase the last typed character
[(try_begin),
(gt,"$str_len",0),
(troop_set_slot, "trp_temp_array_b", "$str_len",0), #test
(val_sub,"$str_len",1),
(assign,reg2,"$str_len"),
(display_message, "@Deleted last later. $str_len is now {reg2}",0x550055),
(call_script,"script_show_text_string"),
(else_try),
(display_message, "@Nothing to delete!"),
(try_end),
]
),
(0, 0, 0,[(key_clicked, key_enter)], ## show the string
[(call_script,"script_show_text_string"),]
),
##tip : (troop_set_slot, "trp_temp_array_b", reg(12),reg(12)), #Initialize temp_array_b such that temp_array_b = i
## Letter work here :
(0, 0, 0,[(key_clicked, key_space)],
[(assign,":val",key_space),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_1)],
[(assign,":val",key_1),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_2)],
[(assign,":val",key_2),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_3)],
[(assign,":val",key_3),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_4)],
[(assign,":val",key_4),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_5)],
[(assign,":val",key_5),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_6)],
[(assign,":val",key_6),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_7)],
[(assign,":val",key_7),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_],
[(assign,":val",key_,
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_9)],
[(assign,":val",key_9),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_0)],
[(assign,":val",key_0),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_a)],
[(assign,":val",key_a),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_b)],
[(assign,":val",key_b),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_c)],
[(assign,":val",key_c),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_d)],
[(assign,":val",key_d),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_e)],
[(assign,":val",key_e),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_f)],
[(assign,":val",key_f),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_g)],
[(assign,":val",key_g),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_h)],
[(assign,":val",key_h),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_i)],
[(assign,":val",key_i),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_j)],
[(assign,":val",key_j),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_k)],
[(assign,":val",key_k),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_l)],
[(assign,":val",key_l),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_m)],
[(assign,":val",key_m),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_n)],
[(assign,":val",key_n),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_o)],
[(assign,":val",key_o),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_p)],
[(assign,":val",key_p),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_q)],
[(assign,":val",key_q),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_r)],
[(assign,":val",key_r),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_s)],
[(assign,":val",key_s),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_t)],
[(assign,":val",key_t),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_u)],
[(assign,":val",key_u),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_v)],
[(assign,":val",key_v),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_w)],
[(assign,":val",key_w),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_x)],
[(assign,":val",key_x),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_y)],
[(assign,":val",key_y),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
(0, 0, 0,[(key_clicked, key_z)],
[(assign,":val",key_z),
(try_begin),
(eq,"$caps_on",1),
(val_add,":val",10000), ## When checking for caps, can test if the value is over 9999, then subtract 10000 from it to get just the value
(try_end),
(troop_set_slot, "trp_temp_array_b", "$str_len",":val"),
(val_add,"$str_len",1),
(call_script,"script_show_text_string"),
]
),
],
),
This script will convert the key strokes to the text string s10. You still need to, at the end of the process, dump the text of s10 into what ever you are renaming.
##script_show_text_string
##converts a string of key presses into a string s10
##Input : none
##Output: string to s10
("show_text_string",
[(str_clear,s10),
(assign,":acaps",0),
######Test Max of 25 Chars
(try_begin),
(eq,"$str_len",25),
(display_message,"@MAXIMUM 25 characters. The last character was not recorded",0xff8800),\
(val_sub,"$str_len",1),
(try_end),
######Test end
(assign,":endcount","$str_len"),
(try_for_range,"count",0,":endcount"),
(troop_get_slot,reg1,"trp_temp_array_b", "count"),
(assign,":acaps",0),
######Test CAPS
(try_begin),
(gt,reg1,10000), ##capital letter here
(assign,":acaps",1),
(val_sub,reg1,10000),
(try_end),
######Test end
(try_begin),
(eq,reg1,key_space),
(str_store_string,s10,"@{s10} "),
(else_try),
(eq,reg1,key_1),
(str_store_string,s10,"@{s10}1"),
(else_try),
(eq,reg1,key_2),
(str_store_string,s10,"@{s10}2"),
(else_try),
(eq,reg1,key_3),
(str_store_string,s10,"@{s10}3"),
(else_try),
(eq,reg1,key_4),
(str_store_string,s10,"@{s10}4"),
(else_try),
(eq,reg1,key_5),
(str_store_string,s10,"@{s10}5"),
(else_try),
(eq,reg1,key_6),
(str_store_string,s10,"@{s10}6"),
(else_try),
(eq,reg1,key_7),
(str_store_string,s10,"@{s10}7"),
(else_try),
(eq,reg1,key_,
(str_store_string,s10,"@{s10}8"),
(else_try),
(eq,reg1,key_9),
(str_store_string,s10,"@{s10}9"),
(else_try),
(eq,reg1,key_0),
(str_store_string,s10,"@{s10}0"),
(else_try),
(eq,reg1,key_a),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}A"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}a"),
(try_end),
(else_try),
(eq,reg1,key_b),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}B"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}b"),
(try_end),
(else_try),
(eq,reg1,key_c),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}C"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}c"),
(try_end),
(else_try),
(eq,reg1,key_d),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}D"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}d"),
(try_end),
(else_try),
(eq,reg1,key_e),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}E"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}e"),
(try_end),
(else_try),
(eq,reg1,key_f),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}F"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}F"),
(try_end),
(else_try),
(eq,reg1,key_g),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}G"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}g"),
(try_end),
(else_try),
(eq,reg1,key_h),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}H"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}h"),
(try_end),
(else_try),
(eq,reg1,key_i),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}I"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}i"),
(try_end),
(else_try),
(eq,reg1,key_j),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}J"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}j"),
(try_end),
(else_try),
(eq,reg1,key_k),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}K"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}k"),
(try_end),
(else_try),
(eq,reg1,key_l),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}L"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}l"),
(try_end),
(else_try),
(eq,reg1,key_m),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}M"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}m"),
(try_end),
(else_try),
(eq,reg1,key_n),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}N"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}n"),
(try_end),
(else_try),
(eq,reg1,key_o),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}O"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}o"),
(try_end),
(else_try),
(eq,reg1,key_p),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}P"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}p"),
(try_end),
(else_try),
(eq,reg1,key_q),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}Q"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}q"),
(try_end),
(else_try),
(eq,reg1,key_r),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}R"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}r"),
(try_end),
(else_try),
(eq,reg1,key_s),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}S"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}s"),
(try_end),
(else_try),
(eq,reg1,key_t),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}T"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}t"),
(try_end),
(else_try),
(eq,reg1,key_u),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}U"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}u"),
(try_end),
(else_try),
(eq,reg1,key_v),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}V"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}v"),
(try_end),
(else_try),
(eq,reg1,key_w),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}W"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}w"),
(try_end),
(else_try),
(eq,reg1,key_x),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}X"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}x"),
(try_end),
(else_try),
(eq,reg1,key_y),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}Y"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}y"),
(try_end),
(else_try),
(eq,reg1,key_z),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}Z"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}z"),
(try_end),
(try_end),
(try_end),
(display_message,"@the string is now:"),
(display_message,"@{s10}",0xfff000),
(assign, "$caps_on",0), ##Turn caps off after each letter
]
),
##converts a string of key presses into a string s10
##Input : none
##Output: string to s10
("show_text_string",
[(str_clear,s10),
(assign,":acaps",0),
######Test Max of 25 Chars
(try_begin),
(eq,"$str_len",25),
(display_message,"@MAXIMUM 25 characters. The last character was not recorded",0xff8800),\
(val_sub,"$str_len",1),
(try_end),
######Test end
(assign,":endcount","$str_len"),
(try_for_range,"count",0,":endcount"),
(troop_get_slot,reg1,"trp_temp_array_b", "count"),
(assign,":acaps",0),
######Test CAPS
(try_begin),
(gt,reg1,10000), ##capital letter here
(assign,":acaps",1),
(val_sub,reg1,10000),
(try_end),
######Test end
(try_begin),
(eq,reg1,key_space),
(str_store_string,s10,"@{s10} "),
(else_try),
(eq,reg1,key_1),
(str_store_string,s10,"@{s10}1"),
(else_try),
(eq,reg1,key_2),
(str_store_string,s10,"@{s10}2"),
(else_try),
(eq,reg1,key_3),
(str_store_string,s10,"@{s10}3"),
(else_try),
(eq,reg1,key_4),
(str_store_string,s10,"@{s10}4"),
(else_try),
(eq,reg1,key_5),
(str_store_string,s10,"@{s10}5"),
(else_try),
(eq,reg1,key_6),
(str_store_string,s10,"@{s10}6"),
(else_try),
(eq,reg1,key_7),
(str_store_string,s10,"@{s10}7"),
(else_try),
(eq,reg1,key_,
(str_store_string,s10,"@{s10}8"),
(else_try),
(eq,reg1,key_9),
(str_store_string,s10,"@{s10}9"),
(else_try),
(eq,reg1,key_0),
(str_store_string,s10,"@{s10}0"),
(else_try),
(eq,reg1,key_a),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}A"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}a"),
(try_end),
(else_try),
(eq,reg1,key_b),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}B"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}b"),
(try_end),
(else_try),
(eq,reg1,key_c),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}C"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}c"),
(try_end),
(else_try),
(eq,reg1,key_d),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}D"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}d"),
(try_end),
(else_try),
(eq,reg1,key_e),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}E"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}e"),
(try_end),
(else_try),
(eq,reg1,key_f),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}F"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}F"),
(try_end),
(else_try),
(eq,reg1,key_g),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}G"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}g"),
(try_end),
(else_try),
(eq,reg1,key_h),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}H"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}h"),
(try_end),
(else_try),
(eq,reg1,key_i),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}I"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}i"),
(try_end),
(else_try),
(eq,reg1,key_j),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}J"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}j"),
(try_end),
(else_try),
(eq,reg1,key_k),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}K"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}k"),
(try_end),
(else_try),
(eq,reg1,key_l),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}L"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}l"),
(try_end),
(else_try),
(eq,reg1,key_m),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}M"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}m"),
(try_end),
(else_try),
(eq,reg1,key_n),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}N"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}n"),
(try_end),
(else_try),
(eq,reg1,key_o),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}O"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}o"),
(try_end),
(else_try),
(eq,reg1,key_p),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}P"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}p"),
(try_end),
(else_try),
(eq,reg1,key_q),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}Q"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}q"),
(try_end),
(else_try),
(eq,reg1,key_r),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}R"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}r"),
(try_end),
(else_try),
(eq,reg1,key_s),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}S"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}s"),
(try_end),
(else_try),
(eq,reg1,key_t),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}T"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}t"),
(try_end),
(else_try),
(eq,reg1,key_u),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}U"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}u"),
(try_end),
(else_try),
(eq,reg1,key_v),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}V"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}v"),
(try_end),
(else_try),
(eq,reg1,key_w),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}W"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}w"),
(try_end),
(else_try),
(eq,reg1,key_x),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}X"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}x"),
(try_end),
(else_try),
(eq,reg1,key_y),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}Y"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}y"),
(try_end),
(else_try),
(eq,reg1,key_z),
(try_begin),
(eq,":acaps",1),
(str_store_string,s10,"@{s10}Z"),
(else_try),
(eq,":acaps",0),
(str_store_string,s10,"@{s10}z"),
(try_end),
(try_end),
(try_end),
(display_message,"@the string is now:"),
(display_message,"@{s10}",0xfff000),
(assign, "$caps_on",0), ##Turn caps off after each letter
]
),
This is the dialog for the dialog box that tells the player how it works. I put this at the bottom of module_stirngs.py:
("texttype_mission_info","JIK's in game Text typer. Maximum 25 Characters.\
^In this scene you can type in letters (and spaces) to add to the string s10.\
^Press either shift key to toggle caps lock,^Press Delete key to erase the string\
^Press ENTER to display the current string. ^^ Press TAB to exit.\
^==Make sure to assign s10 to the item to be named at the end of this process=="
),
^In this scene you can type in letters (and spaces) to add to the string s10.\
^Press either shift key to toggle caps lock,^Press Delete key to erase the string\
^Press ENTER to display the current string. ^^ Press TAB to exit.\
^==Make sure to assign s10 to the item to be named at the end of this process=="
),
I used hareck in my tutorial to call it up with this dialog option:
[trp_hareck|plyr,"hareck_talk", [], "I wish to type a name", "close_window",
[
(set_visitor, 0, "trp_player"),
(set_visitor, 1, "$g_talk_troop"),
(set_jump_mission, "mt_type_out_words"),
(jump_to_scene, "scn_town_1_arena"),
]
],
[
(set_visitor, 0, "trp_player"),
(set_visitor, 1, "$g_talk_troop"),
(set_jump_mission, "mt_type_out_words"),
(jump_to_scene, "scn_town_1_arena"),
]
],
One more note to add. This is a presentation version of kit (on the second page of this thread). I'll link it here, so it doesn't get lost:
http://forums.taleworlds.com/index.php/topic,57775.msg1503015.html#msg1503015
(SIDE NOTE: in adding the string at the bottom, I noticed that I made the credits in the feedback section.. Woo hoo!)