Companion Banner Change

Users who are viewing this thread

Othienka

Sergeant at Arms
Is there mini-mod for this? I've seen some codes that actually let you choose which banners should the companions choose [if they are made lords in the specific order], but has anyone tried to actually have an option to modify/change the banners of companions made lords?
 
Othienka said:
Is there mini-mod for this? I've seen some codes that actually let you choose which banners should the companions choose [if they are made lords in the specific order], but has anyone tried to actually have an option to modify/change the banners of companions made lords?

In my "Module System Code" link, there's code to randomize what banners companions receive upon being enfeoffed.
I've not seen code floating around to bring up the banner selection presentation, though. It wouldn't be terribly difficult to do.
 
Modify prsnt_banner_selection to use the companion (perhaps use a global variable) instead of trp_player. Then make a menu which jumps to that presentation after selecting the npc.
 
Somebody said:
Modify prsnt_banner_selection to use the companion (perhaps use a global variable) instead of trp_player. Then make a menu which jumps to that presentation after selecting the npc.
Just be sure to also modify the calls of prsnt_banner_selection by Native code to set the global variable you choose to trp_player when it is intended to set the player's banner. (In game_menus and simple_triggers)
 
Making it out of nothing seems to be out of my league at the moment, but I'll see what I can do.

About Caba`drin link: I think I had seen [and probably used] before, clicking your link led all of your useful tweaks that I will proceed to add to mods for my personal use [too bad they can't see the wisdom into adding them officially to the mods themselves]. Thanks a lot  :wink:
 
Well, in my mod, along with many other things, you may assign any banner to any of your lords (including companions). You may also re-assign a different one at any time you want. You may choose the same banner for your entire faction if you wish. I use the same banner selection presentation in which you choose a banner for yourself. You may choose one of the 15 x 21 banners including the one isn't used by the game and 8 additional sheets made by me.  :smile:

Although, you'll probably want just the banners and the code but it's impossible to separate it from the rest of the mod, so you'd have to use WinMerge etc to compare it with yours. I allow the defeated kings return from exile and join me as lords, and they use their old banners (ie. kingdom banners). If you attempt to reassign their banners (which is possible in my mod) you won't be able to go back to their original ones unless you run the script I've added in the camp reassign background colors menu which is currently commented out.

This is the presentation code I use when assignin banners to lords...


Code:
#########################
## Added by Kinlar ->
#########################

	(
		"lord_banner_selection", 0, mesh_load_window,
		[
			(
				ti_on_presentation_load,
				[
					(set_fixed_point_multiplier, 1000),
			        (str_store_string, s1, "str_lord_banner_selection_text"),
			        (create_text_overlay, reg1, s1, tf_center_justify),
			        (position_set_x, pos1, 500),
			        (position_set_y, pos1, 600),
			        (overlay_set_position, reg1, pos1),
			        (overlay_set_text, reg1, s1),
			        (create_button_overlay, "$g_presentation_obj_banner_selection_1", "@Next Page", tf_center_justify),
			        (position_set_x, pos1, 500),
			        (position_set_y, pos1, 50),
			        (overlay_set_position, "$g_presentation_obj_banner_selection_1", pos1),

			        (assign, ":x_pos", 150),
			        (assign, ":y_pos", 575),
			        (assign, ":try_end", banner_meshes_end_minus_one),
			        (store_sub, ":num_npc_kingdoms", npc_kingdoms_end, npc_kingdoms_begin),
			        (val_sub, ":try_end", ":num_npc_kingdoms"), #do not allow kingdom banners to be selected
			        (store_mul, ":begin_mesh", 16, "$g_presentation_page_no"),

					## Kinlar ->
			        (val_add, ":begin_mesh", banner_meshes_begin),
			        #(val_add, ":begin_mesh", player_banner_meshes_begin),
					## <- Kinlar 

			        (store_add, ":try_end_2", ":begin_mesh", 16),
			        (val_min, ":try_end", ":try_end_2"),
			        (store_add, "$g_presentation_banner_start", "$g_presentation_obj_banner_selection_1", 1),
			        (try_for_range, ":cur_banner_mesh", ":begin_mesh", ":try_end"),
			          (create_image_button_overlay, reg1, ":cur_banner_mesh", ":cur_banner_mesh"),
			          (position_set_x, pos1, ":x_pos"),
			          (position_set_y, pos1, ":y_pos"),
			          (overlay_set_position, reg1, pos1),
			          (position_set_x, pos1, 100),
			          (position_set_y, pos1, 100),
			          (overlay_set_size, reg1, pos1),
			          (val_add, ":x_pos", 100),
			          (ge, ":x_pos", 900),
			          (assign, ":x_pos", 150),
			          (val_sub, ":y_pos", 250),
			        (try_end),
			        (presentation_set_duration, 999999),
				]
			),
      
			(
				ti_on_presentation_event_state_change,
				[
					(store_trigger_param_1, ":object"),

			        (try_begin),

						(eq, ":object", "$g_presentation_obj_banner_selection_1"),
						(val_add, "$g_presentation_page_no", 1),
						## Kinlar ->
						#(val_mod, "$g_presentation_page_no", 8), # 8 pages <- for player only banners (6 sheets)
						# (val_mod, "$g_presentation_page_no", 16), # 16 pages <- for all banners (12 sheets)
						(val_mod, "$g_presentation_page_no", 20), # 20 pages <- for all banners (15 sheets)
						## <- Kinlar
						(start_presentation, "prsnt_lord_banner_selection"),

			        (else_try),

						(store_sub, ":selected_banner", ":object", "$g_presentation_banner_start"),
						(store_mul, ":page_adder", 16, "$g_presentation_page_no"),
						(val_add, ":selected_banner", ":page_adder"),

						## Kinlar ->
						# lords may choose from all banners
						(store_add, ":selected_banner_map_icon", ":selected_banner", banner_map_icons_begin),

						(party_set_banner_icon, "$g_talk_troop_party", ":selected_banner_map_icon"),
						# (party_set_banner_icon, "$g_encountered_party", ":selected_banner_map_icon"),
						(store_add, ":selected_banner_spr", ":selected_banner", banner_scene_props_begin),
						(troop_set_slot, "$g_talk_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"),

						# the below is for player-only banners
						# (store_add, ":selected_banner_map_icon", ":selected_banner", player_banner_map_icons_begin),
						# (party_set_banner_icon, "$g_encountered_party", ":selected_banner_map_icon"),
						# (store_add, ":selected_banner_spr", ":selected_banner", player_banner_scene_props_begin),
						# (troop_set_slot, "$g_talk_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"),

						## Update map icons for the lord's fiefs
						(try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
							(party_slot_eq, ":cur_center", slot_town_lord, "$g_talk_troop"),
							(party_set_banner_icon, ":cur_center", ":selected_banner_map_icon"),
						(try_end),

						(assign, "$g_presentation_page_no", 0),

						## <- Kinlar
				                    
						(presentation_set_duration, 0),
						#(change_screen_notes, 1, "$g_talk_troop"),
						(change_screen_return),

			        (try_end),
				]
			),
      
			(
				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),
			          (key_clicked, key_back_space),
			          (presentation_set_duration, 0),
			        (try_end),
				]
			),
		]
	),

#########################
## <- Added by Kinlar  ##
#########################

Placed this under the banner_selection presentation.

Added this in dialogues...


Code:
	[
		anyone|plyr,
		"lord_talk", 
		[
			#(eq,"$talk_context",tc_party_encounter),
			#(is_between, "$g_talk_troop", active_npcs_begin, active_npcs_end),

			# The following is to prevent showing this option for a non-existing party
			(this_or_next|eq, "$talk_context", tc_party_encounter),
			(party_is_in_town, "$g_talk_troop_party", "$current_town"),

			(eq, "$g_talk_troop_faction", "fac_player_supporters_faction"),
			(faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
			(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
		],
		"I want you to carry a new banner.", 
		"close_window",
		[
			(jump_to_menu, "mnu_lord_banner_selection"),
			(finish_mission),
		]
	],

And this to game menus...


Code:
	(
		"lord_banner_selection", mnf_scale_picture|mnf_disable_all_keys,
		"Choose a banner for your lord.",
		"none",
		[
			#(set_background_mesh, "mesh_pic_messenger"),
		],
		[
			(
				"continue",
				[
					(start_presentation, "prsnt_lord_banner_selection"),
				], 
				"Continue...",
				[
					# (jump_to_menu, "mnu_auto_return"),
					# (start_presentation, "prsnt_lord_banner_selection"),
				]
			),
		],
	),

Posted the code above to give you an idea. Don't expect it to work when you copy & paste it. In my mod,  there are some other additions/limitations to the original code, for instance, you are not allowed to choose from faction banners, and each faction picks their banners from a certain range etc.

PS. Currently, I have no plans to publish it and I'm not sure if I ever will anyway.

 
Back
Top Bottom