OSP Code SP The World Map to show the exact realm of factions

Users who are viewing this thread

Somebody said:
Very nice, but the colour overlay doesn't seem to be deep enough. Do those icons replace the dots or are they simple on the underlaying mesh? Also, here's a link to the map poster out of interest.

The city/castle/village icons replace the dots and are fully functioning with mouseovers, checkboxes etc. The color overlay is something I'm still fine-tuning as it's a balance between being clear enough to read properly, yet not so bright as to look wrong, or clash with the icons.

I did use the Map Poster as a guide on where to put Mountains, but indeed my map is not quite as elegant, code-wise, as the original, in that the paintover needs re-tuning if you change the terrain.

I don't see that as a real problem, as I am not changing the terrain for my mod, and even if I was, it was simply a matter of waiting until the new terrain was done, and modifying the paintover. It's an awesome piece of coding by rubik though, and the code I use for mine is still 98% his, just a few simple changes on my part.

More opaque overlays, step 1:
worldmap_wip2.jpg
More opaque overlays, step 2:
worldmap_wip3.jpg
More opaque overlays, step 3:
worldmap_wip4.jpg

I like step 2 best, for a balance between colors and overall look.
 
Well, this is the final result, or at least a level I'm satisfied enough with to move onto other parts of my mod. I went through a lot of iterations, even trying crosshatches instead of colors (I didn't much like the effect, it got too gritty, even though I feel the colored overlay somewhat detracts from the medieval feel).

worldmap_wip5.jpg
 
rubik said:
dunde said:
A little suggestion. Borderlines will be nice for this amazing presentation.

Like these below?

54726830201210181247031229072618682_000.jpg


54726830201210181247031229072618682_001.jpg

Yes. Just like that. One more thing. When a town has a village as it's neighbor and the village's bounded center is not the town, it will be better if the borderline between the two is closer to the village instead of right in the middle between. The same goes for  a town and a castle, or a castle and a village.
 
An adaptation for original mount and blade (v1.011).

As there was no get_faction_color command it's first needed to create slots and store faction colors there.
As there was no overlay_set_display command, the only way I found to adapt the script is to redraw the map (restart the presentation) every time a setting change (don't know if there is a more efficient way, I'm not a specialist of presentations).
Finally, instead of mouse over to display names (which wasn't working well because map has to be redrawn for each state), my map display all names when names are selected (with different sizes according to how many center types are selected).
On the plus side, added distance limits to provinces sizes and some code to show mountains, and show which centers are looted/sieged.

Code:
	  
# (in game_start script) storing faction colors 
      (faction_set_slot, "fac_kingdom_1", slot_faction_color, 0xDD8844),
     (faction_set_slot, "fac_kingdom_2", slot_faction_color, 0x33DD33),
     (faction_set_slot, "fac_kingdom_3", slot_faction_color, 0xCC99FF),
      (faction_set_slot, "fac_kingdom_4", slot_faction_color, 0xDDDD33),
      (faction_set_slot, "fac_kingdom_5", slot_faction_color, 0x33DDDD),

	  # global variables
	  (assign, "$world_map_display_towns", 1),
	  (assign, "$world_map_display_castles", 0),
	  (assign, "$world_map_display_villages", 0),
	  (assign, "$world_map_display_mountains", 1),
	  (assign, "$world_map_display_names", 1),

# I also use a little script to get castle short names (the name without castles, you need to have first copied the castle names without "Castle" in the correct order in strings)

 ("get_castle_short_name",
    [
     (store_script_param, ":castle_no", 1),	
	 (val_add, ":castle_no", "str_castlename_1"),
	 (val_sub, ":castle_no", "p_castle_1"),
	 (assign, reg0, ":castle_no"),
	 ]),

Code:
   
 ("world_map", 0, mesh_load_window, [
 (ti_on_presentation_load,
      [
        (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),
        
      ## 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", -180*1000),
        (assign, ":max_map_x", 180*1000),
        (assign, ":min_map_y", -145*1000),
        (assign, ":max_map_y", 145*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, ":party_move_length", 2*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", 4),
        (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", dark_gray), # 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),
              (eq, ":current_terrain", rt_water),
              (assign, ":dest_color", blue), # default
            (else_try),
			  (eq, ":current_terrain", rt_mountain),
			  (eq, "$world_map_display_mountains", 1),
			  (assign, ":dest_color", dark_gray),
			(else_try),  
              (call_script, "script_get_closest_center", "p_temp_party"),
              (assign, ":nearest_center", reg0),
				  (try_begin),
					(gt, ":nearest_center", -1),
					(store_distance_to_party_from_party, ":dist", "p_temp_party", ":nearest_center"),
					(lt, ":dist", 25),
					(store_faction_of_party, ":center_faction", ":nearest_center"),
					(is_between, ":center_faction", kingdoms_begin, kingdoms_end),
					(faction_get_slot, ":dest_color", ":center_faction", slot_faction_color),
				  (try_end),
			(else_try),
              (assign, ":dest_color", gray),			
            (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
            
            ## draw borderlines begin [optional]
            # borderlines length and whidth
			(try_begin),
			(eq, "$world_map_display_mountains", 0),
			
				(store_add, ":line_length", ":color_block_size", 1*50),
				(assign, ":line_whidth", 1*50),
				# find bound_center
				(try_begin),
				  (this_or_next|party_slot_eq, ":nearest_center", slot_party_type, spt_town),
				  (party_slot_eq, ":nearest_center", slot_party_type, spt_castle),
				  (assign, ":bound_center", ":nearest_center"), # itself
				(else_try),
				  (party_slot_eq, ":nearest_center", slot_party_type, spt_village),
				  (party_get_slot, ":bound_center", ":nearest_center", slot_village_bound_center),
				(try_end),
				# compare with the left side color block
				(try_begin),
				  (store_sub, ":map_x_2", ":map_x", ":party_move_length"),
				  (assign, ":map_y_2", ":map_y"),
				  (position_set_x, pos4, ":map_x_2"),
				  (position_set_y, pos4, ":map_y_2"),
				  (party_set_position, "p_temp_party", pos4),
				  (party_get_current_terrain, ":current_terrain_2", "p_temp_party"),
				  (try_begin),
					(assign, ":continue", 0),
					
					(try_begin),
						  (neq, ":current_terrain", rt_water),
						  (neq, ":current_terrain_2", rt_water),
						  (call_script, "script_get_closest_center", "p_temp_party"),
						  (assign, ":nearest_center_2", reg0),
						  (try_begin),
						  (gt, ":nearest_center_2", -1),
						  (store_distance_to_party_from_party, ":dist", "p_temp_party", ":nearest_center_2"),
						  (lt, ":dist", 25),
								(try_begin),
								  (this_or_next|party_slot_eq, ":nearest_center_2", slot_party_type, spt_town),
								  (party_slot_eq, ":nearest_center_2", slot_party_type, spt_castle),
								  (assign, ":bound_center_2", ":nearest_center_2"), # itself
								(else_try),
								  (party_slot_eq, ":nearest_center_2", slot_party_type, spt_village),
								  (party_get_slot, ":bound_center_2", ":nearest_center_2", slot_village_bound_center),
								(try_end),
						   (neq, ":bound_center_2", ":bound_center"),
						   (assign, ":continue", 1),
						  (try_end),
					(else_try),
						  (neq, ":current_terrain", ":current_terrain_2"),
						  (this_or_next|eq, ":current_terrain", rt_water),
						  (eq, ":current_terrain_2", rt_water),
						  (neq, ":current_terrain", rt_mountain),
						  (assign, ":continue", 1),
					(try_end),
					
					(eq, ":continue", 1),
					(create_mesh_overlay, reg0, "mesh_white_plane"),
					(overlay_set_color, reg0, 0),
					(position_set_x, pos1, ":pos_x"),
					(position_set_y, pos1, ":pos_y"),
					(overlay_set_position, reg0, pos1),
					(position_set_x, pos1, ":line_whidth"),
					(position_set_y, pos1, ":line_length"),
					(overlay_set_size, reg0, pos1),
				  (try_end),
				(try_end),
				# compare with the under color block
				(try_begin),
				  (assign, ":map_x_2", ":map_x"),
				  (store_sub, ":map_y_2", ":map_y", ":party_move_length"),
				  (position_set_x, pos4, ":map_x_2"),
				  (position_set_y, pos4, ":map_y_2"),
				  (party_set_position, "p_temp_party", pos4),
				  (party_get_current_terrain, ":current_terrain_2", "p_temp_party"),
				  (try_begin),
					(assign, ":continue", 0),
					(try_begin),
					  (neq, ":current_terrain", rt_water),
					  (neq, ":current_terrain_2", rt_water),
					  (call_script, "script_get_closest_center", "p_temp_party"),
					  (assign, ":nearest_center_2", reg0),
					  (try_begin),
						  (gt, ":nearest_center_2", -1),
						  (store_distance_to_party_from_party, ":dist", "p_temp_party", ":nearest_center_2"),
						  (lt, ":dist", 25),
						(try_begin),
						  (this_or_next|party_slot_eq, ":nearest_center_2", slot_party_type, spt_town),
						  (party_slot_eq, ":nearest_center_2", slot_party_type, spt_castle),
						  (assign, ":bound_center_2", ":nearest_center_2"),
						(else_try),
						  (party_slot_eq, ":nearest_center_2", slot_party_type, spt_village),
						  (party_get_slot, ":bound_center_2", ":nearest_center_2", slot_village_bound_center),
						(try_end),
						(neq, ":bound_center_2", ":bound_center"),
						(assign, ":continue", 1),
					  (try_end),
					(else_try),
					  (neq, ":current_terrain", ":current_terrain_2"),
					  (this_or_next|eq, ":current_terrain", rt_water),
					  (eq, ":current_terrain_2", rt_water),
					  (neq, ":current_terrain", rt_mountain),
					  (assign, ":continue", 1),
					(try_end),
					(eq, ":continue", 1),
					(create_mesh_overlay, reg0, "mesh_white_plane"),
					(overlay_set_color, reg0, 0),
					(position_set_x, pos1, ":pos_x"),
					(position_set_y, pos1, ":pos_y"),
					(overlay_set_position, reg0, pos1),
					(position_set_x, pos1, ":line_length"),
					(position_set_y, pos1, ":line_whidth"),
					(overlay_set_size, reg0, pos1),
				  (try_end),
				(try_end),
	   (try_end),
				## draw borderlines end [optional]
            
				# 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),
			(eq, "$world_map_display_towns", 1),
            (assign, ":block_size", 8),
            (assign, ":center_type", spt_town),
          (else_try),
            (party_slot_eq, ":center_no", slot_party_type, spt_castle),
			(eq, "$world_map_display_castles", 1),
            (assign, ":block_size", 4),
            (assign, ":center_type", spt_castle),
          (else_try),
            (party_slot_eq, ":center_no", slot_party_type, spt_village),
			(eq, "$world_map_display_villages", 1),
            (assign, ":block_size", 2),
            (assign, ":center_type", spt_village),
		  (else_try),
            (assign, ":block_size", -1),		  
          (try_end),
		  
		  (try_begin),
			  (gt, ":block_size", 1),
			  (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),
					(this_or_next|party_slot_eq, ":center_no", slot_village_state, svs_under_siege),
					(this_or_next|party_slot_eq, ":center_no", slot_village_state, svs_looted),
					(party_slot_eq, ":center_no", slot_village_state, svs_deserted),
					(assign, ":color", dark_red),
					(else_try),					  
				    (assign, ":color", black),
				    (try_end),
			  (overlay_set_color, reg0, ":color"),
			  (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),
		  (try_end),
		  
		  
          # name
		  (try_begin),
			  (eq, "$world_map_display_names", 1),
			  (assign, ":continue", 0),
				  (try_begin),
					  (party_slot_eq, ":center_no", slot_party_type, spt_town),
					  (eq, "$world_map_display_towns", 1),
					  (str_store_party_name, s1, ":center_no"),
						  (try_begin),
						  (this_or_next|eq, "$world_map_display_villages", 1),
						  (eq, "$world_map_display_castles", 1),
						  (position_set_x, pos2, 700),
						  (position_set_y, pos2, 900),
						  (store_add, ":text_y", ":center_y", 7),
						  (else_try),
						  (position_set_x, pos2, 1000),
						  (position_set_y, pos2, 1000),
						  (store_add, ":text_y", ":center_y", 10),
						  (try_end),
					 	  (try_begin),
						  (party_slot_eq, ":center_no", slot_village_state, svs_under_siege),
						  (assign, ":color", dark_red),
						  (else_try),					  
						  (assign, ":color", black),
						  (try_end),
					  (assign, ":continue", 1),
					  (else_try),
					  (party_slot_eq, ":center_no", slot_party_type, spt_castle),
					  (eq, "$world_map_display_castles", 1),
					  (call_script, "script_get_castle_short_name", ":center_no"),
                      (str_store_string, s1, reg0),
					      (try_begin),
						  (eq, "$world_map_display_towns", 0),
						  (position_set_x, pos2, 700),
					      (position_set_y, pos2, 800),
						  (store_add, ":text_y", ":center_y", 5),
						  (else_try),
					      (position_set_x, pos2, 500),
					      (position_set_y, pos2, 600),
						  (store_add, ":text_y", ":center_y", 3),
						  (try_end),
						  (try_begin),
						  (party_slot_eq, ":center_no", slot_village_state, svs_under_siege),
						  (assign, ":color", dark_red),
						  (else_try),					  
						  (assign, ":color", dark_brown),
						  (try_end),
					  (assign, ":continue", 1),
					  (else_try),
					  (party_slot_eq, ":center_no", slot_party_type, spt_village),
					  (eq, "$world_map_display_villages", 1),
					  (str_store_party_name, s1, ":center_no"),
					  (assign, ":continue", 1),
						  (try_begin),
						  (eq, "$world_map_display_towns", 0),
						  (eq, "$world_map_display_castles", 0),
						  (position_set_x, pos2, 500),
						  (position_set_y, pos2, 600),
						  (store_add, ":text_y", ":center_y", 3),
						  (else_try),
						  (eq, "$world_map_display_castles", 0),
						  (position_set_x, pos2, 400),
						  (position_set_y, pos2, 500),
						  (store_add, ":text_y", ":center_y", 2),
						  (else_try),
					      (position_set_x, pos2, 400),
						  (position_set_y, pos2, 450),
						  (store_add, ":text_y", ":center_y", 2),
						  (try_end),
						  (try_begin),
						  (this_or_next|party_slot_eq, ":center_no", slot_village_state, svs_looted),
						  (party_slot_eq, ":center_no", slot_village_state, svs_deserted),
						  (assign, ":color", dark_red),
						  (else_try),
					      (assign, ":color", dark_gray),
						  (try_end),
				 (try_end),
			  (eq, ":continue", 1),	 
			  (create_text_overlay, reg1, s1, tf_center_justify),
			  (overlay_set_color, reg1, ":color"),
			  (store_add, ":text_x", ":center_x", 3),
			  (position_set_x, pos1, ":text_x"),
			  (position_set_y, pos1, ":text_y"),
			  (overlay_set_position, reg1, pos1),
			  (overlay_set_size, reg1, pos2),
		 (try_end),
		 (try_end),
		  
        #  (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", ":center_no"), # center name
          (val_add, ":slot_no", 1),

         (assign, "$temp", ":slot_no"), # record num of slots
        
        ## blocks of kingdoms 
        (create_text_overlay, reg0, "@Factions", tf_vertical_align_center),
        (position_set_x, pos1, 790),
        (position_set_y, pos1, 700),
        (overlay_set_position, reg0, pos1),
        
        (assign, ":pos_x", 750),
        (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_slot, ":dest_color", ":cur_kingdom", slot_faction_color),
          (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, 25*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", 40),
        (try_end),
        
        ## show centers or not
         # towns
		(try_begin),
        (eq, "$world_map_display_towns", 0),		
        (create_game_button_overlay, "$g_presentation_obj_1", "@Show towns"),
        (position_set_x, pos1, 100),
        (position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_1", pos1),
		(else_try),
		(eq, "$world_map_display_towns", 1),
		(create_game_button_overlay, "$g_presentation_obj_1", "@Don't show towns"),
        (position_set_x, pos1, 100),
        (position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_1", pos1),
		(try_end),
        # castles
		(try_begin),
		(eq, "$world_map_display_castles", 0),
        (create_game_button_overlay, "$g_presentation_obj_2", "@Show castles"),
        (position_set_x, pos1, 300),
        (position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_2", pos1),
		(else_try),
	    (eq, "$world_map_display_castles", 1),
        (create_game_button_overlay, "$g_presentation_obj_2", "@Don't show castles"),
        (position_set_x, pos1, 300),
        (position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_2", pos1),
		(try_end),
        # villages
		(try_begin),
		(eq, "$world_map_display_villages", 0),
        (create_game_button_overlay, "$g_presentation_obj_3", "@Show villages"),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_3", pos1),
		(else_try),
		(eq, "$world_map_display_villages", 1),
		(create_game_button_overlay, "$g_presentation_obj_3", "@Don't show villages"),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_3", pos1),
		(try_end),
		# mountains
		(try_begin),
		(eq, "$world_map_display_mountains", 0),
        (create_game_button_overlay, "$g_presentation_obj_4", "@Show mountains"),
        (position_set_x, pos1, 700),
		(position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_4", pos1),
        (else_try),
		(create_game_button_overlay, "$g_presentation_obj_4", "@Show provinces"),
        (position_set_x, pos1, 700),
        (position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_4", pos1),
		(try_end),
	    # names
		(try_begin),
		(eq, "$world_map_display_names", 0),
        (create_game_button_overlay, "$g_presentation_obj_5", "@Show names"),
        (position_set_x, pos1, 900),
		(position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_5", pos1),
        (else_try),
		(create_game_button_overlay, "$g_presentation_obj_5", "@Don't show names"),
        (position_set_x, pos1, 900),
        (position_set_y, pos1, 100),
        (overlay_set_position, "$g_presentation_obj_5", pos1),
		(try_end),
        (create_text_overlay, reg0, "@Red dots mean sieged centers or looted villages.", tf_vertical_align_center),
        (position_set_x, pos1, 50),
        (position_set_y, pos1, 170),
        (overlay_set_position, reg0, pos1),
        (position_set_x, pos1, 750),
        (position_set_y, pos1, 750),
        (overlay_set_size, reg0, pos1),
        
        (create_text_overlay, reg0, "@The World Map", tf_double_space|tf_center_justify),
        (position_set_x, pos1, 380),
        (position_set_y, pos1, 30),
        (overlay_set_position, reg0, pos1),
        (position_set_x, pos1, 2000),
        (position_set_y, pos1, 2000),
        (overlay_set_size, reg0, pos1),
        
        # Done
        (create_game_button_overlay, "$g_presentation_obj_6", "@Done"),
        (position_set_x, pos1, 900),
        (position_set_y, pos1, 25),
        (overlay_set_position, "$g_presentation_obj_6", pos1),
      ]),
  
    (ti_on_presentation_event_state_change,
      [
        (store_trigger_param_1, ":object"),
        
        (try_begin),
          (eq, ":object", "$g_presentation_obj_1"), # show towns
		  (eq, "$world_map_display_towns", 0),
	      (assign, "$world_map_display_towns", 1),
		  (start_presentation, "prsnt_world_map"),
		(else_try),
          (eq, ":object", "$g_presentation_obj_1"), # don't show towns
		  (eq, "$world_map_display_towns", 1),
	      (assign, "$world_map_display_towns", 0),
		  (start_presentation, "prsnt_world_map"),		
        (else_try),
          (eq, ":object", "$g_presentation_obj_2"), # don't show castles
		  (eq, "$world_map_display_castles", 1),
		  (assign, "$world_map_display_castles", 0),
          (start_presentation, "prsnt_world_map"),
		(else_try),
          (eq, ":object", "$g_presentation_obj_2"), # show castles
		  (eq, "$world_map_display_castles", 0),
		  (assign, "$world_map_display_castles", 1),
          (start_presentation, "prsnt_world_map"),
        (else_try),
          (eq, ":object", "$g_presentation_obj_3"), # don't show villages
		  (eq, "$world_map_display_villages", 1),
		  (assign, "$world_map_display_villages", 0),
          (start_presentation, "prsnt_world_map"),
       (else_try),
          (eq, ":object", "$g_presentation_obj_3"), # show villages
		  (eq, "$world_map_display_villages", 0),
		  (assign, "$world_map_display_villages", 1),
          (start_presentation, "prsnt_world_map"),
		(else_try),
          (eq, ":object", "$g_presentation_obj_4"), # show mountains
		  (eq, "$world_map_display_mountains", 0),
		  (assign, "$world_map_display_mountains", 1),
          (start_presentation, "prsnt_world_map"),
		(else_try),
          (eq, ":object", "$g_presentation_obj_4"), # don't show mountains
		  (eq, "$world_map_display_mountains", 1),
		  (assign, "$world_map_display_mountains", 0),
          (start_presentation, "prsnt_world_map"),
		(else_try),
          (eq, ":object", "$g_presentation_obj_5"), # show names
		  (eq, "$world_map_display_names", 0),
		  (assign, "$world_map_display_names", 1),
          (start_presentation, "prsnt_world_map"),
		(else_try),
          (eq, ":object", "$g_presentation_obj_5"), # don't show names
		  (eq, "$world_map_display_names", 1),
		  (assign, "$world_map_display_names", 0),
          (start_presentation, "prsnt_world_map"),
        (else_try),
          (eq, ":object", "$g_presentation_obj_6"),
          (presentation_set_duration, 0),
        (try_end),
		
      ]),
]),

worldmap2.jpg



ps/edit : forgot that I used the script get_castle_short_name, added it (the list of castles short names need to be added to strings first of course)
pps : also forgot that I used constants for colors (I declared in constants that dark_gray = "0xFF808080" etc...), so for the code to work you need to either add these color values as constants or replace color names with appropriate hexadecimal values (ie : "0xFF0000A0" for blue, "0xFF800000" for dark_red, "0xFF804000" for dark_brown).
 
Simply, you can use overlay_set_alpha instead of overlay_set_display. Just need to change the code slightly, no need to redraw the map.
            (troop_get_slot, ":cur_overlay", "trp_temp_array_a", ":slot_no"),
            (overlay_set_display,
":cur_overlay", ":value"),
Change to the following(3 places):
            (troop_get_slot, ":cur_overlay", "trp_temp_array_a", ":slot_no"),
            (store_mul,
":eek:verlay_display", ":value", 0xFF),
            (overlay_set_alpha,
":cur_overlay", ":eek:verlay_display"),


 
I don't know how i missed this topic until now...

but this is just so nice :smile:).

Thank you rubik for the inspirations :grin:, and Mekelan, that's some extreme graphic improvements you made to it :razz:.
 
I'm sorry for this necro. But I got the idea from this thread, so I think I should post mine here.
I played around with rubik method, but instead of saving the terrrain types, I save the position z values. And the result is here :
1373676047.jpg

The map is not too eye catching, but the data array used to draw it may serve us at different use. I imagine a set of battle scenes that selected according the data. We can use it to select a grassy flat scene with mountain at fear east and little elevated ground at north using the data.
 
Somebody said:
Check header_terrain_types to see what terrain the water actually is, and replace it accordingly in the code.

Thanks!

I was thinking the same thing, but as I dont have the header_terrain_types I added a display_log to print all terrains codes to my rgl_log.txt. From there I will try to filter the correct codes.

I dont have the modules source, as VC has yet to release it for us. So its hard work on .txt files  :mrgreen:

New result  :party: :
80BF955C8F34F847CD1DD5A8E09C24E6349B94EB


 
Can I adjust the scaling (dimension*1000) for the map size?
My map is 240x240, but putting that for the sizes in the script results in the displayed map being too big and covering the legend.
 
Back
Top Bottom