Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Antonis said:
A question(which might have a very simple answer, but still it troubles me).
So, I finished making a mod, I playtested it for a while, all were fine. Recently, I added 3 items(3 arrows and their bags from the Spak OSP). They also worked fine. But, here is the problem: It seems like an item, a weapon or shield has a problem, because when I go to the arms merchant(not all of them, only to those that probably have the problematic item) the game crashes, It is frustrating. So, I am asking this: How can I find exactly which items is casuing this. I limited, as I said to weapons and shields. From what I saw, all bows are present and fine, same goes for crossbows, arros and bolts. So, it has to be one-handed, 2-handed, polearms or shields. Is there a crash log or sth that I can look and determine the problem?

I should mention that the game also crashes when I go to "take a walk around the streets", but the weapons of this faction work fine(tested them all after the issue), so it's not the guards. Townwalkers are unarmed, so they are cleared, too. Only the merchant stalls remain.

The cheat menu would be the quickest way to identify roughly what item was causing the problem, it displays the items in the order they come in in module items, scroll through the find item pages until you get to the one where it crashes. This will give you a rough idea of where the item is in module items, then have a look at module items to see if you can see any problems here.
 
Oh, man, thanks, I didn't thought of that. Silly me. I will check now and see what's wrong, thanks.

EDIT: Okay, I checked and I found what it was. An old item change of mine had a wrong mesh and that caused the crashes. I simply went back to Native(it was the pilgrim hoom which had an arrow mesh) and it all worked fine, checked again in the CHEATMENU, went to all the towns and arms merchants, all perfect. Thanks, Grandmaster, I'm in your debt. :grin:
 
Vornne said:
to convert it to a "weapon slot no" (starting from 1 - 4...)
That's what I was forgetting.

If there is no matching item existing in that slot (for agent_unequip_item)...nothing will happen.
I'm getting different behavior in this case. For example, I was removing ammo from ek_item_1, but forgot to add 1 to get the appropriate value, meaning it hit a mismatch (in weapon slot 1 instead of weapon slot 2). What happened was all ammo of that type was removed.
 
I was doing a presentation to set hotkeys and got a little problem here I wonder anyone knows how to fix:

Code:
Exporting scripts...
Traceback (most recent call last):
  File "process_scripts.py", line 40, in <module>
    save_scripts(variables,variable_uses,scripts,tag_uses,quick_strings)
  File "process_scripts.py", line 19, in save_scripts
    save_statement_block(file,convert_to_identifier(func[0]), 0,func[1], variabl
e_list,variable_uses,tag_uses,quick_strings)
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 449, in save_statement_block
    save_statement(ofile,opcode,no_variables,statement,variable_list,variable_us
es,local_vars, local_var_uses,tag_uses,quick_strings)
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 400, in save_statement
    operand = process_param(statement[i + 1],variable_list,variable_uses,local_v
ars_list,local_var_uses,tag_uses,quick_strings)
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 377, in process_param
    result = insert_quick_string_with_auto_id(param[1:], quick_strings)
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 356, in insert_quick_string_with_auto
_id
    while quick_strings.has_key(new_auto_id):
AttributeError: 'list' object has no attribute 'has_key'
Exporting mission_template data...
WARNING: Usage of unassigned global variable: $g_waiting_for_confirmation_to_ter
minateg_waiting_for_confirmation_to_terminate
Exporting game menus data...
Code:
	("lwbr_get_key_name",[
		(store_script_param_1,":key"),
		(try_begin),
			(eq,":key",key_1),
			(str_store_string,s1,"@1"),
		(else_try),
			(eq,":key",key_2),
			(str_store_string,s1,"@2"),
		(else_try),
			(eq,":key",key_3),
			(str_store_string,s1,"@3"),
		(else_try),
			(eq,":key",key_4),
			(str_store_string,s1,"@4"),
		(else_try),
			(eq,":key",key_5),
			(str_store_string,s1,"@5"),
		(else_try),
			(eq,":key",key_6),
			(str_store_string,s1,"@6"),
		(else_try),
			(eq,":key",key_7),
			(str_store_string,s1,"@7"),
		(else_try),
			(eq,":key",key_8),
			(str_store_string,s1,"@8"),
		(else_try),
			(eq,":key",key_9),
			(str_store_string,s1,"@9"),
		(else_try),
			(eq,":key",key_0),
			(str_store_string,s1,"@0"),
		(else_try),
			(eq,":key",key_a),
			(str_store_string,s1,"@A"),
		(else_try),
			(eq,":key",key_b),
			(str_store_string,s1,"@B"),
		(else_try),
			(eq,":key",key_c),
			(str_store_string,s1,"@C"),
		(else_try),
			(eq,":key",key_d),
			(str_store_string,s1,"@D"),
		(else_try),
			(eq,":key",key_e),
			(str_store_string,s1,"@E"),
		(else_try),
			(eq,":key",key_f),
			(str_store_string,s1,"@F"),
		(else_try),
			(eq,":key",key_g),
			(str_store_string,s1,"@G"),
		(else_try),
			(eq,":key",key_h),
			(str_store_string,s1,"@H"),
		(else_try),
			(eq,":key",key_i),
			(str_store_string,s1,"@I"),
		(else_try),
			(eq,":key",key_j),
			(str_store_string,s1,"@J"),
		(else_try),
			(eq,":key",key_k),
			(str_store_string,s1,"@K"),
		(else_try),
			(eq,":key",key_l),
			(str_store_string,s1,"@L"),
		(else_try),
			(eq,":key",key_m),
			(str_store_string,s1,"@M"),
		(else_try),
			(eq,":key",key_n),
			(str_store_string,s1,"@N"),
		(else_try),
			(eq,":key",key_o),
			(str_store_string,s1,"@O"),
		(else_try),
			(eq,":key",key_p),
			(str_store_string,s1,"@P"),
		(else_try),
			(eq,":key",key_q),
			(str_store_string,s1,"@Q"),
		(else_try),
			(eq,":key",key_r),
			(str_store_string,s1,"@R"),
		(else_try),
			(eq,":key",key_s),
			(str_store_string,s1,"@S"),
		(else_try),
			(eq,":key",key_t),
			(str_store_string,s1,"@T"),
		(else_try),
			(eq,":key",key_u),
			(str_store_string,s1,"@U"),
		(else_try),
			(eq,":key",key_v),
			(str_store_string,s1,"@V"),
		(else_try),
			(eq,":key",key_w),
			(str_store_string,s1,"@W"),
		(else_try),
			(eq,":key",key_x),
			(str_store_string,s1,"@X"),
		(else_try),
			(eq,":key",key_y),
			(str_store_string,s1,"@Y"),
		(else_try),
			(eq,":key",key_z),
			(str_store_string,s1,"@Z"),
		(else_try),
			(eq,":key",key_numpad_0),
			(str_store_string,s1,"@Numpad 0"),
		(else_try),
			(eq,":key",key_numpad_1),
			(str_store_string,s1,"@Numpad 1"),
		(else_try),
			(eq,":key",key_numpad_2),
			(str_store_string,s1,"@Numpad 2"),
		(else_try),
			(eq,":key",key_numpad_3),
			(str_store_string,s1,"@Numpad 3"),
		(else_try),
			(eq,":key",key_numpad_4),
			(str_store_string,s1,"@Numpad 4"),
		(else_try),
			(eq,":key",key_numpad_5),
			(str_store_string,s1,"@Numpad 5"),
		(else_try),
			(eq,":key",key_numpad_6),
			(str_store_string,s1,"@Numpad 6"),
		(else_try),
			(eq,":key",key_numpad_7),
			(str_store_string,s1,"@Numpad 7"),
		(else_try),
			(eq,":key",key_numpad_8),
			(str_store_string,s1,"@Numpad 8"),
		(else_try),
			(eq,":key",key_numpad_9),
			(str_store_string,s1,"@Numpad 9"),
		(else_try),
			(eq,":key",key_num_lock),
			(str_store_string,s1,"@Num Lock"),
		(else_try),
			(eq,":key",key_numpad_slash),
			(str_store_string,s1,"@Numpad /"),
		(else_try),
			(eq,":key",key_numpad_multiply),
			(str_store_string,s1,"@Numpad *"),
		(else_try),
			(eq,":key",key_numpad_minus),
			(str_store_string,s1,"@Numpad -"),
		(else_try),
			(eq,":key",key_numpad_plus),
			(str_store_string,s1,"@Numpad +"),
		(else_try),
			(eq,":key",key_numpad_enter),
			(str_store_string,s1,"@Numpad Enter"),
		(else_try),
			(eq,":key",key_numpad_period),
			(str_store_string,s1,"@Numpad ."),
		(else_try),
			(eq,":key",key_insert),
			(str_store_string,s1,"@Insert"),
		(else_try),
			(eq,":key",key_delete),
			(str_store_string,s1,"@Delete"),
		(else_try),
			(eq,":key",key_home),
			(str_store_string,s1,"@Home"),
		(else_try),
			(eq,":key",key_end),
			(str_store_string,s1,"@End"),
		(else_try),
			(eq,":key",key_page_up),
			(str_store_string,s1,"@Pg Up"),
		(else_try),
			(eq,":key",key_page_down),
			(str_store_string,s1,"@Pg Down"),
		(else_try),
			(eq,":key",key_up),
			(str_store_string,s1,"@Up Arrow"),
		(else_try),
			(eq,":key",key_down),
			(str_store_string,s1,"@Down Arrow"),
		(else_try),
			(eq,":key",key_left),
			(str_store_string,s1,"@Left Arrow"),
		(else_try),
			(eq,":key",key_right),
			(str_store_string,s1,"@Right Arrow"),
		(else_try),
			(eq,":key",key_f1),
			(str_store_string,s1,"@F1"),
		(else_try),
			(eq,":key",key_f2),
			(str_store_string,s1,"@F2"),
		(else_try),
			(eq,":key",key_f3),
			(str_store_string,s1,"@F3"),
		(else_try),
			(eq,":key",key_f4),
			(str_store_string,s1,"@F4"),
		(else_try),
			(eq,":key",key_f5),
			(str_store_string,s1,"@F5"),
		(else_try),
			(eq,":key",key_f6),
			(str_store_string,s1,"@F6"),
		(else_try),
			(eq,":key",key_f7),
			(str_store_string,s1,"@F7"),
		(else_try),
			(eq,":key",key_f8),
			(str_store_string,s1,"@F8"),
		(else_try),
			(eq,":key",key_f9),
			(str_store_string,s1,"@F9"),
		(else_try),
			(eq,":key",key_f10),
			(str_store_string,s1,"@F10"),
		(else_try),
			(eq,":key",key_f11),
			(str_store_string,s1,"@F11"),
		(else_try),
			(eq,":key",key_f12),
			(str_store_string,s1,"@F12"),
		(else_try),
			(eq,":key",key_space),
			(str_store_string,s1,"@Spacebar"),
		(else_try),
			(eq,":key",key_escape),
			(str_store_string,s1,"@Esc"),
		(else_try),
			(eq,":key",key_enter),
			(str_store_string,s1,"@Enter"),
		(else_try),
			(eq,":key",key_tab),
			(str_store_string,s1,"@Tab"),
		(else_try),
			(eq,":key",key_back_space),
			(str_store_string,s1,"@Backspace"),
		(else_try),
			(eq,":key",key_open_braces),
			(str_store_string,s1,"@ [ "),
		(else_try),
			(eq,":key",key_close_braces),
			(str_store_string,s1,"@ ] "),
		(else_try),
			(eq,":key",key_comma),
			(str_store_string,s1,"@ , "),
		(else_try),
			(eq,":key",key_period),
			(str_store_string,s1,"@ . "),
		(else_try),
			(eq,":key",key_slash),
			(str_store_string,s1,"@ / "),
		(else_try),
			(eq,":key",key_back_slash),
			(str_store_string,s1,"@ \ "),
		(else_try),
			(eq,":key",key_equals),
			(str_store_string,s1,"@ = "),
		(else_try),
			(eq,":key",key_minus),
			(str_store_string,s1,"@ - "),
		(else_try),
			(eq,":key",key_semicolon),
			(str_store_string,s1,"@ ; "),
		(else_try),
			(eq,":key",key_apostrophe),
			(str_store_string,s1,"@ ' "),
		(else_try),
			(eq,":key",key_tilde),
			(str_store_string,s1,"@ ~ "),
		(else_try),
			(eq,":key",key_caps_lock),
			(str_store_string,s1,"@Caps Lock"),
		(else_try),
			(eq,":key",key_left_shift),
			(str_store_string,s1,"@Left Shift"),
		(else_try),
			(eq,":key",key_right_shift),
			(str_store_string,s1,"@Right Shift"),
		(else_try),
			(eq,":key",key_left_control),
			(str_store_string,s1,"@Left Cntrl"),
		(else_try),
			(eq,":key",key_right_control),
			(str_store_string,s1,"@Right Cntrl"),
		(else_try),
			(eq,":key",key_left_alt),
			(str_store_string,s1,"@Left Alt"),
		(else_try),
			(eq,":key",key_right_alt),
			(str_store_string,s1,"@Right Alt"),
		(else_try),
			(eq,":key",key_left_mouse_button),
			(str_store_string,s1,"@Left Mouse Button"),
		(else_try),
			(eq,":key",key_right_mouse_button),
			(str_store_string,s1,"@Right Mouse Button"),
		(else_try),
			(eq,":key",key_middle_mouse_button),
			(str_store_string,s1,"@Middle Mouse Button"),
		(else_try),
			(eq,":key",key_mouse_button_4),
			(str_store_string,s1,"@Mouse Button 4"),
		(else_try),
			(eq,":key",key_mouse_button_5),
			(str_store_string,s1,"@Mouse Button 5"),
		(else_try),
			(eq,":key",key_mouse_button_6),
			(str_store_string,s1,"@Mouse Button 6"),
		(else_try),
			(eq,":key",key_mouse_button_7),
			(str_store_string,s1,"@Mouse Button 7"),
		(else_try),
			(eq,":key",key_mouse_button_8),
			(str_store_string,s1,"@Mouse Button 8"),
		(else_try),
			(eq,":key",key_mouse_scroll_up),
			(str_store_string,s1,"@Mouse Scroll Up"),
		(else_try),
			(eq,":key",key_mouse_scroll_down),
			(str_store_string,s1,"@Mouse Scroll Down"),
		(else_try),
			(eq,":key",key_xbox_a),
			(str_store_string,s1,"@xBox A"),
		(else_try),
			(eq,":key",key_xbox_b),
			(str_store_string,s1,"@xBox b"),
		(else_try),
			(eq,":key",key_xbox_x),
			(str_store_string,s1,"@xBox x"),
		(else_try),
			(eq,":key",key_xbox_y),
			(str_store_string,s1,"@xBox y"),
		(else_try),
			(eq,":key",key_xbox_dpad_up),
			(str_store_string,s1,"@d Pad Up"),
		(else_try),
			(eq,":key",key_xbox_dpad_down),
			(str_store_string,s1,"@d Pad Down"),
		(else_try),
			(eq,":key",key_xbox_dpad_right),
			(str_store_string,s1,"@xBox dPad Right"),
		(else_try),
			(eq,":key",key_xbox_dpad_left),
			(str_store_string,s1,"@xBox dPad Left"),
		(else_try),
			(eq,":key",key_xbox_start),
			(str_store_string,s1,"@xBox Start"),
		(else_try),
			(eq,":key",key_xbox_back),
			(str_store_string,s1,"@xBox Back"),
		(else_try),
			(eq,":key",key_xbox_rbumber),
			(str_store_string,s1,"@xBox Right Bumber"),
		(else_try),
			(eq,":key",key_xbox_lbumber),
			(str_store_string,s1,"@xBox Left Bumber "),
		(else_try),
			(eq,":key",key_xbox_ltrigger),
			(str_store_string,s1,"@xBox Right Trigger"),
		(else_try),
			(eq,":key",key_xbox_rtrigger),
			(str_store_string,s1,"@xBox Left Trigger"),
		(else_try),
			(eq,":key",key_xbox_rstick),
			(str_store_string,s1,"@xBox Right Stick"),
		(else_try),
			(eq,":key",key_xbox_lstick),
			(str_store_string,s1,"@xBox Left Stick"),
		(try_end),
		]),
Code:
	("lwbr_hotkey_assign", prsntf_manual_end_only, 0, [
		(ti_on_presentation_load, [
			(set_fixed_point_multiplier, 1000),
			(create_text_overlay, reg10, "@Press any key to set '{s10}'."),
				(position_set_x, pos1, 200),
				(position_set_y, pos1, 450),
				(overlay_set_position, reg1, pos1),
				(overlay_set_color, reg1, 0xf0371e),
			(presentation_set_duration, 999999),
			]),
		(ti_on_presentation_run,[
			(set_fixed_point_multiplier, 1000),
			(store_trigger_param_1, ":cur_time"),
			(assign,":end",1),
			(try_begin),
				(gt, ":cur_time", 200),
				(try_begin),
					(key_clicked, key_1),
					(assign,":key", key_1),
				(else_try),
					(key_clicked, key_2),
					(assign,":key", key_2),
				(else_try),
					(key_clicked, key_3),
					(assign,":key", key_3),
				(else_try),
					(key_clicked, key_4),
					(assign,":key", key_4),
				(else_try),
					(key_clicked, key_5),
					(assign,":key", key_5),
				(else_try),
					(key_clicked, key_6),
					(assign,":key", key_6),
				(else_try),
					(key_clicked, key_7),
					(assign,":key", key_7),
				(else_try),
					(key_clicked, key_8),
					(assign,":key", key_8),
				(else_try),
					(key_clicked, key_9),
					(assign,":key", key_9),
				(else_try),
					(key_clicked, key_0),
					(assign,":key", key_0),
				(else_try),
					(key_clicked, key_a),
					(assign,":key", key_a),
				(else_try),
					(key_clicked, key_b),
					(assign,":key", key_b),
				(else_try),
					(key_clicked, key_c),
					(assign,":key", key_c),
				(else_try),
					(key_clicked, key_d),
					(assign,":key", key_d),
				(else_try),
					(key_clicked, key_e),
					(assign,":key", key_e),
				(else_try),
					(key_clicked, key_f),
					(assign,":key", key_f),
				(else_try),
					(key_clicked, key_g),
					(assign,":key", key_g),
				(else_try),
					(key_clicked, key_h),
					(assign,":key", key_h),
				(else_try),
					(key_clicked, key_i),
					(assign,":key", key_i),
				(else_try),
					(key_clicked, key_j),
					(assign,":key", key_j),
				(else_try),
					(key_clicked, key_k),
					(assign,":key", key_k),
				(else_try),
					(key_clicked, key_l),
					(assign,":key", key_l),
				(else_try),
					(key_clicked, key_m),
					(assign,":key", key_m),
				(else_try),
					(key_clicked, key_n),
					(assign,":key", key_n),
				(else_try),
					(key_clicked, key_o),
					(assign,":key", key_o),
				(else_try),
					(key_clicked, key_p),
					(assign,":key", key_p),
				(else_try),
					(key_clicked, key_q),
					(assign,":key", key_q),
				(else_try),
					(key_clicked, key_r),
					(assign,":key", key_r),
				(else_try),
					(key_clicked, key_s),
					(assign,":key", key_s),
				(else_try),
					(key_clicked, key_t),
					(assign,":key", key_t),
				(else_try),
					(key_clicked, key_u),
					(assign,":key", key_u),
				(else_try),
					(key_clicked, key_v),
					(assign,":key", key_v),
				(else_try),
					(key_clicked, key_w),
					(assign,":key", key_w),
				(else_try),
					(key_clicked, key_x),
					(assign,":key", key_x),
				(else_try),
					(key_clicked, key_y),
					(assign,":key", key_y),
				(else_try),
					(key_clicked, key_z),
					(assign,":key", key_z),
				(else_try),
					(key_clicked, key_numpad_0),
					(assign,":key", key_numpad_0),
				(else_try),
					(key_clicked, key_numpad_1),
					(assign,":key", key_numpad_1),
				(else_try),
					(key_clicked, key_numpad_2),
					(assign,":key", key_numpad_2),
				(else_try),
					(key_clicked, key_numpad_3),
					(assign,":key", key_numpad_3),
				(else_try),
					(key_clicked, key_numpad_4),
					(assign,":key", key_numpad_4),
				(else_try),
					(key_clicked, key_numpad_5),
					(assign,":key", key_numpad_5),
				(else_try),
					(key_clicked, key_numpad_6),
					(assign,":key", key_numpad_6),
				(else_try),
					(key_clicked, key_numpad_7),
					(assign,":key", key_numpad_7),
				(else_try),
					(key_clicked, key_numpad_8),
					(assign,":key", key_numpad_8),
				(else_try),
					(key_clicked, key_numpad_9),
					(assign,":key", key_numpad_9),
				(else_try),
					(key_clicked, key_num_lock),
					(assign,":key", key_num_lock),
				(else_try),
					(key_clicked, key_numpad_slash),
					(assign,":key", key_numpad_slash),
				(else_try),
					(key_clicked, key_numpad_multiply),
					(assign,":key", key_numpad_multiply),
				(else_try),
					(key_clicked, key_numpad_minus),
					(assign,":key", key_numpad_minus),
				(else_try),
					(key_clicked, key_numpad_plus),
					(assign,":key", key_numpad_plus),
				(else_try),
					(key_clicked, key_numpad_enter),
					(assign,":key", key_numpad_enter),
				(else_try),
					(key_clicked, key_numpad_period),
					(assign,":key", key_numpad_period),
				(else_try),
					(key_clicked, key_insert),
					(assign,":key", key_insert),
				(else_try),
					(key_clicked, key_delete),
					(assign,":key", key_delete),
				(else_try),
					(key_clicked, key_home),
					(assign,":key", key_home),
				(else_try),
					(key_clicked, key_end),
					(assign,":key", key_end),
				(else_try),
					(key_clicked, key_page_up),
					(assign,":key", key_page_up),
				(else_try),
					(key_clicked, key_page_down),
					(assign,":key", key_page_down),
				(else_try),
					(key_clicked, key_up),
					(assign,":key", key_up),
				(else_try),
					(key_clicked, key_down),
					(assign,":key", key_down),
				(else_try),
					(key_clicked, key_left),
					(assign,":key", key_left),
				(else_try),
					(key_clicked, key_right),
					(assign,":key", key_right),
				(else_try),
					(key_clicked, key_f1),
					(assign,":key", key_f1),
				(else_try),
					(key_clicked, key_f2),
					(assign,":key", key_f2),
				(else_try),
					(key_clicked, key_f3),
					(assign,":key", key_f3),
				(else_try),
					(key_clicked, key_f4),
					(assign,":key", key_f4),
				(else_try),
					(key_clicked, key_f5),
					(assign,":key", key_f5),
				(else_try),
					(key_clicked, key_f6),
					(assign,":key", key_f6),
				(else_try),
					(key_clicked, key_f7),
					(assign,":key", key_f7),
				(else_try),
					(key_clicked, key_f8),
					(assign,":key", key_f8),
				(else_try),
					(key_clicked, key_f9),
					(assign,":key", key_f9),
				(else_try),
					(key_clicked, key_f10),
					(assign,":key", key_f10),
				(else_try),
					(key_clicked, key_f11),
					(assign,":key", key_f11),
				(else_try),
					(key_clicked, key_f12),
					(assign,":key", key_f12),
				(else_try),
					(key_clicked, key_space),
					(assign,":key", key_space),
				(else_try),
					(key_clicked, key_escape),
					(assign,":key", key_escape),
				(else_try),
					(key_clicked, key_enter),
					(assign,":key", key_enter),
				(else_try),
					(key_clicked, key_tab),
					(assign,":key", key_tab),
				(else_try),
					(key_clicked, key_back_space),
					(assign,":key", key_back_space),
				(else_try),
					(key_clicked, key_open_braces),
					(assign,":key", key_open_braces),
				(else_try),
					(key_clicked, key_close_braces),
					(assign,":key", key_close_braces),
				(else_try),
					(key_clicked, key_comma),
					(assign,":key", key_comma),
				(else_try),
					(key_clicked, key_period),
					(assign,":key", key_period),
				(else_try),
					(key_clicked, key_slash),
					(assign,":key", key_slash),
				(else_try),
					(key_clicked, key_back_slash),
					(assign,":key", key_back_slash),
				(else_try),
					(key_clicked, key_equals),
					(assign,":key", key_equals),
				(else_try),
					(key_clicked, key_minus),
					(assign,":key", key_minus),
				(else_try),
					(key_clicked, key_semicolon),
					(assign,":key", key_semicolon),
				(else_try),
					(key_clicked, key_apostrophe),
					(assign,":key", key_apostrophe),
				(else_try),
					(key_clicked, key_tilde),
					(assign,":key", key_tilde),
				(else_try),
					(key_clicked, key_caps_lock),
					(assign,":key", key_caps_lock),
				(else_try),
					(key_clicked, key_left_shift),
					(assign,":key", key_left_shift),
				(else_try),
					(key_clicked, key_right_shift),
					(assign,":key", key_right_shift),
				(else_try),
					(key_clicked, key_left_control),
					(assign,":key", key_left_control),
				(else_try),
					(key_clicked, key_right_control),
					(assign,":key", key_right_control),
				(else_try),
					(key_clicked, key_left_alt),
					(assign,":key", key_left_alt),
				(else_try),
					(key_clicked, key_right_alt),
					(assign,":key", key_right_alt),
				(else_try),
					(key_clicked, key_left_mouse_button),
					(assign,":key", key_left_mouse_button),
				(else_try),
					(key_clicked, key_right_mouse_button),
					(assign,":key", key_right_mouse_button),
				(else_try),
					(key_clicked, key_middle_mouse_button),
					(assign,":key", key_middle_mouse_button),
				(else_try),
					(key_clicked, key_mouse_button_4),
					(assign,":key", key_mouse_button_4),
				(else_try),
					(key_clicked, key_mouse_button_5),
					(key_mouse_button_5),
				(else_try),
					(key_clicked, key_mouse_button_6),
					(assign,":key", key_mouse_button_6),
				(else_try),
					(key_clicked, key_mouse_button_7),
					(assign,":key", key_mouse_button_7),
				(else_try),
					(key_clicked, key_mouse_button_8),
					(assign,":key", key_mouse_button_8),
				(else_try),
					(key_clicked, key_mouse_scroll_up),
					(assign,":key", key_mouse_scroll_up),
				(else_try),
					(key_clicked, key_mouse_scroll_down),
					(assign,":key", key_mouse_scroll_down),
				(else_try),
					(key_clicked, key_xbox_a),
					(assign,":key", key_xbox_a),
				(else_try),
					(key_clicked, key_xbox_b),
					(assign,":key", key_xbox_b),
				(else_try),
					(key_clicked, key_xbox_x),
					(assign,":key", key_xbox_x),
				(else_try),
					(key_clicked, key_xbox_y),
					(assign,":key", key_xbox_y),
				(else_try),
					(key_clicked, key_xbox_dpad_up),
					(assign,":key", key_xbox_dpad_up),
				(else_try),
					(key_clicked, key_xbox_dpad_down),
					(assign,":key", key_xbox_dpad_down),
				(else_try),
					(key_clicked, key_xbox_dpad_right),
					(assign,":key", key_xbox_dpad_right),
				(else_try),
					(key_clicked, key_xbox_dpad_left),
					(assign,":key", key_xbox_dpad_left),
				(else_try),
					(key_clicked, key_xbox_start),
					(assign,":key", key_xbox_start),
				(else_try),
					(key_clicked, key_xbox_back),
					(assign,":key", key_xbox_back),
				(else_try),
					(key_clicked, key_xbox_rbumber),
					(assign,":key", key_xbox_rbumber),
				(else_try),
					(key_clicked, key_xbox_lbumber),
					(assign,":key", key_xbox_lbumber),
				(else_try),
					(key_clicked, key_xbox_ltrigger),
					(assign,":key", key_xbox_ltrigger),
				(else_try),
					(key_clicked, key_xbox_rtrigger),
					(assign,":key", key_xbox_rtrigger),
				(else_try),
					(key_clicked, key_xbox_rstick),
					(assign,":key", key_xbox_rstick),
				(else_try),
					(key_clicked, key_xbox_lstick),
					(assign,":key", key_xbox_lstick),
				(else_try),
					(assign,":end",0),
				(try_end),
				(eq,":end", 1),
				(try_begin),
					(eq, reg1, 1),
					(assign, "$g_hk_wf_menu",":key"),
				(else_try),
					(eq, reg1, 2),
					(assign, "$g_hk_cheer",":key"),
				(else_try),
					(eq, reg1, 3),
					(assign, "$g_hk_taunt",":key"),
				(else_try),
					(eq, reg1, 4),
					(assign, "$g_hk_jump_from_horse",":key"),
				(else_try),
					(eq, reg1, 101),
					(assign, "$g_hk_adm_chat",":key"),
				(try_end),
				(presentation_set_duration, 0),
				(start_presentation,"prsnt_lwbr_set_hotkeys"),
			(try_end),
			]),
		]),

does anyone know how to fix it?
 
Haven't got time to analyze it properly right now, but at a glance it seems compiler got a bug which only fires when processing quick strings that are "normalized" to the identical identifiers, or something along these lines. Try using normal strings instead of quick strings, that should solve the problem for the moment.
 
Nah, strings are fine. True, backslash should have been a double backslash, but that's a purely visual bug - player will see empty space where he should have seen a backslash, but the code will run without issues. And this doesn't cancel the fact that the Warband compiler is trying to run a .has_key() method on a list, which is a bug however you look at it. That it has gone undiscovered for so long means that the situation is extremely obscure but still something Taleworlds devs considered when building the compiler - they just didn't ever experience it themselves to detect the problem. :smile:

And it seems I was right on money yesterday: this bug indeed only appears when there are enough quick strings with identical identifiers, which may happen for either really short quick strings (especially those that contain only spaces and punctuation but no actual characters), or really long ones with identical first 20 characters.

To fix the bug, edit process_operations.py and change the insert_quick_string_with_auto_id definition with the following:

Code:
def insert_quick_string_with_auto_id(sentence,quick_strings):
  index = 0
  text = convert_to_identifier_with_no_lowercase(sentence)
  sentence = replace_spaces(sentence)
  done = 0
  i = 20
  lt = len(text)
  if (i > lt):
    i  = lt
  auto_id = "qstr_" + text[0:i]
  done = 0
  index = search_quick_string_keys(auto_id, quick_strings)
  if index >= 0 and (quick_strings[index][1] == sentence):
    done = 1
  while (i <= lt) and not done:
    auto_id = "qstr_" + text[0:i]
    index = search_quick_string_keys(auto_id, quick_strings)
    if index >= 0:
      if quick_strings[index][1] == sentence:
        done = 1
      else:
        i += 1
    else:      
      done = 1
      index = len(quick_strings)
      quick_strings.append([auto_id, sentence])
  if not done:
[color=red]    #ORIGINAL BUGGED CODE (commented out):
    #number = 1
    #new_auto_id = auto_id + str(number)
    #while quick_strings.has_key(new_auto_id):
    #  number += 1
    #  new_auto_id = auto_id + str(number)
    #auto_id = new_auto_id
    #index = len(quick_strings)
    #quick_strings.append([auto_id, sentence])[/color]
[color=green]    #FIXED CODE:
    number = 0
    while not done:
      number += 1
      new_auto_id = '%s%d' % (auto_id, number)
      index = search_quick_string_keys(new_auto_id, quick_strings)
      if index >= 0:
        done = quick_strings[index][1] == sentence
      else:
        done = 1
        index = len(quick_strings)
        quick_strings.append([new_auto_id, sentence])[/color]
  return index

UPDATE: fixed a small typo.
 
Hi.Is there have an operation of player take a control of someone's party as controls itself ? Because,im making a reign system.When my first character is dead,my son's party will active,and my party will inactive.also,my son's party will take an control all of my kingdom.And,The player will take an control of my sons party.

Is it possible ? or just an imagine ?  :smile:
 
There are too many checks for "p_main_party" and "trp_player" in the code for that to be feasible.

You can copy the party you want into "p_main_party", rename the main party and remove son's original party to maintain consistency. You can also change player's name, attributes and skills, but not level or face. So there are restrictions, unless you're planning to engage in massive hacking, replacing player's agent everywhere with son's agent and handling all the issues arising from that.

To summarize: technically possible, but for as long as you base your work on existing codebase (i.e. Native module), the amount of required fixes might get comparable to developing a major mod from scratch. :smile:
 
Lav said:
There are too many checks for "p_main_party" and "trp_player" in the code for that to be feasible.

You can copy the party you want into "p_main_party", rename the main party and remove son's original party to maintain consistency. You can also change player's name, attributes and skills, but not level or face. So there are restrictions, unless you're planning to engage in massive hacking, replacing player's agent everywhere with son's agent and handling all the issues arising from that.

To summarize: technically possible, but for as long as you base your work on existing codebase (i.e. Native module), the amount of required fixes might get comparable to developing a major mod from scratch. :smile:

Wow.Should i add an operation of make party's template as "p_main_party" ? it maybe not necessary for checks the p_main_party fixes ?

Edit;Also,i think in the python Script topic,or the open source code forum,should be have an "change party template (in the game ?)" code.

And,you meaning,it is possible.But,very very takes a long time.I need make shortly this thing :grin:
 
HyperCharge said:
Wow.Should i add an operation of make party's template as "p_main_party" ? it maybe not necessary for checks the p_main_party fixes?

Edit;Also,i think in the python Script topic,or the open source code forum,should be have an "change party template (in the game ?)" code.
"p_main_party" does not have a template. It is a unique party that is treated differently by both the engine and module code. You can change the latter (the amount of work necessary is the question though) but you can only do so much with engine assumptions and limitations.

So essentially, you won't get anything by changing it's template. It is not treated differently because it has some special template, it is treated differently because it is the main party, period.
 
Lav said:
HyperCharge said:
Wow.Should i add an operation of make party's template as "p_main_party" ? it maybe not necessary for checks the p_main_party fixes?

Edit;Also,i think in the python Script topic,or the open source code forum,should be have an "change party template (in the game ?)" code.
"p_main_party" does not have a template. It is a unique party that is treated differently by both the engine and module code. You can change the latter (the amount of work necessary is the question though) but you can only do so much with engine assumptions and limitations.

So essentially, you won't get anything by changing it's template. It is not treated differently because it has some special template, it is treated differently because it is the main party, period.

You meaning should i edit the engine ? wow.Thats too hard.But,i think should be have an "control the party" operation.I should saw in your operations guide :smile:
 
You could store the current player troop into a separate global variable, replace all "trp_player"s with it and start all over, but I'm not sure if all player-related operations work the same even when the player troop is different from trp_player.
 
HyperCharge said:
You meaning should i edit the engine ? wow.Thats too hard.But,i think should be have an "control the party" operation.I should saw in your operations guide :smile:
No you didn't. What you probably saw is "lock camera on some other party" operation. In Native it is used when player is taken captive by some other party. But this operation does not allow the player to control that party. Quite the opposite, it completely disables nearly all player's controls.
 
Lav said:
Nah, strings are fine. True, backslash should have been a double backslash, but that's a purely visual bug - player will see empty space where he should have seen a backslash, but the code will run without issues. And this doesn't cancel the fact that the Warband compiler is trying to run a .has_key() method on a list, which is a bug however you look at it. That it has gone undiscovered for so long means that the situation is extremely obscure but still something Taleworlds devs considered when building the compiler - they just didn't ever experience it themselves to detect the problem. :smile:

And it seems I was right on money yesterday: this bug indeed only appears when there are enough quick strings with identical identifiers, which may happen for either really short quick strings (especially those that contain only spaces and punctuation but no actual characters), or really long ones with identical first 20 characters.

To fix the bug, edit process_operations.py and change the insert_quick_string_with_auto_id definition with the following:

[tt]
Code:
def insert_quick_string_with_auto_id(sentence,quick_strings):
  index = 0
  text = convert_to_identifier_with_no_lowercase(sentence)
  sentence = replace_spaces(sentence)
  done = 0
  i = 20
  lt = len(text)
  if (i > lt):
    i  = lt
  auto_id = "qstr_" + text[0:i]
  done = 0
  index = search_quick_string_keys(auto_id, quick_strings)
  if index >= 0 and (quick_strings[index][1] == sentence)
    done = 1
  while (i <= lt) and not done:
    auto_id = "qstr_" + text[0:i]
    index = search_quick_string_keys(auto_id, quick_strings)
    if index >= 0:
      if quick_strings[index][1] == sentence:
        done = 1
      else:
        i += 1
    else:      
      done = 1
      index = len(quick_strings)
      quick_strings.append([auto_id, sentence])
  if not done:
    #ORIGINAL BUGGED CODE (commented out):
    #number = 1
    #new_auto_id = auto_id + str(number)
    #while quick_strings.has_key(new_auto_id):
    #  number += 1
    #  new_auto_id = auto_id + str(number)
    #auto_id = new_auto_id
    #index = len(quick_strings)
    #quick_strings.append([auto_id, sentence])
    #FIXED CODE:
    number = 0
    while not done:
      number += 1
      new_auto_id = '%s%d' % (auto_id, number)
      index = search_quick_string_keys(new_auto_id, quick_strings)
      if index >= 0:
        done = quick_strings[index][1] == sentence
      else:
        done = 1
        index = len(quick_strings)
        quick_strings.append([new_auto_id, sentence])
  return index

UPDATE: fixed a small typo.
Somebody said:
Probably this part
Code:
					(key_clicked, key_mouse_button_5),
					(key_mouse_button_5),
Also check the strings themselves, some are special string characters (most notably the slashes).
ty both for the help, I would never be able to fix it if I was left to do it myself cuz I never mess with the process_* files
I'll also try to release a few things I''ve been working on lately, it's nice to come back to modding :grin:

edit: it seems like it didn't work so well Lav, I'm now getting a spam of this error when I compile:
Code:
Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_global_variables.py", line 12, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 66, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 6, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 7, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "E:\Disco D\Dropbox\1\Dropbox\Module_System\WB\1.158\WB_1.158_LWBR\Module
_system 1.158\process_operations.py", line 339
    if index >= 0 and (quick_strings[index][1] == sentence)
                                                          ^
SyntaxError: invalid syntax
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

edit2: it seems like using your mod sys compiller fixed it, as well as revealing a few native derps  :lol:
 
Ikaguia said:
edit: it seems like it didn't work so well Lav, I'm now getting a spam of this error when I compile:
Damn, seems I accidentally removed a colon where I shouldn't have. Sorry. :sad:

This is the correct text. I marked the missing colon with blue - it was there in vanilla code and is still there in my copy of process_operations.py but apparently somehow disappeared in my forum post. Probably my finger slipped for a second. :smile:

Code:
def insert_quick_string_with_auto_id(sentence,quick_strings):
  index = 0
  text = convert_to_identifier_with_no_lowercase(sentence)
  sentence = replace_spaces(sentence)
  done = 0
  i = 20
  lt = len(text)
  if (i > lt):
    i  = lt
  auto_id = "qstr_" + text[0:i]
  done = 0
  index = search_quick_string_keys(auto_id, quick_strings)
  if index >= 0 and (quick_strings[index][1] == sentence)[color=blue]:[/color] [color=grey]# <-- yep, here's the culprit[/color]
    done = 1
  while (i <= lt) and not done:
    auto_id = "qstr_" + text[0:i]
    index = search_quick_string_keys(auto_id, quick_strings)
    if index >= 0:
      if quick_strings[index][1] == sentence:
        done = 1
      else:
        i += 1
    else:      
      done = 1
      index = len(quick_strings)
      quick_strings.append([auto_id, sentence])
  if not done:
[color=red]    #ORIGINAL BUGGED CODE (commented out):
    #number = 1
    #new_auto_id = auto_id + str(number)
    #while quick_strings.has_key(new_auto_id):
    #  number += 1
    #  new_auto_id = auto_id + str(number)
    #auto_id = new_auto_id
    #index = len(quick_strings)
    #quick_strings.append([auto_id, sentence])[/color]
[color=green]    #FIXED CODE:
    number = 0
    while not done:
      number += 1
      new_auto_id = '%s%d' % (auto_id, number)
      index = search_quick_string_keys(new_auto_id, quick_strings)
      if index >= 0:
        done = quick_strings[index][1] == sentence
      else:
        done = 1
        index = len(quick_strings)
        quick_strings.append([new_auto_id, sentence])[/color]
  return index
 
Status
Not open for further replies.
Back
Top Bottom