SP Dark Ages VC Political Map OSP (with download link)

Users who are viewing this thread

Status
Not open for further replies.

kalarhan

Python Saint
Count
WBNWVCWF&S

Hey, in this thread I will present the MapNodes OSP for VC. Any feedback/suggestions for it are welcome. Closed development, to be released this week. Released

Short description:
Based on @Rubik work it is possible to add a nice presentation/UI that represents the worldmap. It includes kingdom view and 3 new modes:

[list type=decimal]
[*]Factions Mapnode: each faction represented in the map
[*]Religions Mapnode: showing which areas are pagan or Christian
[*]Diplomacy Mapnode: shows the relations of other factions with you - if king - or your faction - if vassal.
[*]Fief Mapnode: shows if a fief is ok, under attack or if it was looted
[/list]



Code:

Download link:  https://drive.google.com/file/d/0B_oc2ReDoxuuSENZVEhVdEdxekk/view?usp=sharing
(it requires WRECK)

Code:
from compiler import *
register_plugin()
require_plugin("plugin_presentations")

# Inject code on prstn_character_screen_main (LOAD) for new Button
# Inject code on prstn_character_screen_main (Event change) for new Button

 
color_minus_50 = 0xF21616
color_minus_10 =  0xFF4719
color_minus_0 = 0xE6F032
color_plus_1 = 0x67a9cf
color_plus_50 = 0x00006B
color_you = 0x338533 
color_error = 0xE038F2

color_christian = 0x3B5DC4
color_pagan = 0xF21616

color_fief_normal = 0x00FF00
color_fief_recovering = 0x0000FF
color_fief_under_attack = 0xF21616
color_fief_destroyed = 0x00000
color_terrain = 0x666666

strings = [
	("wm_start_presentation", "{!}Starting presentation world_map"),
	("wm_info1", "{!}color coded by factions"),
	("wm_info2", "{!}color coded by Relations"),
	("wm_info3", "{!}color coded by religion"),
	("wm_info4", "{!}color coded by fiefs"),
	("wm_error1", "{!}invalid type for mapnode"),
	("wm_error2", "{!}Error to color code relations"),
	("wm_error3", "{!}Fief with unknow situation for fiefs report: center {reg50}, cond {reg51}, bandits {reg52}"),
	("wm_kingdoms", "{!}Kingdoms:"),
	("wm_diplomacy", "{!}Diplomacy:"),
	("wm_your_faction", "{!}Your Faction"),
	("wm_legend_more_50", "{!}> (+50)"),
	("wm_legend_more_0", "{!}> (0)"),
	("wm_legend_more_minus_10", "{!}> (-10)"),
	("wm_legend_more_minus_50", "{!}> (-50)"),
	("wm_legend_more_minus_100", "{!}> (-100)"),
	("wm_religions", "{!}Religions:"),
	("wm_christians", "{!}Christians"),
	("wm_pagans", "{!}Pagans"),
	("wm_fiefs", "{!}Fiefs:"),
	("wm_fief_normal", "{!}Normal"),
	("wm_fief_recovering", "{!}Recovering"),
	("wm_fief_looted", "{!}Destroyed"),
	("wm_fief_under_attack", "{!}Under Attack"),
	("wm_next_mapnode", "{!}Next Mapnode"),
	("wm_button_open_mapnodes", "{!}MapNodes"),
]

presentations = [
	# Kalarhan MapNodes
	# Based on WorldMap by Rubik
	("world_map", 0, mesh.load_window, [
		(ti_on_presentation_load,
		  [
		    (presentation_set_duration, 999999),
		    (set_fixed_point_multiplier, 1000),

		    (info, s.wm_start_presentation), 	  
		    (try_begin),
		        (neg|is_between, g.type_mapnode, 0, 4),
		        (assign, g.type_mapnode, 0), 
		    (try_end),
		    		    
		    (try_begin),
				(eq, g.type_mapnode, 0),
			    (info, s.wm_info1),		        
		    (else_try),
		    	(eq, g.type_mapnode, 1),
		    	(info, s.wm_info2),
		    (else_try),
		    	(eq, g.type_mapnode, 2),
		        (info, s.wm_info3),		
		    (else_try),
		    	(eq, g.type_mapnode, 3),
		        (info, s.wm_info4),		
		    (else_try),
		        (error, s.wm_error1),		         
		    (try_end),

		    
		  ## initialization part begin
		    # presentation obj: begin from top left corner
		    (assign, ":init_pos_x", 20), # init x
		    (assign, ":init_pos_y", 720), # init y
		    
		    # world map, X: -180 t0 180  Y: -145 t0 145 
		    (assign, ":min_map_x", -230*1000),
		    (assign, ":max_map_x", 285*1000),
		    (assign, ":min_map_y", -287*1000),
		    (assign, ":max_map_y", 295*1000),
		    # also begin from top left corner
		    (assign, ":init_map_x", ":min_map_x"), # init map_x
		    (assign, ":init_map_y", ":max_map_y"), # init map_y
		    
		    # move length of p_temp_party, total_cols and total_rows
		    (assign, ":map_scale", 4),
		    (store_mul, ":party_move_length", ":map_scale", 1000),
		    (store_sub, ":total_cols", ":max_map_x", ":min_map_x"),
		    (store_sub, ":total_rows", ":max_map_y", ":min_map_y"),
		    (val_div, ":total_cols", ":party_move_length"),
		    (val_div, ":total_rows", ":party_move_length"),
		    
		    # color_block_length
		    (assign, ":color_block_length", ":map_scale"),
		    (store_mul, ":color_block_size", ":color_block_length", 50),
		    (position_set_x, pos2, ":color_block_size"),
		    (position_set_y, pos2, ":color_block_size"),
		  ## initialization part end
		    
		    (assign, ":pos_x", ":init_pos_x"), # assign to cur pos_x
		    (assign, ":pos_y", ":init_pos_y"), # assign to cur pos_y
		    (assign, ":map_x", ":init_map_x"), # assign to cur map_x
		    (assign, ":map_y", ":init_map_y"), # assign to cur map_y 
		    ## draw whole map
		    (try_for_range, ":unused_rows", 0, ":total_rows"),
		      (try_for_range, ":unused_cols", 0, ":total_cols"),
		        (assign, ":dest_color", 0xFFFFFF), # default
		        (position_set_x, pos3, ":map_x"),
		        (position_set_y, pos3, ":map_y"),
		        (party_set_position, "p_temp_party", pos3),
		        (party_get_current_terrain, ":current_terrain", "p_temp_party"),
		        
		        (try_begin),
		          (this_or_next|eq, ":current_terrain", rt_water),
		          (this_or_next|eq, ":current_terrain", rt_bridge),
		          (eq, ":current_terrain", rt_river),
		          (assign, ":dest_color", 0xD6FFFF), # default water
		        (else_try),
		          (call_script, "script_get_closest_center", "p_temp_party"),
		          (assign, ":nearest_center", reg0),
		          (try_begin),
		            (gt, ":nearest_center", -1),
		            (store_faction_of_party, ":center_faction", ":nearest_center"),
		            (is_between, ":center_faction", kingdoms_begin, kingdoms_end),
		           	
		           	(try_begin),
			            # color coded by faction
			            (eq, g.type_mapnode, 0),
			           	(faction_get_color, ":dest_color", ":center_faction"),	        

			        (else_try),
						# color coded by Relations
						(eq, g.type_mapnode, 1),						
						(try_begin), #if player faction
							(this_or_next|eq, ":center_faction", "fac_player_faction"),
							(eq, ":center_faction", "fac_player_supporters_faction"),
							(assign, ":dest_color", color_you), 
						(else_try), # restoftheworld
						    (store_relation, ":relation_to_player", "fac_player_faction", ":center_faction"),
						    (try_begin),
						       (is_between, ":relation_to_player", -100, -50),   
						       (assign, ":dest_color", color_minus_50),
						    (else_try),
						       (is_between, ":relation_to_player", -50, -10),   
						       (assign, ":dest_color", color_minus_10), 
						    (else_try),
						        (is_between, ":relation_to_player", -10, 0),   
						        (assign, ":dest_color", color_minus_0), 
						    (else_try),
						        (is_between, ":relation_to_player", 0, 50),   
						        (assign, ":dest_color", color_plus_1),
						    (else_try),
						        (is_between, ":relation_to_player", 50, 101),   
						        (assign, ":dest_color", color_plus_50),                                            
						    (else_try),
						        (assign, ":dest_color", color_error), 
						        (error, s.wm_error2),             
						    (end_try),
						(end_try),

					(else_try), 
						# Color coded by religion
						(eq, g.type_mapnode, 2),
						(assign, ":dest_color", 0xE038F2), # pink - error
						(try_begin),
						  	(faction_slot_eq, ":center_faction", 233, 1),    
						  	(assign, ":dest_color", color_christian), # default - christians
						(else_try),
						  	(faction_slot_eq, ":center_faction", 236, 1),
						  	(assign, ":dest_color", color_pagan), # default - pagans
						(end_try), 

			        (else_try),
			        	# color coded by fiefs
			            (eq, g.type_mapnode, 3),
			           	(assign, ":dest_color", color_terrain),									           	    
		           	(try_end),   

		          (try_end),
		        (try_end),
		        (create_mesh_overlay, reg0, mesh.white_plane),
		        (overlay_set_color, reg0, ":dest_color"),
		        (position_set_x, pos1, ":pos_x"),
		        (position_set_y, pos1, ":pos_y"),
		        (overlay_set_position, reg0, pos1),
		        (overlay_set_size, reg0, pos2), # color block size      
		        
		        # offset
		        (val_add, ":pos_x", ":color_block_length"),
		        (val_add, ":map_x", ":party_move_length"), 
		      (try_end),
		      # offset
		      (assign, ":pos_x", ":init_pos_x"),
		      (val_sub, ":pos_y", ":color_block_length"),
		      (assign, ":map_x", ":init_map_x"),
		      (val_sub, ":map_y", ":party_move_length"),
		    (try_end),
		    
		    ## blocks of centers 
		    (assign, ":slot_no", 0),
		    (try_for_range, ":center_no", centers_begin, centers_end),
		      (party_is_active, ":center_no"),
		      (party_get_position, pos4, ":center_no"),
		      (position_get_x, ":center_x", pos4),
		      (position_get_y, ":center_y", pos4),
		      (val_sub, ":center_x", ":init_map_x"),
		      (val_sub, ":center_y", ":init_map_y"),
		      (val_mul, ":center_x", ":color_block_length"),
		      (val_mul, ":center_y", ":color_block_length"),
		      (val_div, ":center_x", ":party_move_length"),
		      (val_div, ":center_y", ":party_move_length"),
		      (val_add, ":center_x", ":init_pos_x"),
		      (val_add, ":center_y", ":init_pos_y"),
		      # offset and size
		      (try_begin),
		        (party_slot_eq, ":center_no", slot_party_type, spt_town),
		        (assign, ":block_size", 8),
		        (assign, ":center_type", spt_town),
		      (else_try),
		        (party_slot_eq, ":center_no", slot_party_type, spt_castle),
		        (assign, ":block_size", 4),
		        (assign, ":center_type", spt_castle),
		      (else_try),
		        (party_slot_eq, ":center_no", slot_party_type, spt_village),
		        (assign, ":block_size", 2),
		        (assign, ":center_type", spt_village),
		      (try_end),
		      (try_begin),
		      	  # double size if fiefs node
		          (eq, g.type_mapnode, 3),	
		          (try_begin),
		          		(neq,":center_type", spt_town),
		          		(val_mul, l.block_size, 2),		          	              
		          (else_try),
		          	    (val_add, l.block_size, 3),		          
		          (try_end), 
		      (try_end),

		      (store_div, ":half_block_size", ":block_size", 2),
		      (val_sub, ":center_x", ":half_block_size"),
		      (val_sub, ":center_y", ":half_block_size"),
		      (val_mul, ":block_size", 50),
		      # block
		      (create_mesh_overlay, reg0, mesh.white_plane),

		      (try_begin),
		      	# fiefs report
				(eq, g.type_mapnode, 3),
				(party_get_slot, l.condition_fief, l.center_no, slot_village_state),
				(party_get_slot, l.infested_bandit, l.center_no, slot_village_infested_by_bandits),

				(try_begin),
					(this_or_next|eq, l.condition_fief, 2),
					(eq, l.condition_fief, 4),
					(overlay_set_color, reg0, color_fief_destroyed),				    
				(else_try),
					(this_or_next|eq, l.condition_fief, 1),
					(this_or_next|eq, l.condition_fief, 5),
					(gt, l.infested_bandit, 0),
					(overlay_set_color, reg0, color_fief_under_attack),	
				(else_try),
					(eq, l.condition_fief, 3),
					(overlay_set_color, reg0, color_fief_recovering),		
				(else_try),
					(eq, l.condition_fief, 0),
					(overlay_set_color, reg0, color_fief_normal),				
				(else_try),
					(assign, reg50, l.center_no),
					(assign, reg51, l.condition_fief),
					(assign, reg52, l.infested_bandit),						
					(error, s.wm_error3),		    
				(try_end),
		          
		      (else_try),
		      	# default reports
		      	(overlay_set_color, reg0, 0),		          
		      (try_end),

		      (position_set_x, pos1, ":center_x"),
		      (position_set_y, pos1, ":center_y"),
		      (overlay_set_position, reg0, pos1),
		      (position_set_x, pos1, ":block_size"),
		      (position_set_y, pos1, ":block_size"),
		      (overlay_set_size, reg0, pos1),
		      # name
		      (str_store_party_name, s1, ":center_no"),
		      (create_text_overlay, reg1, s1, tf_center_justify),
		      (store_add, ":text_x", ":center_x", 0),
		      (store_add, ":text_y", ":center_y", 10),
		      (position_set_x, pos1, ":text_x"),
		      (position_set_y, pos1, ":text_y"),
		      (overlay_set_position, reg1, pos1),
		      (overlay_set_display, reg1, 0),
		      # slots
		      (troop_set_slot, "trp_temp_array_a", ":slot_no", reg0), # overlay id
		      (troop_set_slot, "trp_temp_array_b", ":slot_no", ":center_type"), # center type
		      (troop_set_slot, "trp_temp_array_c", ":slot_no", reg1), # center name
		      (val_add, ":slot_no", 1),
		    (try_end),
		    (assign, "$temp", ":slot_no"), # record num of slots

		    (try_begin),
			    # color coded by faction ## blocks of kingdoms 
			    (eq, g.type_mapnode, 0),			   	   

			    (ui_create_mesh, reg20, mesh.white_plane, 650, 20, 1000*15, 1000*35), 
			    (overlay_set_color, reg20, 0xFFE0B2),	
			    
			    (ui_create_label, reg0, s.wm_kingdoms, 700-20, 680, 
			    	tf_left_align ,
			    	1500),
			    
			    (assign, ":pos_x", 700-20),
			    (assign, ":pos_y", 650),
			    (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
			      (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
			      # color block
			      (create_mesh_overlay, reg0, mesh.white_plane),
			      (faction_get_color, ":dest_color", ":cur_kingdom"),
			      (overlay_set_color, reg0, ":dest_color"),
			      (position_set_x, pos1, ":pos_x"),
			      (position_set_y, pos1, ":pos_y"),
			      (overlay_set_position, reg0, pos1),
			      # size: 35*25
			      (position_set_x, pos1, 35*50),
			      (position_set_y, pos1, 20*50),#35*50
			      (overlay_set_size, reg0, pos1),
			      # kingdom name
			      (store_add, ":text_x", ":pos_x", 40),
			      (store_add, ":text_y", ":pos_y", 12),
			      (str_store_faction_name, s1, ":cur_kingdom"),
			      (create_text_overlay, reg0, s1, tf_vertical_align_center),
			      (position_set_x, pos1, ":text_x"),
			      (position_set_y, pos1, ":text_y"),
			      (overlay_set_position, reg0, pos1),
			      (position_set_x, pos1, 900),
			      (position_set_y, pos1, 900),
			      (overlay_set_size, reg0, pos1),
			      (val_sub, ":pos_y", 30),
			    (try_end),
			(else_try),
				# color coded by Relations
				(eq, g.type_mapnode, 1),

			    (ui_create_mesh, reg20, mesh.white_plane, 650, 200, 1000*15, 1000*20), 
			    (overlay_set_color, reg20, 0xFFE0B2),	
			    
			    (ui_create_label, reg0, s.wm_diplomacy, 650+30, 200+350, 
			    	tf_left_align ,
			    	1500),	

				(assign, ":pos_x", 650+50),
			    (assign, ":pos_y", 200+350-50-20),

			    (ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_you),
			    (ui_create_label, reg0, s.wm_your_faction, l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 40),

			    (ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_plus_50),
			    (ui_create_label, reg0, s.wm_legend_more_50, l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 40),

			    (ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_plus_1),
			    (ui_create_label, reg0, s.wm_legend_more_0 , l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 40),	

				(ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_minus_0),
			    (ui_create_label, reg0, s.wm_legend_more_minus_10, l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 40),	

				(ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_minus_10),
			    (ui_create_label, reg0, s.wm_legend_more_minus_50, l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 40),

				(ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_minus_50),
			    (ui_create_label, reg0, s.wm_legend_more_minus_100, l.pos_x + 30, l.pos_y-5),	    
			     
			(else_try),
				# Color coded by religion
				(eq, g.type_mapnode, 2),

			    (ui_create_mesh, reg20, mesh.white_plane, 650, 400, 1000*15, 1000*10), 
			    (overlay_set_color, reg20, 0xFFE0B2),
			    
			    (ui_create_label, reg0, s.wm_religions, 650+30, 400+150, 
			    	tf_left_align,
			    	1500),

				(assign, ":pos_x", 650+30+50),
			    (assign, ":pos_y", 400+150-50-20),

			    (ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_pagan),
			    (ui_create_label, reg0, s.wm_pagans , l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 60),

			    (ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_christian),
			    (ui_create_label, reg0, s.wm_christians, l.pos_x + 30, l.pos_y-5),

			(else_try),
				# fiefs
				(eq, g.type_mapnode, 3),

			    (ui_create_mesh, reg20, mesh.white_plane, 650, 200, 1000*15, 1000*20), 
			    (overlay_set_color, reg20, 0xFFE0B2),	
			    
			    (ui_create_label, reg0, s.wm_fiefs, 650+30, 200+350, 
			    	tf_left_align ,
			    	1500),	

				(assign, ":pos_x", 650+50),
			    (assign, ":pos_y", 200+350-50-20),

			    (ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_fief_normal),
			    (ui_create_label, reg0, s.wm_fief_normal, l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 40),

			    (ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_fief_recovering),
			    (ui_create_label, reg0, s.wm_fief_recovering, l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 40),

			    (ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_fief_under_attack),
			    (ui_create_label, reg0, s.wm_fief_under_attack, l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 40),	

				(ui_create_mesh, reg0, mesh.white_plane, l.pos_x, l.pos_y, 1000*1, 1000*1),
			    (overlay_set_color, reg0, color_fief_destroyed),
			    (ui_create_label, reg0, s.wm_fief_looted, l.pos_x + 30, l.pos_y-5),
			    (val_sub, l.pos_y, 40),				

			(try_end), 
		    
		    # Done
		    (create_game_button_overlay, "$g_presentation_obj_5", "str_done"),
		    (position_set_x, pos1, 120),
		    (position_set_y, pos1, 25),
		    (overlay_set_position, "$g_presentation_obj_5", pos1),

		    # Next presentation type
		    (create_game_button_overlay, "$g_presentation_obj_6", s.wm_next_mapnode),
		    (position_set_x, pos1, 120+160),
		    (position_set_y, pos1, 25),
		    (overlay_set_position, "$g_presentation_obj_6", pos1),

		  ]),

		(ti_on_presentation_mouse_enter_leave,
		  [
		    (store_trigger_param_1, ":object"),
		    (store_trigger_param_2, ":enter_leave"),
		    
		    # show center name when mouse on it
		    (try_for_range, ":slot_no", 0, "$temp"),
		      (troop_slot_eq, "trp_temp_array_a", ":slot_no", ":object"),
		      (store_sub, ":display_overlay", 1, ":enter_leave"),
		      (troop_get_slot, ":cur_overlay", "trp_temp_array_c", ":slot_no"),
		      (overlay_set_display, ":cur_overlay", ":display_overlay"),
		    (try_end),
		  ]),

		(ti_on_presentation_event_state_change,
		  [
		    (store_trigger_param_1, l.object),
		    (store_trigger_param_2, l.value),
		    (assign, reg50, g.type_mapnode),
		    (try_begin),
		      	(eq, l.object, g.g_presentation_obj_5),
		      	(start_presentation, prsnt.character_screen_main),

		    (else_try),
		    	(eq, l.object, g.g_presentation_obj_6),
		    	(val_add, g.type_mapnode, 1),
		    	(try_begin),
		    		(gt, g.type_mapnode, 3),		    	    
		    		(assign, g.type_mapnode, 0),
		    	(try_end),

		    	(assign, reg50, g.type_mapnode),
		    	(start_presentation, prsnt.world_map), 		        
		    (try_end),
		  ]),
		]),
] 

injection = {
	'plugin_prst_world_map_new_button_load' : [
		#Kalarhan - WorldMap - Start
		(position_set_x, 1, 578),
		(position_set_y, 1, 25),
		(overlay_set_position, "$g_presentation_obj_2", 1),

		(create_game_button_overlay, "$g_presentation_obj_world_map", s.wm_button_open_mapnodes),
		(position_set_x, 1, 740),
		(position_set_y, 1, 25),
		(overlay_set_position, "$g_presentation_obj_world_map", 1),
		#Kalarhan - WorldMap - End    
	],

	'plugin_prst_world_map_new_button_event' : [
		# Kalarhan WorldMap - Start
		(else_try),
			(eq, "$g_presentation_obj_world_map", ":local_1"),
			(str_clear, 1),
			(info, s.wm_start_presentation),
			(assign, "$g_presentations_next_presentation", -1),
			(start_presentation, "prsnt_world_map"),
		# Kalarhan WorldMap - End   

	],
}




   
Code:
#################################################################
###      INJECT POINTS FOR PLUGINS 							  ###
#################################################################

# PRESENTATIONS (module_presentations.py)

	1) "character_screen_main"
			(overlay_set_position, "$g_presentation_obj_2", 1),
			inject('plugin_prst_world_map_new_button_load'),
			(create_text_overlay, reg1, "@Name:_^{playername}", 16),

	2) "character_screen_main"
			(overlay_set_position, "$g_presentation_obj_11", 1),
			# New button for heroes: vassals, kings, companions....
			inject('plugin_prst_companions_button'),

			(try_begin),
			  (eq, "$temp", 2),

	3) "character_screen_main"

				(call_script, "script_texto_courtship_relation"),
				(start_presentation, "prsnt_character_screen_main"),

				inject('plugin_prst_world_map_new_button_event'),
				inject('plugin_prst_companions_button_event'),

			(try_end),

	4) "troop_tree": trigger -60 (load)

              (overlay_set_position, "$presentation_leave_button", 1),
              inject('plugin_prst_prstn_troop_tree_2'),
          ]),

  5) "troop_tree": after ending of triggers to add mouse_over and mouse_click

	              ]),

	          inject('plugin_prst_prstn_troop_tree_3'),
	      ]),

	6) "troop_tree": start of the presentation to change layout of slider

              (presentation_set_duration, 999999),
              (set_fixed_point_multiplier, 1000),

              (create_text_overlay, reg1, "@Troop_Tree", 16),
              (position_set_x, 1, 500),
              (position_set_y, 1, 685),
              (overlay_set_position, reg1, 1),

              inject('plugin_prst_prstn_troop_tree_1a'), # hides old text

              (create_text_overlay, reg1, "@From_Troop:_", 8),
              (position_set_x, 1, 450),
              (position_set_y, 1, 650),

              inject('plugin_prst_prstn_troop_tree_1b'), # higher Y

              (overlay_set_position, reg1, 1),
              (create_combo_button_overlay, "$g_presentation_obj_sliders_1"),
              (position_set_x, 1, 580),
              (position_set_y, 1, 645),

              inject('plugin_prst_prstn_troop_tree_1b'), # higher Y

              (overlay_set_position, "$g_presentation_obj_sliders_1", 1), 
      


# SCRIPTS (module_scripts.py)

	1) "troop_tree_recurse"

      ("troop_tree_recurse", [
        (store_script_param, ":local_1", 1), # troop_id
        (store_script_param, ":local_2", 2), # center_x
        (store_script_param, ":local_3", 3), # center_y
        (store_script_param, ":local_4", 3), # parameter 4

        # fix max height
        inject('plugin_prst_script_troop_tree_recurse_1'), # after parameters

  2) "troop_tree_recurse"

      (create_mesh_overlay_with_tableau_material, reg1, -1, "tableau_troop_tree_pic", reg2),
      # saves data to array
      inject('plugin_prst_script_troop_tree_recurse_1'),


How to install: http://forums.taleworlds.com/index.php/topic,328368.msg7758570.html#msg7758570
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Mapnode:

Factions:
mapnode_factions.jpg


Diplomacy:
mapnode_diplomacy.jpg


Fiefs in the world (towns, villages, castles and if they are under attack):
mapnode_fief.jpg


Religion of factions:
mapnode_religion.jpg


Character Screen with new buttons (Heroes and MapNodes):
char_main_screen.jpg
 

kalarhan

Python Saint
Count
WBNWVCWF&S
mike56 said:
You should be recruited by the VC team, seriously.

I am just doing what they could not: add bunch of OSP code to the game  :wink: . I have some original work, but mostly is taking the great ideas from the community and adding them to VC.

Any suggestion for the mapnodes?

Edit: new screens uploaded
 

sirgzu

Regular
WBWF&S
kalarhan said:
mike56 said:
You should be recruited by the VC team, seriously.

I am just doing what they could not: add bunch of OSP code to the game  :wink: . I have some original work, but mostly is taking the great ideas from the community and adding them to VC.

Any suggestion for the mapnodes?

Edit: new screens uploaded
I'd recommend changing the colour scale for diplomacy map. It's hard to read with all those colours.
Apart from that, great job, keep it up :smile:
 

kalarhan

Python Saint
Count
WBNWVCWF&S
sirgzu said:
I'd recommend changing the colour scale for diplomacy map. It's hard to read with all those colours.
Apart from that, great job, keep it up :smile:

Thanks for the feedback.

Finding colours that look good on that map is painful, they are not *printed* as you would expected lol . As anything it is full moddable so anyone that wants a new colour scheme can get the code and recompile it. Make a pure grey-scale, etc. Or change it on the text files (also easy).

My aim was to make each mapnode in about 15minutes (my personal mod has a few more  :razz: ) and that is the result  :mrgreen:

I will most likely publish the code tomorrow or Friday so people can play it with

Cheers

 

kalarhan

Python Saint
Count
WBNWVCWF&S
Hey guys,

this OSP pack was created for 1.04. The code is still available, as is the text files for that version.

I will not update this for VC RE at this time, but feel free to use it yourself of course.  :smile:
 
Status
Not open for further replies.
Top Bottom