Diplomacy for 1.174

Users who are viewing this thread

Certainly, I just checked the menu in the debugging options.
My comment/criticism was general, I wasn't talking about Diplomacy in particular, although I see the system you have implemented to change variables is very pertinent.
 
Hello Somebody,

I couldn't decide whether to ask for help here or "Modding Q&A". But since I tried to add a feature to Diplomacy mod, I decided to ask for help here. I hope I'm not doing anything wrong.

I am trying to add option to turn on/off via "Diplomacy Preferences" presentation of below code.
Code:
        (try_begin),
          (gt, ":cur_time", 200),
          (game_key_clicked, gk_view_orders),
          (try_for_agents, ":cur_agent"),
            (agent_set_slot, ":cur_agent", slot_agent_map_overlay_id, 0),
          (try_end),
          (presentation_set_duration, 0),
		  ## BEGIN + TROOP RATIO BAR, BATTLE MINI MAP & PERSONAL KILL COUNT 
		  (try_begin),
			  (this_or_next|eq, "$enable_troop_ratio_bar"),
			  (this_or_next|eq, "$enable_battle_minimap"),
			  (eq, "$enable_killcount"),
		      (start_presentation, "prsnt_combat_ui"),
		  (try_end),
		  ## END - TROOP RATIO BAR, BATTLE MINI MAP & PERSONAL KILL COUNT 
        (try_end),
Code:
############################################################################################
### BEGIN + TROOP RATIO BAR, BATTLE MINI MAP & PERSONAL KILL COUNT by Rubik, Windyplains & Artam
############################################################################################
  ("combat_ui",prsntf_read_only,0,[
	  (ti_on_presentation_load,
	   [
		(assign, "$presentation_combat_ui"),
		(set_fixed_point_multiplier, 1000),
		
		## BEGIN + ADD TROOP RATIO BAR TO THE COMBAT UI PRESENTATION
		(try_begin),
			(eq, "$enable_troop_ratio_bar"),
			
			(position_set_x, pos1, 380), # Original value is 35
			(position_set_y, pos1, 735),# Original value is 713
			
			(create_mesh_overlay, "$g_presentation_obj_1", "mesh_white_plane"),
			(overlay_set_color, "$g_presentation_obj_1", 0xAA1F1F),
			(overlay_set_position, "$g_presentation_obj_1", pos1),
			
			(create_mesh_overlay, "$g_presentation_obj_2", "mesh_white_plane"),
			(overlay_set_color, "$g_presentation_obj_2", 0x1F1FAA),
			(overlay_set_position, "$g_presentation_obj_2", pos1),
			
			(create_mesh_overlay, "$g_presentation_obj_3", "mesh_white_plane"),
			(overlay_set_color, "$g_presentation_obj_3", 0x1FAA1F),
			(overlay_set_position, "$g_presentation_obj_3", pos1),
		(try_end),
		## END - ADD TROOP RATIO BAR TO THE COMBAT UI PRESENTATION
		
		## BEGIN + ADD BATTLE MAP TO THE COMBAT UI PRESENTATION by Windyplains
		(try_begin),
			(eq, "$enable_battle_minimap"),
			
			## Clean out battle mini-map overlay ID's.
			(try_for_agents, ":agent_no"),
				(agent_set_slot, ":agent_no", slot_agent_map_overlay_id, 0),
			(try_end),
			
			(get_scene_boundaries, pos2, pos3),
			(position_transform_position_to_local, pos4, pos2, pos3),
			(set_fixed_point_multiplier, 1000),
			(position_get_x, ":map_width", pos4),
			(position_get_y, ":map_height", pos4),
			(set_fixed_point_multiplier, 1000),
			(store_div, ":map_ratio", ":map_height", 100),
			(store_div, ":map_ratio", ":map_width", ":map_ratio"),
			(try_begin),
			  (gt, ":map_ratio", 100),
			  (assign, "$g_battle_map_width", 150),
			  (store_div, "$g_battle_map_scale", ":map_width", "$g_battle_map_width"),
			  (store_div, "$g_battle_map_height", ":map_height", "$g_battle_map_scale"),
			(else_try),
			  (assign, "$g_battle_map_height", 150),
			  (store_div, "$g_battle_map_scale", ":map_height", "$g_battle_map_height"),
			  (store_div, "$g_battle_map_width", ":map_width", "$g_battle_map_scale"),
			(try_end),
			
			(create_image_button_overlay, "$g_battle_map_plane", "mesh_white_plane", "mesh_white_plane"),
			(overlay_set_color, "$g_battle_map_plane", 0),
			(store_add, ":map_bordered_width", "$g_battle_map_width", 20),
			(store_add, ":map_bordered_height", "$g_battle_map_height", 20),
			(store_mul, ":map_scale_x", ":map_bordered_width", 50),
			(store_mul, ":map_scale_y", ":map_bordered_height", 50),
			(position_set_x, pos1, ":map_scale_x"),
			(position_set_y, pos1, ":map_scale_y"),
			(overlay_set_size, "$g_battle_map_plane", pos1),
			(store_sub, ":map_pos_x", 990, ":map_bordered_width"),
			(store_sub, ":map_pos_y", 740, ":map_bordered_height"),
			(position_set_x, pos1, ":map_pos_x"),
			(position_set_y, pos1, ":map_pos_y"),
			(overlay_set_position, "$g_battle_map_plane", pos1),
			(overlay_set_alpha, "$g_battle_map_plane", 0x80),
		(try_end),
		## END - ADD BATTLE MAP TO THE COMBAT UI PRESENTATION
		
		## BEGIN + ADD PERSONAL KILL COUNT TO THE COMBAT UI PRESENTATION by Artam
		(try_begin),
			(eq, "$enable_killcount"),
			
			(create_mesh_overlay, "$g_presentation_obj_4", "mesh_white_plane"),
			(overlay_set_color, "$g_presentation_obj_4", 0x000000),
			(overlay_set_alpha, "$g_presentation_obj_4", 0x80),
			(position_set_x, pos1, 4200),
			(position_set_y, pos1, 1700),
			(overlay_set_size, "$g_presentation_obj_4", pos1),
			(position_set_x, pos1, 0),
			(position_set_y, pos1, 707),
			(overlay_set_position, "$g_presentation_obj_4", pos1),

			(create_text_overlay, "$g_presentation_obj_5", s1, tf_with_outline|tf_left_align),
			(overlay_set_color, "$g_presentation_obj_5", 0xFFFFFF),
			(overlay_set_position, "$g_presentation_obj_5", pos1),
		(try_end),
		## END - ADD PERSONAL KILL COUNT TO THE COMBAT UI PRESENTATION
		
		(presentation_set_duration, 999999),
	   ]),
	   
	  (ti_on_presentation_run,
	   [
		## TROOP RATIO BAR +
		(try_begin),
			(eq, "$enable_troop_ratio_bar"),
				(store_trigger_param_1, ":cur_time"),
				
				(set_fixed_point_multiplier, 1000),
				(assign, ":player_count", 0),
				(assign, ":ally_count", 0),
				(assign, ":enemy_count", 0),
				(assign, ":total_count", 0),
				
				(try_for_agents, ":cur_agent"),
				  (agent_is_human, ":cur_agent"),
				  (agent_is_alive, ":cur_agent"),
				  (agent_get_party_id, ":agent_party", ":cur_agent"),
				  (try_begin),
					(eq, ":agent_party", "p_main_party"),
					(val_add, ":player_count", 1),
				  (else_try),
					(agent_is_ally, ":cur_agent"),
					(val_add, ":ally_count", 1),
				  (else_try),
					(val_add, ":enemy_count", 1),
				  (try_end),
				(try_end),
				(val_add, ":total_count", ":player_count"),
				(val_add, ":total_count", ":ally_count"),
				(val_add, ":total_count", ":enemy_count"),
				
				(position_set_x, pos1, 12000),
				(position_set_y, pos1, 300),
				(overlay_set_size, "$g_presentation_obj_1", pos1),
				
				(store_add, ":ally_percent", ":player_count", ":ally_count"),
				(val_mul, ":ally_percent", 12000),
				(val_div, ":ally_percent", ":total_count"),
				(position_set_x, pos1, ":ally_percent"),
				(position_set_y, pos1, 300),
				(overlay_set_size, "$g_presentation_obj_2", pos1),
				
				(store_mul, ":player_percent", ":player_count", 12000),
				(val_div, ":player_percent", ":total_count"),
				(position_set_x, pos1, ":player_percent"),
				(position_set_y, pos1, 300),
				(overlay_set_size, "$g_presentation_obj_3", pos1),
				
				(store_add, ":ally_percent_2", ":player_count", ":ally_count"),
				(val_mul, ":ally_percent_2", 240),
				(val_div, ":ally_percent_2", ":total_count"),
				(val_add, ":ally_percent_2", 35),
				(position_set_x, pos1, ":ally_percent_2"),
				(position_set_y, pos1, 700),
				
				(store_mul, ":player_percent_2", ":player_count", 240),
				(val_div, ":player_percent_2", ":total_count"),
				(val_add, ":player_percent_2", 35),
				(position_set_x, pos1, ":player_percent_2"),
				(position_set_y, pos1, 700),
		(try_end),
		## TROOP RATIO BAR -
		
		## BATTLE MAP +
		(try_begin),
			(eq, "$enable_battle_minimap"),
			
			(get_scene_boundaries, pos2, pos3),
			
			(try_for_agents,":cur_agent"),
				(agent_is_human, ":cur_agent"),
				(agent_get_party_id, ":agent_party", ":cur_agent"),
				(agent_get_slot, ":agent_overlay", ":cur_agent", slot_agent_map_overlay_id),
				(try_begin),
					(eq, ":agent_party", "p_main_party"),
					(try_begin),
						(agent_is_alive, ":cur_agent"),
						(call_script, "script_update_agent_position_on_map", ":cur_agent"),          
					(else_try),
						### WINDYPLAINS+ ### - Done to prevent object #0 agents erasing object #0 (troop ratio bar background)
						(neq, ":agent_overlay", 0),
						### WINDYPLAINS- ###
						(overlay_set_alpha, ":agent_overlay", 0),
					(try_end),
				(else_try),
					(agent_is_ally, ":cur_agent"),
					(try_begin),
						(agent_is_alive, ":cur_agent"),
						(call_script, "script_update_agent_position_on_map", ":cur_agent"),
					(else_try),
						### WINDYPLAINS+ ### - Done to prevent object #0 agents erasing object #0 (troop ratio bar background)
						(neq, ":agent_overlay", 0),
						### WINDYPLAINS- ###
						(overlay_set_alpha, ":agent_overlay", 0),
					(try_end),
				(else_try),
					(try_begin),
						(agent_is_alive, ":cur_agent"),
						(call_script, "script_update_agent_position_on_map", ":cur_agent"),
					(else_try),
						### WINDYPLAINS+ ### - Done to prevent object #0 agents erasing object #0 (troop ratio bar background)
						(neq, ":agent_overlay", 0),
						### WINDYPLAINS- ###
						(overlay_set_alpha, ":agent_overlay", 0),
					(try_end),
				(try_end),
			(try_end),
		(try_end),
		## BATTLE MAP -
		
		## PERSONAL KILL COUNT +
		(try_begin),
			(eq, "$enable_killcount"),
			
			(get_player_agent_no, ":player_agent"),
			(agent_get_kill_count, reg1, ":player_agent", 1),           #SupaNinjaMan
			(agent_get_kill_count, ":kill_count", ":player_agent"),     #SupaNinjaMan
			(agent_get_kill_count, ":wound_count", ":player_agent", 1), #SupaNinjaMan
			(store_add, reg1, ":kill_count", ":wound_count"),
			(str_store_string, s1, "@{reg1} kills"),
			(overlay_set_text, "$g_presentation_obj_5", s1),
		(try_end),
		## PERSONAL KILL COUNT -
		
		(try_begin),
		  (eq, "$presentation_combat_ui"),
		  (gt, ":cur_time", 200),
		  (game_key_clicked, gk_view_orders),
		  (start_presentation, "prsnt_battle"),
		(try_end),
	   ]),
	 ]),
############################################################################################
### END - TROOP RATIO BAR, BATTLE MINI MAP & PERSONAL KILL COUNT
############################################################################################
Code:
      common_battle_order_panel,
      common_battle_order_panel_tick,
      (0, 0, ti_once, [], [(start_presentation, "prsnt_combat_ui")]),
FYI the code does this (kill counter, troop ratio bar, and mini map)

I added these codes to "Diplomacy Preferences".
I've add ## TROOP RATIO BAR, "## BATTLE MINI MAP" & "## PERSONAL KILLCOUNT" before  "## CHEAT MENU" example below.
Code:
				## TROOP RATIO BAR
					(create_text_overlay, reg0, "@Troop Ratio Bar:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(val_sub, ":texts_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					
					(try_begin),
						(eq, "$enable_troop_ratio_bar", 0),
						(assign, ":actual_input_value", 1),
					(else_try),
						(assign, ":actual_input_value", 0),
					(try_end),
					(overlay_set_val, reg0, ":actual_input_value"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_wounded"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos4),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					(set_container_overlay, ":container"),

In "## "RESET" BUTTON KILL THE PRESENTATION AND START ANOTHER ONE" section.
Code:
						(assign, "$enable_troop_ratio_bar", 0),
						(assign, "$enable_battle_minimap", 0),
						(assign, "$enable_killcount", 0),
In "## "SAVE AND EXIT" BUTTON GETS THE OPTION VALUES AND GIVE THEM TO PROPER VARIABLES. THEN IT KILLS THE PRESENTATION." section.

Code:
					(else_try), ## TROOP RATIO BAR
						(troop_slot_eq, "trp_temp_array_b", 11, ":object"),
						(assign, "$enable_troop_ratio_bar", ":value"),
					(else_try), ## BATTLE MINI MAP
						(troop_slot_eq, "trp_temp_array_b", 12, ":object"),
						(assign, "$enable_battle_minimap", ":value"),
					(else_try), ## PERSONAL KILLCOUNT
						(troop_slot_eq, "trp_temp_array_b", 13, ":object"),
						(assign, "$enable_killcount", ":value"),
					(else_try), ## CHEATS MENU
						(troop_slot_eq, "trp_temp_array_b", 14, ":object"),
						(assign, "$cheat_mode", ":value"),
					(try_end),

I increased number from 12 to 15 in module_constant.py
Code:
DPLMC_NUM_PREFERENCE_OPTIONS = 15

Finally, I added below strings before cheat menu string.
Code:
  ("dplmc_setting_tt10", "This option enables troop ratio bar."),
  ("dplmc_setting_tt11", "This option enables battle overview map."),
  ("dplmc_setting_tt12", "This option enables personal kill count."),

COMPILED SUCCESSFULLY.


As you can see in the screenshot#2 I managed to add Combat UI options. But problem is that when I turn off them and exit it doesn't save my choices and when I go back to "Diplomacy Preferences", they all seem selected.

Thank you in advance for your help.

Kind Regards,
 
Ok, I've come across a certain issue: when I try entering the goods store via town scene in Khergit towns, the door doesn't work correctly. Instead of saying "Enter goods store" (or whatever it's supposed to say), it says "Enter . " If I enter, I spawn in an empty field. Now, I haven't tested to see if it's an issue with Diplomacy itself, or if I inadvertently edited something, but how do I fix it anyway?
 
Somebody said:
There already is a debug menu you can access to swap out slot values. You can access the endpoints through the character report (automatically goes to last talked troop), and the export/import for companions, and just enabling the cheatmenu ctrl+shift+` shortcut while inside a scene.
The printout is supposed to be there but I forgot to add the cheat mode requirement for it. Also, if you access the character screen/quest while in the middle of a dialog (by clicking on their face or pressint tab), if any registers are shared they can get broken between the various dialog options.

Thank you, that is a very useful feature to know, I will make use of it.
I was not aware that you can break stuff that easily with shared registry variables -  what were they thinking ?
 
Artam said:
I couldn't decide whether to ask for help here or "Modding Q&A". But since I tried to add a feature to Diplomacy mod, I decided to ask for help here. I hope I'm not doing anything wrong.

I am trying to add option to turn on/off via "Diplomacy Preferences" presentation of below code.
...
As you can see in the screenshot#2 I managed to add Combat UI options. But problem is that when I turn off them and exit it doesn't save my choices and when I go back to "Diplomacy Preferences", they all seem selected.

As for me I do not see anything wrong with the general approach. It is likely to be a clerical error - you should post the full code, if you haven't fixed it yet.
I managed to add this feature to my (yet another) Diplomacy Mod, the changes are here, mixed with some other code layout change (sorry) - although I merged the three options in one.
The only issue is that if you accidentally press the Quest button in battle, the minimap disappears.

You can see it in action here. It can be turned on and off .



Great feature btw, thank you for sharing. We should do that more often.
 
Hello diegoami,

Thanks for your reply.

Issue with disappearing combat_ui, this happens when you access your inventory, hit ESC button etc. If that happens you just need to hit BACKSPACE button twice. (or button you assign for order interface) This will fix the issue.

As for changes you made I will check tomorrow.
 
@Artam, in principle, you could check conditional and assignment operations:
Code:
eq                         = 31      # (eq, <value1>, <value2>),
                                     # Checks that value1 == value2

assign                     = 2133    # (assign, <destination>, <value>),
                                     # Directly assigns a value to a variable or register.

I urge you not to hesitate to post your next question about anything related to your modification in the 'Modding Q&A' thread.
 
Hello,

Dj_FRedy, Thank you for your kind comment.
diegoami, I checked the changes you made. That was very helpful.

The problem was I somehow managed to broke Diplomacy Preferences. But finally I managed to get the code to work properly.  :party:

Thanks both of you for your help.

Edit: OK, I know how I broke Diplomacy Prefernces.  It was working before (I put Combat Interface options after cheat mode.) but right now not, because I've changed the order of options. Almost all options are not working properly at this time. The code is as follows. (I deleted all commented out lines for easy reading.)

Code:
	("adv_diplomacy_preferences", 0, mesh_load_window,
		[
			(ti_on_presentation_load,
				[
					(set_fixed_point_multiplier, 1000),
					(presentation_set_duration, 999999),
					(str_clear, s0),
					
				## OPTIONS CONTAINER
					##(create_text_overlay, reg0, s0, tf_scrollable),
					(create_text_overlay, ":container", s0, tf_scrollable),
					(position_set_x, pos1, 25),
					(position_set_y, pos1, 50),
					(overlay_set_position, ":container", pos1),
					(position_set_x, pos1, 550),
					(position_set_y, pos1, 630),
					(overlay_set_area_size, ":container", pos1),
					(set_container_overlay, ":container"),
					
				## VARIABLE VERTICAL POSITIONS AND INCREMENTS
					(assign, ":y_increment", 50),
					(store_mul, ":texts_y", ":y_increment", DPLMC_NUM_PREFERENCE_OPTIONS),
					(store_sub, ":inputs_y", ":texts_y", 8),
					
					(try_for_range, ":slot_no", 0, DPLMC_NUM_PREFERENCE_OPTIONS),
					  (troop_set_slot, "trp_temp_array_a", ":slot_no", 0), #label
					  (troop_set_slot, "trp_temp_array_b", ":slot_no", 0), #field
					  (troop_set_slot, "trp_temp_array_c", ":slot_no", 0), #pictures
					(try_end),
					(assign, ":num_options", 0), #index
					
				## TEXTS & INPUTS
					(position_set_x, pos1, 50),
					(position_set_x, pos2, 450),
					
					#picture location
					(position_set_x, pos3, 500),
					(position_set_y, pos3, 125),
					#picture size
					(position_set_x, pos4, 480),
					(position_set_y, pos4, 640),
					#picture downscaled size
					(position_set_x, pos6, 375),
					(position_set_y, pos6, 500),
					#dropdown size
					(position_set_x, pos5, 700),
					(position_set_y, pos5, 800),
					
				## AI CHANGES
					(create_text_overlay, reg0, "@AI Changes:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(val_sub, ":texts_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					
					(create_combo_button_overlay, reg0),
					(position_set_x, pos2, 485),
					(val_sub, ":inputs_y", 8),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(overlay_set_size, reg0, pos5),
					(try_for_range, ":string", "str_dplmc_setting_2", "str_dplmc_setting_on"),
					  (overlay_add_item, reg0, ":string"),
					(try_end),
					(position_set_x, pos2, 450),
					(val_add, ":inputs_y", 8),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					(store_sub, ":actual_input_value", DPLMC_AI_CHANGES_HIGH, "$g_dplmc_ai_changes"),
					(overlay_set_val, reg0, ":actual_input_value"),
					
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_sally_out"),
					(set_container_overlay, ":container"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos6),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## ECONOMICS & BEHAVIORAL
					(create_text_overlay, reg0, "@Economics & Behavioral:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(val_sub, ":texts_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					
					(create_combo_button_overlay, reg0),
					(position_set_x, pos2, 485),
					(val_sub, ":inputs_y", 8),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(overlay_set_size, reg0, pos5),
					(try_for_range, ":string", "str_dplmc_setting_2", "str_dplmc_setting_on"),
						(overlay_add_item, reg0, ":string"),
					(try_end),
					(position_set_x, pos2, 450),
					(val_add, ":inputs_y", 8),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					(store_sub, ":actual_input_value", DPLMC_GOLD_CHANGES_HIGH, "$g_dplmc_gold_changes"),
					(overlay_set_val, reg0, ":actual_input_value"),
					
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_payment"),
					(set_container_overlay, ":container"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos4),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## PREJUDICE LEVEL
					(create_text_overlay, reg0, "@Prejudice Level:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					(val_sub, ":texts_y", ":y_increment"),

					(create_combo_button_overlay, reg0),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					(position_set_x, pos2, 485),
					(val_sub, ":inputs_y", 8),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(overlay_set_size, reg0, pos5),
					(overlay_add_item, reg0, "str_randomize"),
					(overlay_add_item, reg0, "str_dplmc_setting_2"),
					(overlay_add_item, reg0, "str_dplmc_setting_off"),
					(overlay_add_item, reg0, "str_default"),
					(position_set_x, pos2, 450),
					(val_add, ":inputs_y", 8),
					(val_sub, ":inputs_y", ":y_increment"),
					
					(store_div, ":actual_input_value", "$g_disable_condescending_comments", 2),
					(try_begin), #both gender in battles
					  (eq, ":actual_input_value", 2),
					  (overlay_set_val, reg0, 0),
					(else_try), #high
					  (lt, ":actual_input_value", 0),
					  (overlay_set_val, reg0, 1),
					(else_try), #disabled
					  (eq, ":actual_input_value", 1),
					  (overlay_set_val, reg0, 2),
					(else_try), #default
					  (overlay_set_val, reg0, 3),
					(try_end),
					
					(assign, reg1, "$g_disable_condescending_comments"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_siege_sighted_fem"),
					(set_container_overlay, ":container"),
					(overlay_set_size, reg0, pos4),
					(overlay_set_position, reg0, pos3),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## LORDS RETURNING FROM EXILE
					(create_text_overlay, reg0, "@Lords Returning From Exile:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					(val_sub, ":texts_y", ":y_increment"),
					
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(position_set_x, pos2, 450),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					
					(try_begin),
						(eq, "$g_dplmc_lord_recycling", DPLMC_LORD_RECYCLING_ENABLE),
						(assign, ":actual_input_value", 1),
					(else_try),
						(assign, ":actual_input_value", 0),
					(try_end),
					(overlay_set_val, reg0, ":actual_input_value"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_messenger"),
					(set_container_overlay, ":container"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos4),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## HORSE SPEED
					(create_text_overlay, reg0, "@Horse Speed Fix:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(val_sub, ":texts_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					(store_sub, ":actual_input_value", 1, "$g_dplmc_horse_speed"),
					(overlay_set_val, reg0, ":actual_input_value"),
					
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_charge"),
					(overlay_set_size, reg0, pos4),
					(overlay_set_position, reg0, pos3),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					(set_container_overlay, ":container"),
					
				## HORSE CULL
					(create_text_overlay, reg0, "@Horse Culling:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(val_sub, ":texts_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),

					(create_number_box_overlay, reg0, 0, 31),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(try_begin),
					  (neg|is_between, "$g_horses_are_avaliable", 0, 31),
					  (assign, "$g_horses_are_avaliable", 10),
					(try_end),
					(overlay_set_val, reg0, "$g_horses_are_avaliable"),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_defeat"),
					(set_container_overlay, ":container"),
					(overlay_set_size, reg0, pos4),
					(overlay_set_position, reg0, pos3),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## BATTLE CONTINUATION
					(create_text_overlay, reg0, "@Battle Continuation:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(val_sub, ":texts_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					
					(try_begin),
						(eq, "$g_dplmc_battle_continuation", 0),
						(assign, ":actual_input_value", 1),
					(else_try),
						(assign, ":actual_input_value", 0),
					(try_end),
					(overlay_set_val, reg0, ":actual_input_value"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_wounded"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos4),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					(set_container_overlay, ":container"),
					
					(try_begin), #sub-options
						(eq, "$g_dplmc_battle_continuation", 0),
						## Charge When Dead
						(create_text_overlay, reg0, "@Charge When Dead:", tf_vertical_align_center),
						(position_set_y, pos1, ":texts_y"),
						(overlay_set_position, reg0, pos1),
						(val_sub, ":texts_y", ":y_increment"),
						(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
						
						(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
						(position_set_y, pos2, ":inputs_y"),
						(overlay_set_position, reg0, pos2),
						(val_sub, ":inputs_y", ":y_increment"),
						(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
						
						(overlay_set_val, reg0, "$g_dplmc_charge_when_dead"),
						(set_container_overlay, -1),
						(create_mesh_overlay, reg0, "mesh_pic_victory"),
						(overlay_set_position, reg0, pos3),
						(overlay_set_size, reg0, pos4),
						(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
						(set_container_overlay, ":container"),
					(try_end),
					(val_add, ":num_options", 1), #skip index regardless
					
				## TERRAIN ADVANTAGE
					(create_text_overlay, reg0, "@Terrain Advantages:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(val_sub, ":texts_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					(try_begin),
						(eq, "$g_dplmc_terrain_advantage", 0),
						(assign, ":actual_input_value", 1),
					(else_try),
						(assign, ":actual_input_value", 0),
					(try_end),
					(overlay_set_val, reg0, ":actual_input_value"),
					
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_camp"),
					(set_container_overlay, ":container"),
					(overlay_set_size, reg0, pos4),
					(overlay_set_position, reg0, pos3),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## TROOP RATIO BAR
					(create_text_overlay, reg0, "@Show troop ratio bar:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					(val_sub, ":texts_y", ":y_increment"),
					
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(position_set_x, pos2, 450),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					
					(try_begin),
						(eq, "$g_troop_ratio_bar", 1),
						(assign, ":actual_input_value", 1),
					(else_try),
						(assign, ":actual_input_value", 0),
					(try_end),
					(overlay_set_val, reg0, ":actual_input_value"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_wounded"),
					(set_container_overlay, ":container"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos4),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## BATTLE MINI MAP
					(create_text_overlay, reg0, "@Show battle mini map:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					(val_sub, ":texts_y", ":y_increment"),
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					
					(position_set_x, pos2, 450),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					
					(try_begin),
						(eq, "$g_battle_minimap", 1),
						(assign, ":actual_input_value", 1),
					(else_try),
						(assign, ":actual_input_value", 0),
					(try_end),
					(overlay_set_val, reg0, ":actual_input_value"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_wounded"),
					(set_container_overlay, ":container"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos4),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## PERSONAL KILL COUNT
					(create_text_overlay, reg0, "@Show personal kill count:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					(val_sub, ":texts_y", ":y_increment"),
					
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(position_set_x, pos2, 450),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					
					(try_begin),
						(eq, "$g_killcount", 1),
						(assign, ":actual_input_value", 1),
					(else_try),
						(assign, ":actual_input_value", 0),
					(try_end),
					(overlay_set_val, reg0, ":actual_input_value"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_wounded"),
					(set_container_overlay, ":container"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos4),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## NPC COMPLAINTS
					(create_text_overlay, reg0, "@Disable Companions Complaints:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					(val_sub, ":texts_y", ":y_increment"),
					
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					(overlay_set_val, reg0, "$disable_npc_complaints"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_recruits"),
					(set_container_overlay, ":container"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos6),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## DISGUISES
					(create_text_overlay, reg0, "@Disguise System:", tf_vertical_align_center),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					(val_sub, ":texts_y", ":y_increment"),
					
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					(overlay_set_val, reg0, "$g_dplmc_player_disguise"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_townriot"),
					(set_container_overlay, ":container"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos4),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
				## CHEAT MENU
					(create_text_overlay, reg0, "@Cheat Mode:", tf_vertical_align_center),
					(troop_set_slot, "trp_temp_array_a", ":num_options", reg0),
					(position_set_y, pos1, ":texts_y"),
					(overlay_set_position, reg0, pos1),
					(val_sub, ":texts_y", ":y_increment"),

					#Native has bunch of message modes (up to 4) but they're not useful
					(create_check_box_overlay, reg0, "mesh_checkbox_off", "mesh_checkbox_on"),
					(troop_set_slot, "trp_temp_array_b", ":num_options", reg0),
					(position_set_y, pos2, ":inputs_y"),
					(overlay_set_position, reg0, pos2),
					(val_sub, ":inputs_y", ":y_increment"),
					
					(try_begin),
					  (gt, "$cheat_mode", 0),
					  (assign, ":actual_input_value", 1),
					(else_try),
					  (assign, ":actual_input_value", 0),
					(try_end),
					(overlay_set_val, reg0, ":actual_input_value"),
					(set_container_overlay, -1),
					(create_mesh_overlay, reg0, "mesh_pic_cattle"),
					(set_container_overlay, ":container"),
					(overlay_set_position, reg0, pos3),
					(overlay_set_size, reg0, pos4),
					(troop_set_slot, "trp_temp_array_c", ":num_options", reg0),
					(val_add, ":num_options", 1),
					
					(set_container_overlay, -1),
					
				## MOUSE-OVER TIPS
					(create_text_overlay, reg0, "@DIPLOMACY^" + DPLMC_DIPLOMACY_VERSION_STRING+ "^Preferences", tf_center_justify|tf_with_outline),
					(overlay_set_color, reg0, 0xFFFFFFFF),
					(position_set_x, pos1, 800),
					(position_set_y, pos1, 600),
					(overlay_set_position, reg0, pos1),
					(position_set_x, pos1, 2000),
					(position_set_y, pos1, 2000),
					(overlay_set_size, reg0, pos1),
					
					(str_store_string, s0, "str_dplmc_setting_tt0"),
					(create_text_overlay, reg0, s0, tf_double_space|tf_scrollable),
					(position_set_x, pos1, 650),
					(position_set_y, pos1, 400),
					(overlay_set_position, reg0, pos1),
					(position_set_x, pos1, 800),
					(position_set_y, pos1, 800),
					(overlay_set_size, reg0, pos1),
					(position_set_x, pos1, 300),
					(position_set_y, pos1, 150),
					(overlay_set_area_size, reg0, pos1),
					(assign, "$g_presentation_obj_admin_panel_container", reg0),
					
				## BUTTONS
					(position_set_x, pos1, 900),
					(try_begin),
					  (eq, "$g_dplmc_battle_continuation", 0),
					  (position_set_y, pos1, 125),
					  (create_game_button_overlay, reg0, "str_spectator_camera", tf_center_justify),
					  (overlay_set_position, reg0, pos1),
					  (assign, "$g_dplmc_cam_activated", reg0),
					(else_try),
					  (assign, "$g_dplmc_cam_activated", -1),
					(try_end),
					
					(position_set_y, pos1, 75),
					(create_game_button_overlay, reg0, "str_reset_to_default", tf_center_justify),
					(overlay_set_position, reg0, pos1),
					(assign, "$g_presentation_obj_profile_banner_selection_1", reg0),
					
					(position_set_y, pos1, 25),
					(create_game_button_overlay, reg0, "str_done", tf_center_justify),
					(overlay_set_position, reg0, pos1),
					(assign, "$g_presentation_obj_profile_banner_selection_2", reg0),
					
				## HIDE PICTURES
					(try_for_range, ":slot_no", 0, ":num_options"),
					  (troop_get_slot, ":overlay", "trp_temp_array_c", ":slot_no"),
					  (gt, ":overlay", 0),
					  (overlay_set_display, ":overlay", 0),
					(try_end),
					
				]
			 ),
			(ti_on_presentation_event_state_change,
				[
					(store_trigger_param_1, ":object"),
					(store_trigger_param_2, ":value"),
					
				## "RESET" BUTTON KILL THE PRESENTATION AND START ANOTHER ONE
					(try_begin),
						(eq, ":object", "$g_presentation_obj_profile_banner_selection_1"),
						(assign, "$g_dplmc_cam_default", camera_keyboard),
						(assign, "$g_dplmc_ai_changes", DPLMC_AI_CHANGES_LOW),
						(assign, "$g_dplmc_gold_changes", DPLMC_GOLD_CHANGES_LOW),
						(assign, "$g_dplmc_lord_recycling", DPLMC_LORD_RECYCLING_ENABLE),
						(assign, "$g_dplmc_horse_speed", 0),
						(assign, "$g_horses_are_avaliable", 10),
						(assign, "$g_dplmc_battle_continuation", 0),
						(assign, "$g_dplmc_charge_when_dead", 1),
						(assign, "$g_dplmc_terrain_advantage", DPLMC_TERRAIN_ADVANTAGE_ENABLE),
						(assign, "$g_troop_ratio_bar", 0),
						(assign, "$g_battle_minimap", 0),
						(assign, "$g_killcount", 0),
						(assign, "$disable_npc_complaints", 0),
						(assign, "$g_disable_condescending_comments", 0),		
						(assign, "$g_dplmc_player_disguise", disguise_pilgrim),
						(assign, "$sneaked_into_town", disguise_none), #associated with above
						(assign, "$cheat_mode", 0),
						(start_presentation, "prsnt_adv_diplomacy_preferences"),
					(else_try),
						
				## "SAVE AND EXIT" BUTTON GETS THE OPTION VALUES AND GIVE THEM TO PROPER VARIABLES.
				## THEN IT KILLS THE PRESENTATION.
						(eq, ":object", "$g_presentation_obj_profile_banner_selection_2"),
						(call_script, "script_dplmc_update_info_settings"),
						(presentation_set_duration, 0),
					(else_try), #deathcam launch new presentation
					  (eq, ":object", "$g_dplmc_cam_activated"),
					  (assign, "$g_presentation_next_presentation", "prsnt_redefine_keys"),
					  (start_presentation, "prsnt_redefine_keys"),
					(else_try), ## AI
						(troop_slot_eq, "trp_temp_array_b", 1, ":object"),
						(store_sub, "$g_dplmc_ai_changes", DPLMC_AI_CHANGES_HIGH, ":value"),
					(else_try), ## ECO
						(troop_slot_eq, "trp_temp_array_b", 2, ":object"),
						(store_sub, "$g_dplmc_gold_changes", DPLMC_GOLD_CHANGES_HIGH, ":value"),
					(else_try), ## PREJUDICE
						(troop_slot_eq, "trp_temp_array_b", 3, ":object"),
						(try_begin), # default
						  (eq, ":value", 3),
						  (assign, "$g_disable_condescending_comments", 0),
						(else_try), # off
						  (eq, ":value", 2),
						  (assign, "$g_disable_condescending_comments", 2),
						(else_try), # high
						  (eq, ":value", 1),
						  (assign, "$g_disable_condescending_comments", -2),
						(else_try), # randomize
						  (eq, ":value", 0),
						  (assign, "$g_disable_condescending_comments", 4),
						(try_end),
						(call_script, "script_dplmc_init_faction_gender_ratio", 1),
					(else_try), ## LORDS RETURNING FROM EXILE
						(troop_slot_eq, "trp_temp_array_b", 4, ":object"),
						(store_sub, "$g_dplmc_lord_recycling", ":value", 1),
					(else_try), ## HORSE SPEED
						(troop_slot_eq, "trp_temp_array_b", 5, ":object"),
						(store_sub, "$g_dplmc_horse_speed", 1, ":value"),
					(else_try), ## HORSE CULL
						(troop_slot_eq, "trp_temp_array_b", 6, ":object"),
						(assign, "$g_horses_are_avaliable", ":value"),
					(else_try), ## BATTLE CONTINUATION
						(troop_slot_eq, "trp_temp_array_b", 7, ":object"),
						(store_sub, "$g_dplmc_battle_continuation", 1, ":value"),
						#refresh presentation to show new options
						(start_presentation, "prsnt_adv_diplomacy_preferences"),
					(else_try), ## CHARGE AFTER DEATH
						(troop_slot_eq, "trp_temp_array_b", 8, ":object"),
						(assign, "$g_dplmc_charge_when_dead", ":value"),
					(else_try), ## TERRAIN ADVANTAGE
						(troop_slot_eq, "trp_temp_array_b", 9, ":object"),
						(store_sub, "$g_dplmc_terrain_advantage", ":value", 1),
					(else_try), ## TROOP RATIO BAR
						(troop_slot_eq, "trp_temp_array_b", 10, ":object"),
						(assign, "$g_troop_ratio_bar", ":value"),
					(else_try), ## BATTLE MINI MAP
						(troop_slot_eq, "trp_temp_array_b", 11, ":object"),
						(assign, "$g_battle_minimap", ":value"),
					(else_try), ## PERSONAL KILL COUNT
						(troop_slot_eq, "trp_temp_array_b", 12, ":object"),
						(assign, "$g_killcount", ":value"),
					(else_try), ## NPC COMPLAINTS
						(troop_slot_eq, "trp_temp_array_b", 13, ":object"),
						(assign, "$disable_npc_complaints", ":value"),
					(else_try), ## DISGUISE
						(troop_slot_eq, "trp_temp_array_b", 14, ":object"),
						(assign, "$g_dplmc_player_disguise", ":value"),
						(assign, "$sneaked_into_town", disguise_none), #so as to not proc trigger
					(else_try), ## CHEATS MENU
						(troop_slot_eq, "trp_temp_array_b", 15, ":object"),
						(assign, "$cheat_mode", ":value"),
					(try_end),
				]
			),
			(ti_on_presentation_mouse_enter_leave, #Mouse-Over Pref-Tips
				[
					(store_trigger_param_1, ":object"),
					(store_trigger_param_2, ":enter_leave"), #0 if mouse enters, 1 if mouse leaves
				##IF THE EVENT IS "ENTER", WE CHOOSE THE TEXT THAT WILL BE SHOWED
					(try_begin),
						(eq, ":enter_leave", 0),
						(gt, ":object", 0), #not the overlay
						#could use overlay_set_material but stretching
						(assign, ":num_options", DPLMC_NUM_PREFERENCE_OPTIONS),
						(assign, ":selected_option", -1),

						(try_for_range, ":slot_no", 0, ":num_options"),
						  (this_or_next|troop_slot_eq, "trp_temp_array_a", ":slot_no", ":object"),
						  (troop_slot_eq, "trp_temp_array_b", ":slot_no", ":object"),
						  (store_add, ":string", "str_dplmc_setting_tt1", ":slot_no"),
						  (overlay_set_text, "$g_presentation_obj_admin_panel_container", ":string"),
						  (assign, ":num_options", -1),
						  (assign, ":selected_option", ":slot_no"),
						(try_end),
						
						(try_begin),
						  (eq, ":selected_option", -1),
						  (overlay_set_text, "$g_presentation_obj_admin_panel_container", "str_dplmc_setting_tt0"),
						(else_try),
						  (try_for_range, ":slot_no", 0, DPLMC_NUM_PREFERENCE_OPTIONS),
							(troop_get_slot, ":overlay_no", "trp_temp_array_c", ":slot_no"),
							(gt, ":overlay_no", 0),
							(try_begin),
							  (eq, ":slot_no", ":selected_option"),
							  (overlay_set_display, ":overlay_no", 1),
							(else_try),
							  (overlay_set_display, ":overlay_no", 0),
							(try_end),
						  (try_end),
						(try_end),
					(try_end),
				]
			),
			 ## SETS A LISTENER TO SOME KEY_CLICKS TO TERMINATE THE PRESENTATION
			 ## VERY USEFUL FOR MODDING
			(ti_on_presentation_run,
				[
					(try_begin),
						(this_or_next|key_clicked, key_space),
						(this_or_next|key_clicked, key_enter),
						(this_or_next|key_clicked, key_escape),
						# (this_or_next|key_clicked, key_back_space), #needed for number box
						(this_or_next|key_clicked, key_xbox_ltrigger),
						(key_clicked, key_xbox_rtrigger),
						(presentation_set_duration, 0),
					(try_end),
				]
			 ),
Code:
  ("dplmc_setting_2", "High"),
  ("dplmc_setting_1", "Medium"),
  ("dplmc_setting_0", "Low"),
  ("dplmc_setting_off", "Disabled"),
  ("dplmc_setting_on", "Enabled"),
  ("dplmc_setting_freq", "Frequent"),
  ("dplmc_setting_tt0", "Mouse-over options for further information. More detailed description of mechanics can be found in the game concepts information pages."),
  ("dplmc_setting_tt1", "This option lets you decide the AI strength level. The higher this level is, the better the AI. High level is experimental and may brings some bugs to your game."),
  ("dplmc_setting_tt2", "This option changes the economical and behavior values to be more realistic. High level is experimental and may brings some bugs to your game."),
  ("dplmc_setting_tt3", "This option lets you decide the level of sexism in the game."),
  ("dplmc_setting_tt4", "This option lets exiled lords return in order to serve a new liege and form warbands without a home center."),
  ("dplmc_setting_tt5", "This option makes every horse in battle lose movement speed directly proportional to their lost Health Points."),
  ("dplmc_setting_tt5a", "This option causes riderless horses in battle to start running away after 1 minute and being culled 30 seconds later. The default tic rate is 10 seconds, and a rate of 0 means culling is disabled. Riding a horse will reset its timer and other horses within 5 meters of the player will not be subject to culling."),
  ("dplmc_setting_tt6", "This option let your troops continue fighting should you fall in battle."),
  ("dplmc_setting_tt6a", "This option orders all your troops to use any weapons, fire at will, and charge once you fall in battle."),
  ("dplmc_setting_tt7", "This option gives advantage in autocalculated battles to those units who are better in the current terrain.^Horsemen are bad in forest terrain, while archers are better."),
  ("dplmc_setting_tt8", "This option enables troop ratio bar."),
  ("dplmc_setting_tt9", "This option enables battle mini map."),
  ("dplmc_setting_tt10", "This option enables personal kill count in battle."),  
  ("dplmc_setting_tt11", "This option toggles whether companions suffer from incompatible moralities and grievance penalties."),
  ("dplmc_setting_tt12", "This option enables a more complex disguise system while entering hostile centers."),
  ("dplmc_setting_tt13", "This option enables various cheat menus and debug features."),
Code:
DPLMC_NUM_PREFERENCE_OPTIONS = 15 #for prsnt_adv_diplomacy_preferences

Kind regards,
 
Artam said:
Edit: OK, I know how I broke Diplomacy Prefernces.  It was working before (I put Combat Interface options after cheat mode.) but right now not, because I've changed the order of options. Almost all options are not working properly at this time. The code is as follows. (I deleted all commented out lines for easy reading.)

I had a similar problem, that is why I put my new options at the end of Preferences just not to have to deal with this issue. I think it might have to do with the internal order or variables that may not compatible in this case between two versions. I think there is a kind of hack to deal with this, but I do not know it.
 
Hoping someone here can point me in the right direction, having some issues in my current game (running warsword conquest that has diplomacy as a sub-mod) where the various factions are a little "too" eager to become friends with each other. I suspect this is due to the faction relationship gains from concluding things like non-aggression pacts etc making it joke easy for them to become BFF's quickly. so i'm looking for a way to either reduce the relations gain between the kingdoms from concluding treaties, or to increase the minimum relations required to reliably get the next "Steps" in the road towards a full alliance (or both)
 
##SB : icons to represent item type meta-upgrades
("icon_morningstar", 0, "ico_morningstar", 0, 0, 0, 0, 0, 0, 0.3, 0.3, 0.3),
("icon_lance", 0, "ico_couchedlance", 0, 0, 0, 0, 0, 0, 0.3, 0.3, 0.3),
("icon_spear", 0, "ico_spear", 0, 0, 0, 0, 0, 0, 0.3, 0.3, 0.3),
("icon_bardiche", 0, "ico_axetwo", 0, 0, 0, 0, 0, 0, 0.3, 0.3, 0.3),
Do anyone know where are those icon files? Are they in vanilla?
 
To whomever it may concern, I've come across some issues in the latest version:
1) When granting a fief to a fiefless companion (elevating them to lordship), I get an error code (I didn't memorize the code itself, but it appears very often in different mods and you've probably seen it many times). The companion gets the fief and increases relations with me, but still, the error causes some concerns.
2) When talking to one of the ministers (not prominent citizen), during one of the conversations, the minister includes a random lord's name alongside the proper strings. I don't know what the deal is, doesn't seem to affect anything, but it's still strange.

In general, I've noticed that the newer versions of Diplomacy are acting up more. I once added new troops, something I did many times before, but for whatever reason all the troops' inventories became messed up.

Edit: For point nr.1, I think the errors come up for when the companion's supposed to change their gear, because I enfiefed Firentis, and he still had his starting tabard and sword.
 
Last edited:
Diplomacy has been updated to the 1.171 module system (1.172/3/4 are engine patches), since I'm technically sort of responsible for maintaining it after uploading it to the Steam Workshop. A bunch of bug fixes and new features are listed there as well in the discussions

Current test version is here.

*Click here for the source code.
*Patch notes can be found in the source comments or the Steam workshop thread.
How do I download this and play with it? I have created a new folder called Diplomacy in the "Modules" folder and added all the files in that but when I try to open the game, it just gets stuck on proccessing ini file
 
a question not sure if it was asked or if this is not the place to ask.

Diplomacy is not compatible with wreck?

I tried it earlier, everything works correctly aside from the snippets of codes diplomacy adds after the ending of the brackets. so no matter what I do, wreck can't define them.

want to know to see if I should wasting my time if it's not possible. Thanks
 
Back
Top Bottom